mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
- VMs with name one-xxx was not been monitored - Change NSX_STATUS='' on hosts with no NSX - Changes on checkings in VNM driver - Change an error ocurring connecting to NSX Manager Co-authored-by: mouyaq <amoya@opennebula.io>
This commit is contained in:
parent
86bb514d45
commit
21e7715425
@ -124,7 +124,7 @@ class NsxMonitor
|
||||
|
||||
# Check if NSX_MANAGER is into the host template
|
||||
if [nil, ''].include?(@one_item['TEMPLATE/NSX_MANAGER'])
|
||||
@nsx_status = "NSX_STATUS = \"Missing NSX_MANAGER\"\n"
|
||||
@nsx_status = ''
|
||||
return false
|
||||
end
|
||||
|
||||
@ -147,9 +147,7 @@ class NsxMonitor
|
||||
end
|
||||
|
||||
# Try a connection as part of NSX_STATUS
|
||||
nsx_client = NSXDriver::NSXClient
|
||||
.new_from_id(@vi_client.instance_variable_get(:@host_id)
|
||||
.to_i)
|
||||
nsx_client = NSXDriver::NSXClient.new_from_id(@host_id.to_i)
|
||||
|
||||
if @one_item['TEMPLATE/NSX_TYPE'] == NSXDriver::NSXConstants::NSXV
|
||||
# URL to test a connection
|
||||
|
@ -852,9 +852,6 @@ class VcenterMonitor
|
||||
|
||||
vms = []
|
||||
vms_hash.each do |vm_ref, info|
|
||||
# Skip VMs starting with one- in vcenter
|
||||
next if info['name'].match(/^one-(\d*)(-(.*))?$/)
|
||||
|
||||
one_uuid = "#{vm_ref}#{@vc_uuid}"
|
||||
|
||||
vm = { :uuid => one_uuid,
|
||||
|
@ -65,13 +65,9 @@ if OpenNebula.is_error?(rc)
|
||||
raise err_msg
|
||||
end
|
||||
|
||||
# Exit with error if NSX_STATUS != OK
|
||||
# Exit if there is no NSX
|
||||
nsx_status = one_host['TEMPLATE/NSX_STATUS']
|
||||
unless nsx_status == 'OK'
|
||||
OpenNebula.log_error('NSX_STATUS is not OK')
|
||||
OpenNebula.error_message('NSX_STATUS is not OK')
|
||||
exit 1
|
||||
end
|
||||
exit 0 if nsx_status.nil?
|
||||
|
||||
# Clear rules
|
||||
nsx_client = NSXDriver::NSXClient.new_from_id(one_host['ID'])
|
||||
|
@ -67,6 +67,10 @@ if OpenNebula.is_error?(rc)
|
||||
raise err_msg
|
||||
end
|
||||
|
||||
# Exit if there is no NSX
|
||||
nsx_status = one_host['TEMPLATE/NSX_STATUS']
|
||||
exit 0 if nsx_status.nil?
|
||||
|
||||
# OpenNebula VM
|
||||
vmid = template_xml.xpath('//VM/ID')
|
||||
one_vm = VCenterDriver::VIHelper.one_item(OpenNebula::VirtualMachine, vmid)
|
||||
|
@ -60,8 +60,10 @@ if OpenNebula.is_error?(rc)
|
||||
raise err_msg
|
||||
end
|
||||
|
||||
# Exit with error if NSX_STATUS != OK
|
||||
# Exit if there is no NSX
|
||||
nsx_status = one_host['TEMPLATE/NSX_STATUS']
|
||||
exit 0 if nsx_status.nil?
|
||||
|
||||
unless nsx_status == 'OK'
|
||||
OpenNebula.log_error('NSX_STATUS is not OK')
|
||||
OpenNebula.error_message('NSX_STATUS is not OK')
|
||||
|
Loading…
x
Reference in New Issue
Block a user