cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject [02/50] [abbrv] git commit: updated refs/heads/rbd-snap-clone to 2355a81
Date Thu, 23 May 2013 21:19:37 GMT
CLOUDSTACK-2567 - Check whether DMC - dynamic memory control is enabled for the hyervisor before
trying to scale the vm. If its not then dont scale and instead throw and exception.


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

Branch: refs/heads/rbd-snap-clone
Commit: a58ee74e1c3760852214be28d8ef7051f27e1f29
Parents: 2adc8e9
Author: Nitin Mehta <nitin.mehta@citrix.com>
Authored: Tue May 21 16:36:10 2013 +0530
Committer: Nitin Mehta <nitin.mehta@citrix.com>
Committed: Tue May 21 16:39:25 2013 +0530

----------------------------------------------------------------------
 .../xen/resource/CitrixResourceBase.java           |    7 +++++++
 .../xen/resource/CitrixResourceBaseTest.java       |    5 ++++-
 2 files changed, 11 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a58ee74e/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index cd49773..d08aaec 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -660,6 +660,13 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
             Connection conn = getConnection();
             Set<VM> vms = VM.getByNameLabel(conn, vmName);
             Host host = Host.getByUuid(conn, _host.uuid);
+
+            // If DMC is not enable then dont execute this command.
+            if (isDmcEnabled(conn, host)) {
+                String msg = "Unable to scale the vm: " + vmName + " as DMC - Dynamic memory
control is not enabled for the XenServer:" + _host.uuid + " ,check your license and hypervisor
version.";
+                s_logger.info(msg);
+                return new ScaleVmAnswer(cmd, false, msg);
+            }
             // stop vm which is running on this host or is in halted state
             Iterator<VM> iter = vms.iterator();
             while ( iter.hasNext() ) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a58ee74e/plugins/hypervisors/xen/test/com/cloud/hypervisor/xen/resource/CitrixResourceBaseTest.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/test/com/cloud/hypervisor/xen/resource/CitrixResourceBaseTest.java
b/plugins/hypervisors/xen/test/com/cloud/hypervisor/xen/resource/CitrixResourceBaseTest.java
index 877e3bc..3328d4b 100644
--- a/plugins/hypervisors/xen/test/com/cloud/hypervisor/xen/resource/CitrixResourceBaseTest.java
+++ b/plugins/hypervisors/xen/test/com/cloud/hypervisor/xen/resource/CitrixResourceBaseTest.java
@@ -58,7 +58,10 @@ public class CitrixResourceBaseTest {
             super.scaleVM(conn, vm, vmSpec, host);
         }
 
-
+        @Override
+        protected boolean isDmcEnabled(Connection conn, Host host) throws Types.XenAPIException,
XmlRpcException {
+            return true;
+        }
     };
     @Mock XsHost _host;
     @Mock Host host;


Mime
View raw message