From 8ce6d5271c91d9a1fdb920d64c44c0438b5fbff0 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 26 Nov 2013 15:04:08 -0800 Subject: [PATCH] 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". --- ui/scripts/storage.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js index 22330e80b9c..03b88f82d9c 100644 --- a/ui/scripts/storage.js +++ b/ui/scripts/storage.js @@ -1896,14 +1896,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");