From dac66d74df1fbc4976e520ea1f9b829b6aacb1d2 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 21 Aug 2013 16:29:14 -0700 Subject: [PATCH] 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. --- ui/scripts/storage.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js index a4d00c60db0..ec63e1586f1 100644 --- a/ui/scripts/storage.js +++ b/ui/scripts/storage.js @@ -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"); }