Updated Branches:
  refs/heads/4.3 96842475d -> 069293434

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".


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/06929343
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/06929343
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/06929343

Branch: refs/heads/4.3
Commit: 06929343447da69b54041e506ee0f6d4b735c3bb
Parents: 9684247
Author: Jessica Wang <[email protected]>
Authored: Tue Nov 26 15:04:08 2013 -0800
Committer: Jessica Wang <[email protected]>
Committed: Tue Nov 26 15:04:18 2013 -0800

----------------------------------------------------------------------
 ui/scripts/storage.js | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/06929343/ui/scripts/storage.js
----------------------------------------------------------------------
diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js
index 22330e8..03b88f8 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");

Reply via email to