1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-28 14:50:08 +03:00

B #5113: collect correct attributes vCenter host (#303)

Signed-off-by: Carlos Herrera <cherrera@opennebula.io>
(cherry picked from commit c95839dc66312f89519749f30ab5322dbff7f38b)
This commit is contained in:
Carlos J. Herrera 2020-10-13 12:55:54 -04:00 committed by Tino Vazquez
parent 542fd01126
commit 0c85e1eb27

View File

@ -307,13 +307,15 @@ class Cluster
end
def cluster_monitoring
metrics = @cluster.item.collect(*(CLUSTER_PROPERTIES[0..4]))
resource_usage_summary = @cluster.item.GetResourceUsage()
total_cpu = metrics[0].to_f
num_cpu_cores = metrics[1].to_f
effective_cpu = metrics[2].to_f
total_memory = metrics[3].to_i
effective_mem = metrics[4].to_i
metrics = @cluster.item.collect(*(CLUSTER_PROPERTIES[1]))
num_cpu_cores = metrics[0].to_f
total_cpu = resource_usage_summary.cpuCapacityMHz.to_f
effective_cpu = resource_usage_summary.cpuUsedMHz.to_f
total_memory = resource_usage_summary.memCapacityMB.to_i
effective_mem = resource_usage_summary.memUsedMB.to_i
if num_cpu_cores > 0
mhz_core = total_cpu / num_cpu_cores