cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Updated resource counter to include correct size after volume creation/resize and other improvements

Open sureshanaparti opened this issue 2 years ago • 25 comments

Description

This PR updates primary_storage resource counter to include correct size after volume creation/resize and other improvements.

  • Recalculate resource counters for root domain in the periodic task
  • Update correct size in the primary_storage resource counter after volume creation/resize
  • Some code improvements

Types of changes

  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] New feature (non-breaking change which adds functionality)
  • [x] Bug fix (non-breaking change which fixes an issue)
  • [x] Enhancement (improves an existing feature and functionality)
  • [ ] Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • [ ] Major
  • [x] Minor

Bug Severity

  • [ ] BLOCKER
  • [ ] Critical
  • [x] Major
  • [ ] Minor
  • [ ] Trivial

How Has This Been Tested?

Manually tested VM/Volume operations using ScaleIO/PowerFlex pool and checked the primary_storage resource counters for different domains.

Before fix (primarystorageavailable counter is not shown appropriately for unlimited):

(testenv) 🐱 > list domains filter=name,primarystoragetotal,primarystoragelimit,primarystorageavailable
{
  "count": 3,
  "domain": [
    {
      "name": "ROOT",
      "primarystorageavailable": "Unlimited",
      "primarystoragelimit": "Unlimited",
      "primarystoragetotal": -5
    },
    {
      "name": "Domain01",
      "primarystorageavailable": "-1",
      "primarystoragelimit": "-1",
      "primarystoragetotal": 0
    },
    {
      "name": "Domain02",
      "primarystorageavailable": "-1",
      "primarystoragelimit": "-1",
      "primarystoragetotal": 0
    }
  ]
}
(testenv) 🐱 > list domains filter=name,primarystoragetotal,primarystoragelimit,primarystorageavailable
{
  "count": 3,
  "domain": [
    {
      "name": "ROOT",
      "primarystorageavailable": "Unlimited",
      "primarystoragelimit": "Unlimited",
      "primarystoragetotal": 3
    },
    {
      "name": "Domain01",
      "primarystorageavailable": "-9",
      "primarystoragelimit": "-1",
      "primarystoragetotal": 8
    },
    {
      "name": "Domain02",
      "primarystorageavailable": "-1",
      "primarystoragelimit": "-1",
      "primarystoragetotal": 0
    }
  ]
}
(testenv) 🐱 > list domains filter=name,primarystoragetotal,primarystoragelimit,primarystorageavailable
{
  "count": 3,
  "domain": [
    {
      "name": "ROOT",
      "primarystorageavailable": "Unlimited",
      "primarystoragelimit": "Unlimited",
      "primarystoragetotal": 6
    },
    {
      "name": "Domain01",
      "primarystorageavailable": "-25",
      "primarystoragelimit": "-1",
      "primarystoragetotal": 24
    },
    {
      "name": "Domain02",
      "primarystorageavailable": "-1",
      "primarystoragelimit": "-1",
      "primarystoragetotal": 0
    }
  ]
}

After fix =>

(testenv) 🐱 > list domains filter=name,primarystoragetotal,primarystoragelimit,primarystorageavailable
{
  "count": 3,
  "domain": [
    {
      "name": "ROOT",
      "primarystorageavailable": "Unlimited",
      "primarystoragelimit": "Unlimited",
      "primarystoragetotal": 88
    },
    {
      "name": "Domain01",
      "primarystorageavailable": "Unlimited",
      "primarystoragelimit": "Unlimited",
      "primarystoragetotal": 40
    },
    {
      "name": "Domain02",
      "primarystorageavailable": "Unlimited",
      "primarystoragelimit": "Unlimited",
      "primarystoragetotal": 24
    }
  ]
}

sureshanaparti avatar Jul 29 '22 11:07 sureshanaparti

@blueorangutan package

sureshanaparti avatar Jul 29 '22 11:07 sureshanaparti

@sureshanaparti a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

blueorangutan avatar Jul 29 '22 11:07 blueorangutan

Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 3856

blueorangutan avatar Jul 29 '22 12:07 blueorangutan

@blueorangutan test

sureshanaparti avatar Jul 29 '22 12:07 sureshanaparti

@sureshanaparti a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

blueorangutan avatar Jul 29 '22 12:07 blueorangutan

Found UI changes, kicking a new UI QA build @blueorangutan ui

acs-robot avatar Aug 03 '22 15:08 acs-robot

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

blueorangutan avatar Aug 03 '22 15:08 blueorangutan

UI build: :heavy_check_mark: Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6587 (SL-JID-2073)

blueorangutan avatar Aug 03 '22 15:08 blueorangutan

@blueorangutan package

DaanHoogland avatar Aug 04 '22 08:08 DaanHoogland

@DaanHoogland a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

blueorangutan avatar Aug 04 '22 08:08 blueorangutan

Packaging result: :heavy_multiplication_x: el7 :heavy_multiplication_x: el8 :heavy_multiplication_x: debian :heavy_check_mark: suse15. SL-JID 3902

blueorangutan avatar Aug 04 '22 09:08 blueorangutan

Packaging result: :heavy_multiplication_x: el7 :heavy_check_mark: el8 :heavy_multiplication_x: debian :heavy_multiplication_x: suse15. SL-JID 3907

blueorangutan avatar Aug 04 '22 13:08 blueorangutan

Packaging result: :heavy_multiplication_x: el7 :heavy_check_mark: el8 :heavy_multiplication_x: debian :heavy_multiplication_x: suse15. SL-JID 3913

blueorangutan avatar Aug 05 '22 10:08 blueorangutan

Packaging result: :heavy_multiplication_x: el7 :heavy_multiplication_x: el8 :heavy_multiplication_x: debian :heavy_multiplication_x: suse15. SL-JID 3917

blueorangutan avatar Aug 05 '22 11:08 blueorangutan

@blueorangutan package

sureshanaparti avatar Aug 07 '22 17:08 sureshanaparti

@sureshanaparti a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

blueorangutan avatar Aug 07 '22 17:08 blueorangutan

Packaging result: :heavy_multiplication_x: el7 :heavy_check_mark: el8 :heavy_multiplication_x: debian :heavy_multiplication_x: suse15. SL-JID 3926

blueorangutan avatar Aug 08 '22 04:08 blueorangutan

@blueorangutan package

borisstoyanov avatar Aug 09 '22 06:08 borisstoyanov

@borisstoyanov a Jenkins job has been kicked to build packages. It will be bundled with SystemVM template(s). I'll keep you posted as I make progress.

blueorangutan avatar Aug 09 '22 06:08 blueorangutan

Packaging result: :heavy_multiplication_x: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 3944

blueorangutan avatar Aug 09 '22 07:08 blueorangutan

Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 3945

blueorangutan avatar Aug 09 '22 08:08 blueorangutan

@blueorangutan test

borisstoyanov avatar Aug 11 '22 06:08 borisstoyanov

@borisstoyanov a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

blueorangutan avatar Aug 11 '22 06:08 blueorangutan

Trillian test result (tid-4672) Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7 Total time taken: 39739 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6587-t4672-kvm-centos7.zip Smoke tests completed. 100 look OK, 1 have errors Only failed tests results shown below:

Test Result Time (s) Test File
test_08_upgrade_kubernetes_ha_cluster Failure 621.02 test_kubernetes_clusters.py

blueorangutan avatar Aug 11 '22 18:08 blueorangutan

cc @harikrishna-patnala @shwstppr @DaanHoogland do we need this in 4.17 branch?

rohityadavcloud avatar Aug 16 '22 09:08 rohityadavcloud