Repository navigation
Commit e363c97
authored
CSTACKEX-337: fixing the bug for First VM deployment double-counts template size (#125)
template size is counted twice when calculating the minimum primary
storagepool size required
<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.
For a root volume, the method passes the template into
getAllocatedPoolCapacity, which 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. The check asked for 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"
/>
BOTH NFS AND ISCSI POOLS WERE MADE OF 18 GB and succeeded
<img width="1517" height="118" alt="Screenshot 2026-10-15 at 8 38 52 PM"
src="https://github.com/user-attachments/assets/ba7607d6-c176-4216-88ab-3b934c5df549"
/>
<!-- 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 -->1 parent be1f7dd commit e363c97
1 file changed
Lines changed: 3 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
573 | 573 | | |
574 | 574 | | |
575 | 575 | | |
| 576 | + | |
| 577 | + | |
576 | 578 | | |
577 | 579 | | |
578 | 580 | | |
579 | 581 | | |
580 | 582 | | |
581 | 583 | | |
582 | 584 | | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
| 585 | + | |
595 | 586 | | |
596 | 587 | | |
597 | 588 | | |
| |||
0 commit comments