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 8712491a6c
commit e1e4642d67

View File

@ -2200,6 +2200,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");
}