diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 9a48add3c31..f36f70d5c22 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -486,9 +486,13 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager } // Check that the volume is stored on shared storage - if (!Volume.State.Allocated.equals(volume.getState()) && !_storageMgr.volumeOnSharedStoragePool(volume)) { + if (!_storageMgr.volumeOnSharedStoragePool(volume)) { throw new InvalidParameterValueException("Please specify a volume that has been created on a shared storage pool."); } + + if (!(Volume.State.Allocated.equals(volume.getState()) || Volume.State.Ready.equals(volume.getState()))) { + throw new InvalidParameterValueException("Volume state must be in Allocated or Ready state"); + } // Check that the volume is not currently attached to any VM if (volume.getInstanceId() != null) {