You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by je...@apache.org on 2013/11/27 00:05:30 UTC

git commit: updated refs/heads/master to 8ce6d52

Updated Branches:
  refs/heads/master 2145505d3 -> 8ce6d5271


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/8ce6d527
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8ce6d527
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8ce6d527

Branch: refs/heads/master
Commit: 8ce6d5271c91d9a1fdb920d64c44c0438b5fbff0
Parents: 2145505
Author: Jessica Wang <je...@apache.org>
Authored: Tue Nov 26 15:04:08 2013 -0800
Committer: Jessica Wang <je...@apache.org>
Committed: Tue Nov 26 15:05:13 2013 -0800

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8ce6d527/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");