List capacity double counts allocated storage pool capacity for datastore clusters
Description
This PR fixes #11937
When a primary storage is added to a Datastore cluster, the op_host_capacity table contains entries for both the Primary storage and the Datastore cluster. ListCapacity counts the allocated capacity twice because of this. Fix is to skip any storage pool that has children from capacity calculation.
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)
- [ ] Build/CI
- [ ] Test (unit or integration test code)
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?
Primary storage ...pri2 is added to Datastore Cluster DC1.
Before Fix :
After Fix :
How did you try to break this feature and the system with this change?
Codecov Report
:x: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 16.17%. Comparing base (028dd86) to head (a3daddb).
:warning: Report is 4 commits behind head on 4.20.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| ...n/java/com/cloud/capacity/dao/CapacityDaoImpl.java | 0.00% | 4 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## 4.20 #12181 +/- ##
============================================
- Coverage 16.18% 16.17% -0.01%
Complexity 13298 13298
============================================
Files 5657 5657
Lines 498470 498482 +12
Branches 60493 60501 +8
============================================
- Hits 80660 80652 -8
- Misses 408830 408852 +22
+ Partials 8980 8978 -2
| Flag | Coverage Δ | |
|---|---|---|
| uitests | 4.00% <ø> (-0.01%) |
:arrow_down: |
| unittests | 17.03% <0.00%> (-0.01%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
@blueorangutan package
@DaanHoogland 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]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15909
@blueorangutan test ol9 vmware-80u3e
@DaanHoogland a [SL] Trillian-Jenkins test job (ol9 mgmt + vmware-80u3e) has been kicked to run smoke tests
[SF] Trillian Build Failed (tid-14907)
@blueorangutan test ol9 vmware-80u3e
@harikrishna-patnala a [SL] Trillian-Jenkins test job (ol9 mgmt + vmware-80u3e) has been kicked to run smoke tests
[SF] Trillian Build Failed (tid-14909)
@blueorangutan test ol9 vmware-80u3e
@abh1sar a [SL] Trillian-Jenkins test job (ol9 mgmt + vmware-80u3e) has been kicked to run smoke tests
[SF] Trillian Build Failed (tid-14935)