Skip volume resize during service offering change when no size exists (#200)

Signed-off-by: Marcus Sorensen <mls@apple.com>
This commit is contained in:
Marcus Sorensen 2022-09-26 11:29:28 -06:00 committed by GitHub
parent 1fcd32fa33
commit 248956351f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -1284,6 +1284,11 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
for (final VolumeVO rootVolumeOfVm : vols) {
DiskOfferingVO currentRootDiskOffering = _diskOfferingDao.findById(rootVolumeOfVm.getDiskOfferingId());
if (currentRootDiskOffering.getDiskSize() == 0 && newRootDiskOffering.getDiskSize() == 0) {
s_logger.debug("This change of service offering doesn't involve custom root disk sizes, skipping volume resize for volume: " + rootVolumeOfVm);
continue;
}
ResizeVolumeCmd resizeVolumeCmd = prepareResizeVolumeCmd(rootVolumeOfVm, currentRootDiskOffering, newRootDiskOffering);
if (rootVolumeOfVm.getDiskOfferingId() != newRootDiskOffering.getId()) {