Skip to content

Conversation

@abh1sar
Copy link
Collaborator

@abh1sar abh1sar commented Dec 3, 2025

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)
  • 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
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

Primary storage ...pri2 is added to Datastore Cluster DC1.

Screenshot 2025-12-03 at 5 44 15 PM Screenshot 2025-12-03 at 5 59 15 PM

Before Fix :
Screenshot 2025-12-03 at 2 44 01 PM

After Fix :
Screenshot 2025-12-03 at 6 05 02 PM

How did you try to break this feature and the system with this change?

@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 16.23%. Comparing base (4f74937) to head (2583a8c).

Files with missing lines Patch % Lines
...n/java/com/cloud/capacity/dao/CapacityDaoImpl.java 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.20   #12181   +/-   ##
=========================================
  Coverage     16.23%   16.23%           
- Complexity    13375    13380    +5     
=========================================
  Files          5657     5657           
  Lines        498875   498879    +4     
  Branches      60546    60546           
=========================================
+ Hits          80982    81017   +35     
+ Misses       408866   408827   -39     
- Partials       9027     9035    +8     
Flag Coverage Δ
uitests 4.00% <ø> (ø)
unittests 17.09% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@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.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15909

@DaanHoogland
Copy link
Contributor

@blueorangutan test ol9 vmware-80u3e

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (ol9 mgmt + vmware-80u3e) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-14907)

Copy link
Contributor

@harikrishna-patnala harikrishna-patnala left a comment

Choose a reason for hiding this comment

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

code LGTM

@harikrishna-patnala
Copy link
Contributor

@blueorangutan test ol9 vmware-80u3e

@blueorangutan
Copy link

@harikrishna-patnala a [SL] Trillian-Jenkins test job (ol9 mgmt + vmware-80u3e) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-14909)

Copy link
Contributor

@sureshanaparti sureshanaparti left a comment

Choose a reason for hiding this comment

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

clgtm

@abh1sar
Copy link
Collaborator Author

abh1sar commented Dec 9, 2025

@blueorangutan test ol9 vmware-80u3e

@blueorangutan
Copy link

@abh1sar a [SL] Trillian-Jenkins test job (ol9 mgmt + vmware-80u3e) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-14935)

@abh1sar
Copy link
Collaborator Author

abh1sar commented Jan 2, 2026

@blueorangutan package

@blueorangutan
Copy link

@abh1sar 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.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16229

@abh1sar
Copy link
Collaborator Author

abh1sar commented Jan 2, 2026

@blueorangutan test

@blueorangutan
Copy link

@abh1sar a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-15109)

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.

5 participants