From 762a4c97c9d3cfeaeb2cef1f0853204fd1bc02b6 Mon Sep 17 00:00:00 2001 From: Sathvika Date: Fri, 25 Sep 2026 14:56:42 +0530 Subject: [PATCH 1/2] =?UTF-8?q?CSTACKEX-321:=20when=20nothing=20is=20chang?= =?UTF-8?q?ed=20in=20volume=20resize=20wizard=20directl=E2=80=A6=20(#110)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Calling resizeVolume with the existing volume size still invoked the storage driver, causing an unnecessary driver resize request for volumes. ### Description This PR... ### 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): Before Patch API is still called in case of no changes in the wizard: Screenshot 2026-09-24 at 4 33
33 PM actually resizes (IN UI) Screenshot 2026-09-24 at 4 36 00 PM after the fix Patch api is not called : Screenshot 2026-09-24 at 4 17
52 PM Shows success immediately: Screenshot 2026-09-24 at 4 28 37 PM ### How Has This Been Tested? #### How did you try to break this feature and the system with this change? --- .../java/com/cloud/storage/VolumeApiServiceImpl.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java index 8674014addd7..faee433583cc 100644 --- a/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java +++ b/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java @@ -1446,11 +1446,12 @@ public VolumeVO resizeVolume(ResizeVolumeCmd cmd) throws ResourceAllocationExcep if (currentSize != newSize || !compareEqualsIncludingNullOrZero(newMaxIops, volume.getMaxIops()) || !compareEqualsIncludingNullOrZero(newMinIops, volume.getMinIops())) { volumeResizeRequired = true; } - if (!volumeMigrateRequired && !volumeResizeRequired && newDiskOffering != null) { - _volsDao.updateDiskOffering(volume.getId(), newDiskOffering.getId()); + if (!volumeMigrateRequired && !volumeResizeRequired) { volume = _volsDao.findById(volume.getId()); - updateStorageWithTheNewDiskOffering(volume, newDiskOffering); - + if (newDiskOffering != null) { + _volsDao.updateDiskOffering(volume.getId(), newDiskOffering.getId()); + updateStorageWithTheNewDiskOffering(volume, newDiskOffering); + } return volume; } From 43f463bffd6ab64441e1410fd1701fb1678cff26 Mon Sep 17 00:00:00 2001 From: Sathvika Date: Tue, 13 Oct 2026 16:08:19 +0530 Subject: [PATCH 2/2] =?UTF-8?q?CSTACKEX-341:=20when=20disk=20offering=20pa?= =?UTF-8?q?rameter=20is=20same=20as=20the=20existing=20in=E2=80=A6=20(#120?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … volume resize return early ### Description This PR... ### 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. Screenshot 2026-10-13 at 11 53
33 AM when same ID is given then it immediately returns. Screenshot 2026-10-13 at 11 53
44 AM #### How did you try to break this feature and the system with this change? --- .../main/java/com/cloud/storage/VolumeApiServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java index faee433583cc..37fe2c7dee11 100644 --- a/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java +++ b/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java @@ -1447,9 +1447,10 @@ public VolumeVO resizeVolume(ResizeVolumeCmd cmd) throws ResourceAllocationExcep volumeResizeRequired = true; } if (!volumeMigrateRequired && !volumeResizeRequired) { - volume = _volsDao.findById(volume.getId()); - if (newDiskOffering != null) { + + if (newDiskOffering != null && newDiskOffering.getId()!=diskOffering.getId()) { _volsDao.updateDiskOffering(volume.getId(), newDiskOffering.getId()); + volume = _volsDao.findById(volume.getId()); updateStorageWithTheNewDiskOffering(volume, newDiskOffering); } return volume;