diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java index 842e0330602..047ca9fb469 100755 --- a/server/src/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/com/cloud/storage/StorageManagerImpl.java @@ -2487,9 +2487,12 @@ public class StorageManagerImpl implements StorageManager { // Check that the volume is stored on shared storage - if (!volumeOnSharedStoragePool(volume)) { - throw new InvalidParameterValueException("Please specify a volume that has been created on a shared storage pool."); - } + // NOTE: We used to ensure the volume is on shared storage before deleting. However, this seems like an unnecessary check since all we allow + // is deleting a detached volume. Is there a technical reason why the volume has to be on shared storage? If so, uncomment this...otherwise, + // just delete the detached volume regardless of storage pool. +// if (!volumeOnSharedStoragePool(volume)) { +// throw new InvalidParameterValueException("Please specify a volume that has been created on a shared storage pool."); +// } // Check that the volume is not currently attached to any VM if (volume.getInstanceId() != null) { diff --git a/ui/scripts/cloud.core.storage.js b/ui/scripts/cloud.core.storage.js index 580b03046d8..10ca6570729 100644 --- a/ui/scripts/cloud.core.storage.js +++ b/ui/scripts/cloud.core.storage.js @@ -959,7 +959,7 @@ function showStorageTab(domainId, targetTab) { switch (linkAction) { case "volume_action_delete" : //check if this volume is attached to a virtual machine. If yes, can't be deleted. - if(vmname != null && (vmname != "" || vmname != "none")) { + if(vmname != null && vmname != "" && vmname != "none") { $("#dialog_alert").html("

This volume is attached to virtual machine " + vmname + " and can't be deleted.

") $("#dialog_alert").dialog("open"); return;