CLOUDSTACK-4181 [upgrade][2.2.14 to 4.2][vmware]After upgrade the system vms fail to start

number of cores per socket for ESXi4.1 is 1.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>
This commit is contained in:
Sateesh Chodapuneedi 2013-08-08 08:54:00 +05:30
parent 72d3bc3c12
commit 1076c267fa
1 changed files with 5 additions and 0 deletions

View File

@ -2198,6 +2198,11 @@ public class VirtualMachineMO extends BaseMO {
}
public int getCoresPerSocket() throws Exception {
// number of cores per socket is 1 in case of ESXi. It's not defined explicitly and the property is support since vSphere API 5.0.
String apiVersion = HypervisorHostHelper.getVcenterApiVersion(_context);
if (apiVersion.compareTo("5.0") < 0) {
return 1;
}
return (Integer)_context.getVimClient().getDynamicProperty(_mor, "config.hardware.numCoresPerSocket");
}