CLOUDSTACK-4428: UI > volume > when hypervisor is KVM and kvm.snapshot.enabled configuration is false, still show Take Snapshot option if VM State is Stopped.

This commit is contained in:
Jessica Wang 2013-08-21 16:29:14 -07:00
parent 96a17cc036
commit dac66d74df

View File

@ -1864,13 +1864,21 @@
return ["remove"];
}
if (jsonObj.hypervisor != "Ovm" && jsonObj.state == "Ready") {
if(jsonObj.hypervisor != 'KVM'
|| (jsonObj.hypervisor == 'KVM' && g_KVMsnapshotenabled == true) ) {
allowedActions.push("takeSnapshot");
if (jsonObj.hypervisor != "Ovm" && jsonObj.state == "Ready") {
if (jsonObj.hypervisor == 'KVM') {
if (g_KVMsnapshotenabled == true) {
allowedActions.push("takeSnapshot");
allowedActions.push("recurringSnapshot");
} else {
if(jsonObj.vmstate == 'Stopped') {
allowedActions.push("takeSnapshot");
}
}
} else {
allowedActions.push("takeSnapshot");
allowedActions.push("recurringSnapshot");
}
}
if (jsonObj.type == "DATADISK") {
allowedActions.push("resize");
}