cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From likit...@apache.org
Subject git commit: updated refs/heads/master to 8cf94c9
Date Mon, 07 Jul 2014 09:56:04 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 4f969057b -> 8cf94c9ec


CLOUDSTACK-7069. [VMware] While setting 'numCoresPerSocket' property for a Virtual Machine
in VMware
 add a check to ensure the vSphere version is 5.0 or above.


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

Branch: refs/heads/master
Commit: 8cf94c9ec18dfb1c7d49837591691d2f35ffaad8
Parents: 4f96905
Author: Likitha Shetty <likitha.shetty@citrix.com>
Authored: Mon Jul 7 14:36:58 2014 +0530
Committer: Likitha Shetty <likitha.shetty@citrix.com>
Committed: Mon Jul 7 14:36:58 2014 +0530

----------------------------------------------------------------------
 .../vmware/resource/VmwareResource.java         | 27 +++++++++++++++-----
 1 file changed, 21 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cf94c9e/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index 5b49e5b..08d69e0 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -1438,17 +1438,32 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
                     getReservedCpuMHZ(vmSpec), (int)(vmSpec.getMaxRam() / (1024 * 1024)),
getReservedMemoryMb(vmSpec),
                     guestOsId, vmSpec.getLimitCpuUse());
 
-            // Check for hotadd settings
-            vmConfigSpec.setMemoryHotAddEnabled(vmMo.isMemoryHotAddSupported(guestOsId));
-            vmConfigSpec.setCpuHotAddEnabled(vmMo.isCpuHotAddSupported(guestOsId));
-            configNestedHVSupport(vmMo, vmSpec, vmConfigSpec);
-
             // Check for multi-cores per socket settings
+            int numCoresPerSocket = 1;
             String coresPerSocket = vmSpec.getDetails().get("cpu.corespersocket");
             if (coresPerSocket != null) {
-                vmConfigSpec.setNumCoresPerSocket(NumbersUtil.parseInt(coresPerSocket, 1));
+                String apiVersion = HypervisorHostHelper.getVcenterApiVersion(vmMo.getContext());
+                // Property 'numCoresPerSocket' is supported since vSphere API 5.0
+                if (apiVersion.compareTo("5.0") >= 0) {
+                    numCoresPerSocket = NumbersUtil.parseInt(coresPerSocket, 1);
+                    vmConfigSpec.setNumCoresPerSocket(numCoresPerSocket);
+                }
             }
 
+            // Check for hotadd settings
+            vmConfigSpec.setMemoryHotAddEnabled(vmMo.isMemoryHotAddSupported(guestOsId));
+
+            String hostApiVersion = ((HostMO)hyperHost).getHostAboutInfo().getApiVersion();
+            if (numCoresPerSocket > 1 && hostApiVersion.compareTo("5.0") <
0) {
+                s_logger.warn("Dynamic scaling of CPU is not supported for Virtual Machines
with multi-core vCPUs in case of ESXi hosts 4.1 and prior. Hence CpuHotAdd will not be"
+                        + " enabled for Virtual Machine: " + vmInternalCSName);
+                vmConfigSpec.setCpuHotAddEnabled(false);
+            } else {
+                vmConfigSpec.setCpuHotAddEnabled(vmMo.isCpuHotAddSupported(guestOsId));
+            }
+
+            configNestedHVSupport(vmMo, vmSpec, vmConfigSpec);
+
             VirtualDeviceConfigSpec[] deviceConfigSpecArray = new VirtualDeviceConfigSpec[totalChangeDevices];
             int i = 0;
             int ideUnitNumber = 0;


Mime
View raw message