diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java index 4ff7686cab8..533f6fa6162 100644 --- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java +++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java @@ -1169,11 +1169,11 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic VolumeVO volume = _volsDao.findById(volumeId); if (volume == null) { - throw new InvalidParameterValueException("Unable to aquire volume with ID: " + volumeId); + throw new InvalidParameterValueException("Unable to find volume with ID: " + volumeId); } if (!_snapshotMgr.canOperateOnVolume(volume)) { - throw new InvalidParameterValueException("There are snapshot creating on it, Unable to delete the volume"); + throw new InvalidParameterValueException("There are snapshot operations in progress on the volume, unable to delete it"); } _accountMgr.checkAccess(caller, null, true, volume); @@ -1189,6 +1189,10 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic } } + if (volume.getState() == Volume.State.NotUploaded || volume.getState() == Volume.State.UploadInProgress) { + throw new InvalidParameterValueException("The volume is either getting uploaded or it may be initiated shortly, please wait for it to be completed"); + } + try { if (volume.getState() != Volume.State.Destroy && volume.getState() != Volume.State.Expunging && volume.getState() != Volume.State.Expunging) { Long instanceId = volume.getInstanceId();