Revision 8c30c1f7 src/vmm_mad/remotes/lib/vcenter_driver/host.rb
src/vmm_mad/remotes/lib/vcenter_driver/host.rb | ||
---|---|---|
325 | 325 |
host_id = one_host["ID"] if one_host |
326 | 326 |
|
327 | 327 |
|
328 |
# Extract CPU info for each esx host in cluster |
|
329 |
esx_host_cpu = {}
|
|
328 |
# Extract CPU info and name for each esx host in cluster
|
|
329 |
esx_hosts = {}
|
|
330 | 330 |
@item.host.each do |esx_host| |
331 |
esx_host_cpu[esx_host._ref] = esx_host.summary.hardware.cpuMhz.to_f |
|
331 |
info = {} |
|
332 |
info[:name] = esx_host.name |
|
333 |
info[:cpu] = esx_host.summary.hardware.cpuMhz.to_f |
|
334 |
esx_hosts[esx_host._ref] = info |
|
332 | 335 |
end |
333 | 336 |
|
334 | 337 |
@monitored_vms = Set.new |
... | ... | |
425 | 428 |
vms.each do |vm_ref,info| |
426 | 429 |
begin |
427 | 430 |
vm = VCenterDriver::VirtualMachine.new_from_ref(vm_ref, @vi_client) |
431 |
esx_host = esx_hosts[info["runtime.host"]._ref] |
|
432 |
info[:esx_host_name] = esx_host[:name] |
|
433 |
info[:esx_host_cpu] = esx_host[:cpu] |
|
428 | 434 |
info[:cluster_name] = cluster_name |
429 | 435 |
info[:cluster_ref] = cluster_ref |
430 | 436 |
info[:vc_uuid] = vc_uuid |
... | ... | |
465 | 471 |
vm.one_item if vm.get_vm_id |
466 | 472 |
end |
467 | 473 |
|
468 |
vm.monitor(esx_host_cpu,stats)
|
|
474 |
vm.monitor(stats) |
|
469 | 475 |
|
470 | 476 |
vm_name = "#{info["name"]} - #{cluster_name}" |
471 | 477 |
|
Also available in: Unified diff