sathvikaragi opened a new pull request, #14442:
URL: https://github.com/apache/cloudstack/pull/14442
template size is counted twice when calculating the minimum primary
storagepool size required for managed pools
<img width="2196" height="902" alt="image"
src="https://github.com/user-attachments/assets/009bc45f-4375-41f7-ae1c-90edca683a87"
/>
### Description
storagePoolHasEnoughSpace accepts a pool when allocatedSizeWithTemplate
+ totalAskingSize fits. On the first VM deploy from a template onto a
managed pool, the template size was added on both sides.
During Vm creation,storagepoolhasenoughspace is called which then calls the
method getAllocatedPoolCapacity, which fetched the used bytes and template size
stored it in allocatedSizeWithTemplate. It then adds the volume size and
getAskingSizeForTemplateBasedOnClusterAndStoragePool into totalAskingSize.
That second call returns the template size again from
getBytesRequiredForTemplate when the pool is managed and clusterId is set. This
leads to getting total required size as used bytes + volume size + 2 ×
template size.
Managed pools now return only getUsedBytes from
getAllocatedPoolCapacity. The template is reserved once, in totalAskingSize.
This extra add came from Dell's PowerFlex PR.Before that, a managed pool
contributed only getUsedBytes to allocatedSizeWithTemplate.
This PR...
<!--- 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
- [X] Minor
#### Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [X] Minor
- [ ] Trivial
### Screenshots (if appropriate):
### How Has This Been Tested?
ISCSI VM creation , allocated size get's only used bytes of pool for first
time VM creation
<img width="1403" height="272" alt="Screenshot 2026-10-15 at 6 52 45 PM"
src="https://github.com/user-attachments/assets/3d862c7b-a8fe-472c-9857-29003284cb22"
/>
NFS VM creation , allocated size get's only used bytes of pool for first
time VM creation
<img width="1402" height="358" alt="Screenshot 2026-10-15 at 8 37 29 PM"
src="https://github.com/user-attachments/assets/88bdca34-3144-45f2-a081-4f864a48ed39"
/>
<img width="1453" height="271" alt="Screenshot 2026-10-15 at 8 38 43 PM"
src="https://github.com/user-attachments/assets/7b3635c5-d1df-4cf2-b38b-71dce915410e"
/>
<!-- 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]