-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix resource count discrepancies #8302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix resource count discrepancies #8302
Conversation
|
@blueorangutan package |
|
@vishesh92 a [SL] 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. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8302 +/- ##
=============================================
+ Coverage 15.88% 30.92% +15.04%
- Complexity 15718 33688 +17970
=============================================
Files 5172 5397 +225
Lines 364426 379499 +15073
Branches 53574 55373 +1799
=============================================
+ Hits 57874 117354 +59480
+ Misses 299648 246565 -53083
- Partials 6904 15580 +8676
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
Packaging result [SF]: ✖️ el7 ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 7924 |
45d6668 to
e7ec0d4
Compare
|
@blueorangutan package |
|
@vishesh92 a [SL] 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. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7928 |
e7ec0d4 to
f1516aa
Compare
f1516aa to
61488bc
Compare
|
@blueorangutan package |
|
@vishesh92 a [SL] 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. |
|
@vishesh92 does it affect only 4.18, or we're aiming to fix in main/4.19+ ? |
@rohityadavcloud Both 4.18 & main are affected. This requires a migration which will make the upgrade path a little complex with 4.18.2. So, I have raised this PR against main/4.19. |
61488bc to
c3812d6
Compare
| _resourceLimitMgr.incrementResourceCount(accountId, ResourceType.cpu, displayVm, cpu); | ||
| _resourceLimitMgr.incrementResourceCount(accountId, ResourceType.memory, displayVm, memory); | ||
| if (!VirtualMachineManager.ResourceCountRunningVMsonly.value()) { | ||
| Transaction.execute(new TransactionCallbackNoReturn() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another way to do this without incrementing all three in a transaction would require adding columns for each reservation type (user_vm, cpu, memory) in user_vm table since cpu & memory are calculated using the user_vm table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar solution for primary_storage & volume as well.
|
@blueorangutan package |
|
@rohityadavcloud a [SL] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests |
|
@blueorangutan package |
|
@vishesh92 a [SL] 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. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8855 |
|
[SF] Trillian test result (tid-9393)
|
|
[SF] Trillian test result (tid-9395)
|
|
[SF] Trillian test result (tid-9394)
|
|
@blueorangutan test matrix |
|
@vishesh92 a [SL] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-9401)
|
|
[SF] Trillian test result (tid-9399)
|
|
[SF] Trillian test result (tid-9400)
|
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
@vishesh92 can you address the merge conflict and re-run the packaging and smoktests |
|
@blueorangutan package |
|
@vishesh92 a [SL] 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. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8916 |
|
@blueorangutan test |
|
@vishesh92 a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-9451)
|
* Fix resource count discrepancies * Fixup while removing vm * Fix discrepancies when starting VMs * Fixup tests * Fix failing tests * Don't take lock when amount is negative --------- Co-authored-by: dahn <daan@onecht.net>
Description
Needs some rework which will be done after #8362 is merged.
This PR fixes the resource count discrepancies which happen when resource count is being incremented or decremented and recalculation of resource count happens at the same time.
Requires 2 Management servers to reproduce
cloudstack/server/src/main/java/com/cloud/resourcelimit/ResourceLimitManagerImpl.java
Line 889 in 7243946
You will see a log line with the following text
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?