Skip to content

Commit c037cd9

Browse files
authored
CSTACKEX-341: when disk offering parameter is same as the existing in… (#120)
… volume resize return early ### Description 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? In case a newerdiskofferingID is mentioned in API then it updates the DB. <img width="1394" height="814" alt="Screenshot 2026-10-13 at 11 53 33 AM" src="https://github.com/user-attachments/assets/9b4e8249-c639-4d29-8ca4-9431b4f1b6cd" /> when same ID is given then it immediately returns. <img width="1404" height="522" alt="Screenshot 2026-10-13 at 11 53 44 AM" src="https://github.com/user-attachments/assets/d6d0350c-464b-4644-9470-b8879ebdb48c" /> <!-- 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 8bdabd0 commit c037cd9

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,9 +1452,10 @@ public VolumeVO resizeVolume(ResizeVolumeCmd cmd) throws ResourceAllocationExcep
14521452
volumeResizeRequired = true;
14531453
}
14541454
if (!volumeMigrateRequired && !volumeResizeRequired) {
1455-
volume = _volsDao.findById(volume.getId());
1456-
if (newDiskOffering != null) {
1455+
1456+
if (newDiskOffering != null && newDiskOffering.getId()!=diskOffering.getId()) {
14571457
_volsDao.updateDiskOffering(volume.getId(), newDiskOffering.getId());
1458+
volume = _volsDao.findById(volume.getId());
14581459
updateStorageWithTheNewDiskOffering(volume, newDiskOffering);
14591460
}
14601461
return volume;

0 commit comments

Comments
 (0)