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)

@DaanHoogland
Copy link
Contributor

@abh1sar , I don’t see any significant difference between your “before” and “after” pictures. Can you explain? (the theory is clear btw, just not the symptoms)

@weizhouapache
Copy link
Member

@abh1sar , I don’t see any significant difference between your “before” and “after” pictures. Can you explain? (the theory is clear btw, just not the symptoms)

image

15.81TB -> 10.54 TB, as the capacity of pool DC1 is not considered ?

@DaanHoogland
Copy link
Contributor

@abh1sar , I don’t see any significant difference between your “before” and “after” pictures. Can you explain? (the theory is clear btw, just not the symptoms)

image 15.81TB -> 10.54 TB, as the capacity of pool `DC1` is not considered ?

ok, tnx @weizhouapache . The pictures both show about 5TB on the “used” metric and almost nothing “allocated". As there is about nothing allocated (10GB) i gave that number no eye.

@abh1sar
Copy link
Collaborator Author

abh1sar commented Jan 5, 2026

@blueorangutan help

@blueorangutan
Copy link

@abh1sar [SL] I understand these words: "help", "hello", "thanks", "package", "test"
Test command usage: test [mgmt os] [hypervisor] [keepEnv] [qemuEv] [basicZone|securityGroups]
Mgmt OS options: ['suse15', 'alma10', 'ol10', 'rocky10', 'alma9', 'centos7', 'centos6', 'rocky9', 'alma8', 'ubuntu18', 'ol9', 'ol8', 'ubuntu22', 'debian12', 'ubuntu20', 'rocky8', 'ubuntu24']
Hypervisor options: ['kvm-centos6', 'kvm-centos7', 'kvm-rocky8', 'kvm-rocky9', 'kvm-rocky10', 'kvm-ol8', 'kvm-ol9', 'kvm-ol10', 'kvm-alma8', 'kvm-alma9', 'kvm-alma10', 'kvm-ubuntu18', 'kvm-ubuntu20', 'kvm-ubuntu22', 'kvm-ubuntu24', 'kvm-debian12', 'kvm-suse15', 'vmware-55u3', 'vmware-60u2', 'vmware-65u2', 'vmware-67u3', 'vmware-70u1', 'vmware-70u2', 'vmware-70u3', 'vmware-80', 'vmware-80u1', 'vmware-80u2', 'vmware-80u3', 'vmware-80u3e', 'xenserver-65sp1', 'xenserver-71', 'xenserver-74', 'xenserver-84', 'xcpng74', 'xcpng76', 'xcpng80', 'xcpng81', 'xcpng82', 'xcpng83']
Note: when keepEnv is passed, you need to specify mgmt server os and hypervisor or use the matrix command.
when qemuEv is passed, it will deploy KVM hyperviosr hosts with qemu-kvm-ev, else it will default to stock qemu.
When basicZone and/or securityGroups are passed it will create a zone of the last type specified (default is Advanced)
Package command usage: package [all(default value),kvm,xen,vmware,hyperv,ovm] - a comma separated list can be passed with package command to bundle the required hypervisor's systemVM templates. Not passing any argument will bundle all - kvm,xen and vmware templates.

Blessed contributors for kicking Trillian test jobs: ['rohityadavcloud', 'shwstppr', 'Damans227', 'vishesh92', 'Pearl1594', 'harikrishna-patnala', 'nvazquez', 'DaanHoogland', 'weizhouapache', 'borisstoyanov', 'vladimirpetrov', 'kiranchavala', 'andrijapanicsb', 'NuxRo', 'rajujith', 'alexandremattioli', 'sureshanaparti', 'abh1sar', 'sudo87', 'RosiKyu']

@abh1sar
Copy link
Collaborator Author

abh1sar commented Jan 5, 2026

@blueorangutan test keepEnv

@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 test result (tid-15112)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 52246 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr12181-t15112-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@blueorangutan
Copy link

[SF] Trillian test result (tid-15126)
Environment: vmware-80u3 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 68651 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr12181-t15126-vmware-80u3.zip
Smoke tests completed. 140 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_ping_in_vr_success Failure 15.36 test_diagnostics.py
test_07_arping_in_vr Failure 5.16 test_diagnostics.py

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.

listCapacity API showing wrong values for storage capacity type in case of Datastore Cluster

6 participants