@@ -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