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

Signed-off-by: Koushik Das <koushik.das@citrix.com>
This commit is contained in:
Koushik Das 2012-12-11 18:25:05 +05:30 committed by Joe Brockmeier
parent 09b68ce13f
commit 3dfd81fd6b

View File

@ -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();