Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1063,14 +1063,6 @@ public VolumeVO resizeVolume(ResizeVolumeCmd cmd) throws ResourceAllocationExcep
* This will be checked again at the hypervisor level where we can see
* the actual disk size.
*/
if (currentSize > newSize) {
VolumeVO vol = _volsDao.findById(cmd.getEntityId());
if (vol != null && ImageFormat.QCOW2.equals(vol.getFormat()) && !Volume.State.Allocated.equals(volume.getState())) {
String message = "Unable to shrink volumes of type QCOW2";
s_logger.warn(message);
throw new InvalidParameterValueException(message);
}
}
if (currentSize > newSize && !shrinkOk) {
throw new InvalidParameterValueException("Going from existing size of " + currentSize + " to size of " + newSize + " would shrink the volume."
+ "Need to sign off by supplying the shrinkok parameter with value of true.");
Expand Down Expand Up @@ -1323,7 +1315,7 @@ private VolumeVO orchestrateResizeVolume(long volumeId, long currentSize, long n
return volume;

} catch (Exception e) {
throw new CloudRuntimeException("Exception caught during resize volume operation of volume UUID: " + volume.getUuid(), e);
throw new CloudRuntimeException(String.format("Failed to resize volume operation of volume UUID: [%s] due to - %s", volume.getUuid(), e.getMessage()), e);
}
}

Expand Down