cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthon...@apache.org
Subject git commit: updated refs/heads/master to 5811ebe
Date Wed, 03 Sep 2014 21:41:01 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 5e55b6b47 -> 5811ebeee


if VM scale is disable, don't set any scale option for VM


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

Branch: refs/heads/master
Commit: 5811ebeee7040c3af66d57671d4546a9d0547786
Parents: 5e55b6b
Author: Anthony Xu <anthony.xu@citrix.com>
Authored: Wed Sep 3 14:40:00 2014 -0700
Committer: Anthony Xu <anthony.xu@citrix.com>
Committed: Wed Sep 3 14:40:00 2014 -0700

----------------------------------------------------------------------
 .../discoverer/XcpServerDiscoverer.java         |  1 +
 .../xenserver/resource/CitrixResourceBase.java  | 25 ++++++++++----------
 2 files changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5811ebee/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/discoverer/XcpServerDiscoverer.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/discoverer/XcpServerDiscoverer.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/discoverer/XcpServerDiscoverer.java
index 2fcd62b..ec3bc3a 100755
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/discoverer/XcpServerDiscoverer.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/discoverer/XcpServerDiscoverer.java
@@ -602,6 +602,7 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer,
L
             if (answer != null && answer.getResult() && answer instanceof
SetupAnswer) {
                 host.setSetup(true);
                 host.setLastPinged((System.currentTimeMillis() >> 10) - 5 * 60);
+                host.setHypervisorVersion(prodVersion);
                 _hostDao.update(host.getId(), host);
                 if (((SetupAnswer)answer).needReconnect()) {
                     throw new ConnectionException(false, "Reinitialize agent after setup.");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5811ebee/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
index 3ba8271..7e386a3 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
@@ -1331,28 +1331,29 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
             vmr.memoryStaticMax = getStaticMax(vmSpec.getOs(), vmSpec.getBootloader() ==
BootloaderType.CD, vmSpec.getMinRam(), vmSpec.getMaxRam());
             vmr.memoryDynamicMin = vmSpec.getMinRam();
             vmr.memoryDynamicMax = vmSpec.getMaxRam();
+            if (guestOsTypeName.toLowerCase().contains("windows")) {
+                vmr.VCPUsMax = (long)vmSpec.getCpus();
+            } else {
+                // XenServer has a documented limit of 16 vcpus per vm
+                vmr.VCPUsMax = 2L * vmSpec.getCpus();
+                if (vmr.VCPUsMax > 16)
+                {
+                    vmr.VCPUsMax = 16L;
+                }
+            }
         } else {
             //scaling disallowed, set static memory target
             if (vmSpec.isEnableDynamicallyScaleVm() && !isDmcEnabled(conn, host))
{
                 s_logger.warn("Host " + host.getHostname(conn) + " does not support dynamic
scaling, so the vm " + vmSpec.getName() + " is not dynamically scalable");
             }
-            vmr.memoryStaticMin = vmSpec.getMinRam();
+            vmr.memoryStaticMin = vmSpec.getMaxRam();
             vmr.memoryStaticMax = vmSpec.getMaxRam();
-            vmr.memoryDynamicMin = vmSpec.getMinRam();
+            vmr.memoryDynamicMin = vmSpec.getMaxRam();;
             vmr.memoryDynamicMax = vmSpec.getMaxRam();
-        }
-
-        if (guestOsTypeName.toLowerCase().contains("windows")) {
             vmr.VCPUsMax = (long)vmSpec.getCpus();
-        } else {
-            // XenServer has a documented limit of 16 vcpus per vm
-            vmr.VCPUsMax = 2L * vmSpec.getCpus();
-            if (vmr.VCPUsMax > 16)
-            {
-                vmr.VCPUsMax = 16L;
-            }
         }
 
+
         vmr.VCPUsAtStartup = (long)vmSpec.getCpus();
         vmr.consoles.clear();
 


Mime
View raw message