You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by sa...@apache.org on 2013/08/20 15:28:48 UTC
git commit: updated refs/heads/4.2 to a168a5f
Updated Branches:
refs/heads/4.2 8c6866053 -> a168a5fa2
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 <sa...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/a168a5fa
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a168a5fa
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a168a5fa
Branch: refs/heads/4.2
Commit: a168a5fa2a45e13e2c92933acd81ab8f62c47282
Parents: 8c68660
Author: Sateesh Chodapuneedi <sa...@apache.org>
Authored: Tue Aug 20 13:28:14 2013 +0530
Committer: Sateesh Chodapuneedi <sa...@apache.org>
Committed: Tue Aug 20 13:28:14 2013 +0530
----------------------------------------------------------------------
.../src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a168a5fa/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
index 570d740..8e3df50 100644
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
@@ -2203,7 +2203,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 {