mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 6730: if a volume was never attached to a VM, then the poolId will be null and this will be flagged as not on shared storage. Since the code was deleting detached volumes only on shared storage, the never-attached volume was in an undeletable state. Instead, allow deletion of any detached volume, regardless of storage pool until some technical reason limits this from happening.
Also, the UI was not allowing volumes to be deleted due to a bug in looking at the vmname property of the volume. The 'if' conditional always returned true that the volume was attached to a VM to due a boolean logic error. status 6730: resolved fixed
This commit is contained in:
parent
4a1b1fe5ce
commit
8fafc892d3
@ -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) {
|
||||
|
||||
@ -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("<p>This volume is attached to virtual machine " + vmname + " and can't be deleted.</p>")
|
||||
$("#dialog_alert").dialog("open");
|
||||
return;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user