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 committed by Wei Zhou
parent 562aa0425b
commit 37866b4a42
1 changed files with 7 additions and 6 deletions

View File

@ -1866,14 +1866,15 @@
if (jsonObj.hypervisor != "Ovm" && jsonObj.state == "Ready") {
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("recurringSnapshot");
}
} else {
allowedActions.push("takeSnapshot");
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");