mirror of https://github.com/apache/cloudstack.git
disable attach volume to a vm if volume state is not in allocated or ready state
This commit is contained in:
parent
301a5f7bcc
commit
5696543359
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue