Skip to content

Commit 78589f0

Browse files
author
Mike Tutkowski
committed
If a custom disk size and a non-custom disk offering are passed to resizeVolume, fail the operation.
1 parent e4c0213 commit 78589f0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

server/src/com/cloud/storage/VolumeApiServiceImpl.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,10 @@ public VolumeVO resizeVolume(ResizeVolumeCmd cmd) throws ResourceAllocationExcep
974974
// convert from GiB to bytes
975975
newSize = newSize << 30;
976976
} else {
977+
if (cmd.getSize() != null) {
978+
throw new InvalidParameterValueException("You cannnot pass in a custom disk size to a non-custom disk offering.");
979+
}
980+
977981
newSize = newDiskOffering.getDiskSize();
978982
}
979983

0 commit comments

Comments
 (0)