mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-14 17:42:24 +01:00
CLOUDSTACK-3851 [VMWare] VM start fails with NPE while trying to retrieve cores per socket
If VMware host version is ESXi 4.1 and vCenter version is 5.0 or later, number of cores per socket of a VM running on ESXi 4.1 host would be undefined as it's not supported for versions prior to 5.0. Hence expecting undefined/null value for that and handling it. Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>
This commit is contained in:
parent
a5ada3f363
commit
cc18ca79fc
@ -2205,7 +2205,8 @@ public class VirtualMachineMO extends BaseMO {
|
||||
if (apiVersion.compareTo("5.0") < 0) {
|
||||
return 1;
|
||||
}
|
||||
return (Integer)_context.getVimClient().getDynamicProperty(_mor, "config.hardware.numCoresPerSocket");
|
||||
Integer coresPerSocket = (Integer) _context.getVimClient().getDynamicProperty(_mor, "config.hardware.numCoresPerSocket");
|
||||
return coresPerSocket != null? coresPerSocket : 1;
|
||||
}
|
||||
|
||||
public int getVirtualHardwareVersion() throws Exception {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user