Skip to content

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

Merged
DaanHoogland merged 2 commits intoapache:mainfrom
shapeblue:resource_counter_improvements
Aug 16, 2022
Merged

Updated resource counter to include correct size after volume creation/resize and other improvements#6587
DaanHoogland merged 2 commits intoapache:mainfrom
shapeblue:resource_counter_improvements

Conversation

@sureshanaparti
Copy link
Copy Markdown
Contributor

@sureshanaparti sureshanaparti commented Jul 29, 2022

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)
  • Bug fix (non-breaking change which fixes an issue)
  • 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
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • 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
    }
  ]
}

…n/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
@sureshanaparti
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@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
Copy link
Copy Markdown

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

@sureshanaparti
Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

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

@apache apache deleted a comment from blueorangutan Jul 29, 2022
@acs-robot
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

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

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Aug 3, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

15.5% 15.5% Coverage
0.0% 0.0% Duplication

Copy link
Copy Markdown
Contributor

@JoaoJandre JoaoJandre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLGTM

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan package

@DaanHoogland DaanHoogland marked this pull request as draft August 4, 2022 08:37
@blueorangutan
Copy link
Copy Markdown

@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
Copy link
Copy Markdown

Packaging result: ✖️ el7 ✖️ el8 ✖️ debian ✔️ suse15. SL-JID 3902

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✖️ el7 ✔️ el8 ✖️ debian ✖️ suse15. SL-JID 3907

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✖️ el7 ✔️ el8 ✖️ debian ✖️ suse15. SL-JID 3913

@blueorangutan
Copy link
Copy Markdown

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

@sureshanaparti
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@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
Copy link
Copy Markdown

Packaging result: ✖️ el7 ✔️ el8 ✖️ debian ✖️ suse15. SL-JID 3926

@borisstoyanov
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@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
Copy link
Copy Markdown

Packaging result: ✖️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 3944

@blueorangutan
Copy link
Copy Markdown

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

@borisstoyanov
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

@borisstoyanov borisstoyanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DaanHoogland DaanHoogland marked this pull request as ready for review August 16, 2022 08:40
@DaanHoogland DaanHoogland merged commit 75da982 into apache:main Aug 16, 2022
@yadvr yadvr added this to the 4.18.0.0 milestone Aug 16, 2022
@yadvr
Copy link
Copy Markdown
Member

yadvr commented Aug 16, 2022

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

neogismm pushed a commit to neogismm/cloudstack that referenced this pull request Sep 5, 2022
…n/resize and other improvements (apache#6587)

* Updated 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

* review and sonarcloud issues

Co-authored-by: Suresh Kumar Anaparti <suresh.anaparti@shapeblue.com>
Co-authored-by: Daan Hoogland <daan@onecht.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants