sathvikaragi commented on code in PR #14259:
URL: https://github.com/apache/cloudstack/pull/14259#discussion_r4257721448
##########
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;
}
Review Comment:
Volume is now reloaded after _volsDao.updateDiskOffering, hence this issue
won't be faced.
--
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]