DaanHoogland commented on code in PR #12367:
URL: https://github.com/apache/cloudstack/pull/12367#discussion_r2663997432
##########
server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java:
##########
@@ -2179,14 +2179,16 @@ public Volume changeDiskOfferingForVolumeInternal(Long
volumeId, Long newDiskOff
}
Collections.shuffle(suitableStoragePoolsWithEnoughSpace);
MigrateVolumeCmd migrateVolumeCmd = new
MigrateVolumeCmd(volume.getId(),
suitableStoragePoolsWithEnoughSpace.get(0).getId(), newDiskOffering.getId(),
true);
+ String volumeUuid = volume.getUuid();
try {
Volume result = migrateVolume(migrateVolumeCmd);
volume = (result != null) ? _volsDao.findById(result.getId())
: null;
if (volume == null) {
- throw new CloudRuntimeException(String.format("Volume
change offering operation failed for volume: %s migration failed to storage
pool %s", volume, suitableStoragePools.get(0)));
+ throw new CloudRuntimeException("Change offering for the
volume failed.");
}
} catch (Exception e) {
- throw new CloudRuntimeException(String.format("Volume change
offering operation failed for volume: %s migration failed to storage pool %s
due to %s", volume, suitableStoragePools.get(0), e.getMessage()));
+ logger.error("Volume change offering operation failed for
volume ID: {} migration failed to storage pool {} due to {}", volumeUuid,
suitableStoragePools.get(0).getId(), e.getMessage());
Review Comment:
this copilot remark seems in line with the code above.
--
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]