Skip to content

Commit 3dfd81f

Browse files
Koushik Dasjzb
authored andcommitted
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>
1 parent 09b68ce commit 3dfd81f

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

  • vmware-base/src/com/cloud/hypervisor/vmware/mo

vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -840,11 +840,9 @@ public VmwareHypervisorHostResourceSummary getHyperHostResourceSummary() throws
840840

841841
VmwareHypervisorHostResourceSummary summary = new VmwareHypervisorHostResourceSummary();
842842

843-
HostConnectInfo hostInfo = _context.getService().queryHostConnectionInfo(_mor);
844-
HostHardwareSummary hardwareSummary = hostInfo.getHost().getHardware();
845-
843+
HostHardwareSummary hardwareSummary = getHostHardwareSummary();
846844
// TODO: not sure how hyper-thread is counted in VMware resource pool
847-
summary.setCpuCount(hardwareSummary.getNumCpuCores()*hardwareSummary.getNumCpuPkgs());
845+
summary.setCpuCount(hardwareSummary.getNumCpuCores());
848846
summary.setMemoryBytes(hardwareSummary.getMemorySize());
849847
summary.setCpuSpeed(hardwareSummary.getCpuMhz());
850848

@@ -922,14 +920,13 @@ public ComputeResourceSummary getHyperHostHardwareSummary() throws Exception {
922920
ComputeResourceSummary resourceSummary = new ComputeResourceSummary();
923921

924922
// TODO: not sure how hyper-threading is counted in VMware
925-
short totalCores = (short)(hardwareSummary.getNumCpuCores()*hardwareSummary.getNumCpuPkgs());
926-
resourceSummary.setNumCpuCores(totalCores);
923+
resourceSummary.setNumCpuCores(hardwareSummary.getNumCpuCores());
927924

928925
// Note: memory here is in Byte unit
929926
resourceSummary.setTotalMemory(hardwareSummary.getMemorySize());
930927

931-
// Total CPU is based on socket x core x Mhz
932-
int totalCpu = hardwareSummary.getCpuMhz() * totalCores;
928+
// Total CPU is based on (# of cores) x Mhz
929+
int totalCpu = hardwareSummary.getCpuMhz() * hardwareSummary.getNumCpuCores();
933930
resourceSummary.setTotalCpu(totalCpu);
934931

935932
HostListSummaryQuickStats stats = getHostQuickStats();

0 commit comments

Comments
 (0)