1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-28 17:57:22 +03:00

F #~: fix params in monitor

Signed-off-by: Carlos Herrera <cherrera@opennebula.io>
This commit is contained in:
Carlos Herrera 2020-12-15 12:17:52 -05:00 committed by Tino Vázquez
parent cedde8b330
commit 6ad4dd1269
2 changed files with 5 additions and 4 deletions

View File

@ -637,7 +637,7 @@ class Cluster
# 'ones' : VMs in OpenNebula
#---------------------------------------------------------------------------
def vms_info(vm_type)
cmd = "#{File.dirname(__FILE__)}/vcenter_monitor_vms.rb #{@host.id} #{vm_type}"
cmd = "#{File.dirname(__FILE__)}/vcenter_monitor_vms.rb #{@host.id} #{vm_type} \"#{connection[:ccr]}\""
str_info, _stderr, _status = Open3.capture3(cmd)
str_info
end

View File

@ -41,17 +41,18 @@ CONFIG = VCenterConf.new
host_id = ARGV[0]
vm_type = ARGV[1]
ccr = ARGV[2]
begin
vi_client = VCenterDriver::VIClient.new_from_host(host_id)
cluster = Cluster.new(host_id, vi_client)
cluster = VCenterDriver::ClusterComputeResource.new_from_ref(ccr, vi_client)
str_info , _ltime = cluster.monitor_vms(@host.id, vm_type)
str_info , _ltime = cluster.monitor_vms(host_id, vm_type)
puts str_info
rescue StandardError => e
message = "Monitoring of VM #{vm_id} on vCenter cluster #{cluster_name} " \
message = "Monitoring of VMs on vCenter cluster #{host_id} " \
" failed due to \"#{e.message}\"."
OpenNebula.log_error(message)
if VCenterDriver::CONFIG[:debug_information]