Updated Branches: refs/heads/4.0 3b5ca331a -> 47711186e
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/47711186 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/47711186 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/47711186 Branch: refs/heads/4.0 Commit: 47711186eadaecd8cdb799f1c2e0ed38288725e2 Parents: 3b5ca33 Author: Koushik Das <[email protected]> Authored: Tue Dec 11 18:25:05 2012 +0530 Committer: Joe Brockmeier <[email protected]> Committed: Wed Jan 9 14:04:10 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/47711186/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();
