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

   ### 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.
   
   
   <!--- Describe your changes in DETAIL - And how has behaviour functionally 
changed. -->
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to 
reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be 
closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   <!--- 
******************************************************************************* 
-->
   <!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE 
DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- 
******************************************************************************* 
-->
   
   ### 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.
   
   <img width="783" height="255" alt="Screenshot 2025-12-03 at 5 44 15 PM" 
src="https://github.com/user-attachments/assets/61f9f3ff-750a-461f-8ebc-46e5f90e0119";
 />
   
   <img width="899" height="222" alt="Screenshot 2025-12-03 at 5 59 15 PM" 
src="https://github.com/user-attachments/assets/14b601a6-a124-4ee6-8c2b-d4c72c274fb5";
 />
   
   Before Fix : 
   <img width="2889" height="1189" alt="Screenshot 2025-12-03 at 2 44 01 PM" 
src="https://github.com/user-attachments/assets/17d34859-2d21-4146-a5b6-9e4aaede3152";
 />
   
   After Fix :
   <img width="1594" height="965" alt="Screenshot 2025-12-03 at 6 05 02 PM" 
src="https://github.com/user-attachments/assets/1f579510-9d9f-48c1-8985-d1d376a4ee35";
 />
   
   
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to 
-->
   
   #### How did you try to break this feature and the system with this change?
   
   <!-- see how your change affects other areas of the code, etc. -->
   
   <!-- Please read the 
[CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) 
document -->
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to