CLOUDSTACK-605: Host physical CPU is incorrectly calculated for Vmware hosts 
Fixed logic to compute Vmware host cpu

Signed-off-by: Koushik Das <[email protected]>


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

Branch: refs/heads/javelin
Commit: 3dfd81fd6bcca92edab1f9ea814d0850d3202451
Parents: 09b68ce
Author: Koushik Das <[email protected]>
Authored: Tue Dec 11 18:25:05 2012 +0530
Committer: Joe Brockmeier <[email protected]>
Committed: Wed Jan 9 14:03:04 2013 -0600

----------------------------------------------------------------------
 .../src/com/cloud/hypervisor/vmware/mo/HostMO.java |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3dfd81fd/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java 
b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java
index 3557048..a765b42 100755
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java
@@ -840,11 +840,9 @@ public class HostMO extends BaseMO implements 
VmwareHypervisorHost {
                
                VmwareHypervisorHostResourceSummary summary = new 
VmwareHypervisorHostResourceSummary();
                
-               HostConnectInfo hostInfo = 
_context.getService().queryHostConnectionInfo(_mor);
-               HostHardwareSummary hardwareSummary = 
hostInfo.getHost().getHardware();
-               
+        HostHardwareSummary hardwareSummary = getHostHardwareSummary();
                // TODO: not sure how hyper-thread is counted in VMware 
resource pool
-               
summary.setCpuCount(hardwareSummary.getNumCpuCores()*hardwareSummary.getNumCpuPkgs());
+        summary.setCpuCount(hardwareSummary.getNumCpuCores());
                summary.setMemoryBytes(hardwareSummary.getMemorySize());
                summary.setCpuSpeed(hardwareSummary.getCpuMhz());
 
@@ -922,14 +920,13 @@ public class HostMO extends BaseMO implements 
VmwareHypervisorHost {
                ComputeResourceSummary resourceSummary = new 
ComputeResourceSummary();
                
                // TODO: not sure how hyper-threading is counted in VMware
-               short totalCores = 
(short)(hardwareSummary.getNumCpuCores()*hardwareSummary.getNumCpuPkgs());
-               resourceSummary.setNumCpuCores(totalCores);
+        resourceSummary.setNumCpuCores(hardwareSummary.getNumCpuCores());
                
                // Note: memory here is in Byte unit
                resourceSummary.setTotalMemory(hardwareSummary.getMemorySize());
                
-               // Total CPU is based on socket x core x Mhz
-               int totalCpu = hardwareSummary.getCpuMhz() * totalCores;
+        // Total CPU is based on (# of cores) x Mhz
+        int totalCpu = hardwareSummary.getCpuMhz() * 
hardwareSummary.getNumCpuCores();
                resourceSummary.setTotalCpu(totalCpu);
 
                HostListSummaryQuickStats stats = getHostQuickStats();

Reply via email to