diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 2e08aa4e96f..3e055b4db5f 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -488,9 +488,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) {