You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/12/21 13:04:33 UTC

[GitHub] [cloudstack] JoaoJandre opened a new pull request, #7011: Update usage when scaling vms

JoaoJandre opened a new pull request, #7011:
URL: https://github.com/apache/cloudstack/pull/7011

   ### Description
   
   When scaling a VM, the new details of the compute resources (memory, CPU speed, and CPU cores) are updated in the database after generating the usage event. This way, the usage events are generated with outdated details. Usage uses those events while generating entries in `cloud_usage.usage_vm_instance` and `cloud_usage.cloud_usage`, however, as in the scaling the details are updated after generating the events, the entries for the VM in `cloud_usage.usage_vm_instance` are always outdated after the scaling, as well the entries in `cloud_usage.cloud_usage`. In order to make Usage generate the proper entries, operators must stop and start the VM again (generating events of stop and start with the current VM compute resources' state).
   
   This PR intends to fix this behavior by updating the details before generating the usage event, making the events synchronized with the current VM compute resources' state.
   
   ### 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)
   - [ ] 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
   - [x] Minor
   - [ ] Trivial
   
   
   ### Screenshots (if appropriate):
   
   
   ### How Has This Been Tested?
   I set the `usage.stats.job.aggregation.range` setting to 1 minute to speed up the testing process, then I created a new VM with a constrained offering, and started scaling it.
   
   Before this change, the entries in `cloud_usage.usage_vm_instance` and `cloud_usage.cloud_usage` would contain the memory, CPU speed, and CPU cores of the VM from before the last scaling, e.g., after the first scaling, the entries would have the original details, after the second scaling, the entries would have the details from the first scaling, and so on.
   
   After this change, when dynamic scaling a VM, the events and entries in `cloud_usage.usage_vm_instance` and `cloud_usage.cloud_usage` are generated properly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] codecov[bot] commented on pull request #7011: Update usage when scaling vms

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #7011:
URL: https://github.com/apache/cloudstack/pull/7011#issuecomment-1361361513

   # [Codecov](https://codecov.io/gh/apache/cloudstack/pull/7011?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#7011](https://codecov.io/gh/apache/cloudstack/pull/7011?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (bd79b64) into [main](https://codecov.io/gh/apache/cloudstack/commit/cc676cbc83348ed0776c958f566342f31be8d855?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (cc676cb) will **increase** coverage by `0.01%`.
   > The diff coverage is `0.00%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##               main    #7011      +/-   ##
   ============================================
   + Coverage     11.27%   11.29%   +0.01%     
   - Complexity     7289     7308      +19     
   ============================================
     Files          2492     2494       +2     
     Lines        246812   246877      +65     
     Branches      38563    38577      +14     
   ============================================
   + Hits          27833    27884      +51     
   - Misses       215394   215400       +6     
   - Partials       3585     3593       +8     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/cloudstack/pull/7011?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...n/java/com/cloud/vm/VirtualMachineManagerImpl.java](https://codecov.io/gh/apache/cloudstack/pull/7011/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZW5naW5lL29yY2hlc3RyYXRpb24vc3JjL21haW4vamF2YS9jb20vY2xvdWQvdm0vVmlydHVhbE1hY2hpbmVNYW5hZ2VySW1wbC5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [.../src/main/java/com/cloud/vm/UserVmManagerImpl.java](https://codecov.io/gh/apache/cloudstack/pull/7011/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvY29tL2Nsb3VkL3ZtL1VzZXJWbU1hbmFnZXJJbXBsLmphdmE=) | `6.75% <0.00%> (-0.01%)` | :arrow_down: |
   | [...in/java/com/cloud/server/ManagementServerImpl.java](https://codecov.io/gh/apache/cloudstack/pull/7011/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvY29tL2Nsb3VkL3NlcnZlci9NYW5hZ2VtZW50U2VydmVySW1wbC5qYXZh) | `5.19% <0.00%> (-0.01%)` | :arrow_down: |
   | [...va/com/cloud/deploy/DeploymentPlanningManager.java](https://codecov.io/gh/apache/cloudstack/pull/7011/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZW5naW5lL2NvbXBvbmVudHMtYXBpL3NyYy9tYWluL2phdmEvY29tL2Nsb3VkL2RlcGxveS9EZXBsb3ltZW50UGxhbm5pbmdNYW5hZ2VyLmphdmE=) | `100.00% <0.00%> (ø)` | |
   | [...k/engine/cloud/entity/api/VMEntityManagerImpl.java](https://codecov.io/gh/apache/cloudstack/pull/7011/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZW5naW5lL29yY2hlc3RyYXRpb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2Nsb3Vkc3RhY2svZW5naW5lL2Nsb3VkL2VudGl0eS9hcGkvVk1FbnRpdHlNYW5hZ2VySW1wbC5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...k/affinity/NonStrictHostAntiAffinityProcessor.java](https://codecov.io/gh/apache/cloudstack/pull/7011/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGx1Z2lucy9hZmZpbml0eS1ncm91cC1wcm9jZXNzb3JzL25vbi1zdHJpY3QtaG9zdC1hbnRpLWFmZmluaXR5L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9jbG91ZHN0YWNrL2FmZmluaXR5L05vblN0cmljdEhvc3RBbnRpQWZmaW5pdHlQcm9jZXNzb3IuamF2YQ==) | `100.00% <0.00%> (ø)` | |
   | [...stack/affinity/NonStrictHostAffinityProcessor.java](https://codecov.io/gh/apache/cloudstack/pull/7011/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGx1Z2lucy9hZmZpbml0eS1ncm91cC1wcm9jZXNzb3JzL25vbi1zdHJpY3QtaG9zdC1hZmZpbml0eS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvY2xvdWRzdGFjay9hZmZpbml0eS9Ob25TdHJpY3RIb3N0QWZmaW5pdHlQcm9jZXNzb3IuamF2YQ==) | `71.79% <0.00%> (ø)` | |
   | [.../cloudstack/affinity/AffinityGroupServiceImpl.java](https://codecov.io/gh/apache/cloudstack/pull/7011/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9jbG91ZHN0YWNrL2FmZmluaXR5L0FmZmluaXR5R3JvdXBTZXJ2aWNlSW1wbC5qYXZh) | `38.75% <0.00%> (+0.29%)` | :arrow_up: |
   | [...om/cloud/deploy/DeploymentPlanningManagerImpl.java](https://codecov.io/gh/apache/cloudstack/pull/7011/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvY29tL2Nsb3VkL2RlcGxveS9EZXBsb3ltZW50UGxhbm5pbmdNYW5hZ2VySW1wbC5qYXZh) | `28.92% <0.00%> (+0.86%)` | :arrow_up: |
   | ... and [2 more](https://codecov.io/gh/apache/cloudstack/pull/7011/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland merged pull request #7011: Update usage when scaling vms

Posted by GitBox <gi...@apache.org>.
DaanHoogland merged PR #7011:
URL: https://github.com/apache/cloudstack/pull/7011


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] sonarcloud[bot] commented on pull request #7011: Update usage when scaling vms

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #7011:
URL: https://github.com/apache/cloudstack/pull/7011#issuecomment-1361378335

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=7011)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7011&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7011&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7011&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7011&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7011&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7011&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7011&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7011&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7011&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7011&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7011&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7011&resolved=false&types=CODE_SMELL)
   
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7011&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7011&metric=new_coverage&view=list)  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7011&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7011&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org