CLOUDSTACK-4428: UI > volume > take snapshot action, recurring snapshot action > for volumes whose hypervisor is KVM and whose VM is not Running, always show the 2 actions regardless value of "kvm.snapshot.enabled".

This commit is contained in:
Jessica Wang 2013-11-26 15:04:08 -08:00
parent 2145505d30
commit 8ce6d5271c

View File

@ -1896,13 +1896,14 @@
if (jsonObj.hypervisor != "Ovm" && jsonObj.state == "Ready") { if (jsonObj.hypervisor != "Ovm" && jsonObj.state == "Ready") {
if (jsonObj.hypervisor == 'KVM') { if (jsonObj.hypervisor == 'KVM') {
if (g_KVMsnapshotenabled == true) { if (json.vmstate == 'Running') {
if (g_KVMsnapshotenabled == true) { //"kvm.snapshot.enabled" flag should be taken to account only when snapshot is being created for Running vm (CLOUDSTACK-4428)
allowedActions.push("takeSnapshot"); allowedActions.push("takeSnapshot");
allowedActions.push("recurringSnapshot"); allowedActions.push("recurringSnapshot");
} else {
if(jsonObj.vmstate == 'Stopped' || jsonObj.virtualmachineid == undefined) { //volume of stopped VM, or detached volume
allowedActions.push("takeSnapshot");
} }
} else {
allowedActions.push("takeSnapshot");
allowedActions.push("recurringSnapshot");
} }
} else { } else {
allowedActions.push("takeSnapshot"); allowedActions.push("takeSnapshot");