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.

(cherry picked from commit 57070b1dc2)

Signed-off-by: animesh <animesh@apache.org>
This commit is contained in:
Jessica Wang 2013-08-21 16:29:14 -07:00 committed by animesh
parent 5d90c60d63
commit 261c86a390
1 changed files with 14 additions and 6 deletions

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");
}