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

F #4302: Set vCenter minimum monitor granularity

- Set to 30 seconds. vCenter monitoring runs in the front-end
- Raise VM State default to 5 seconds for other hypervisors
This commit is contained in:
Tino Vazquez 2020-06-02 12:04:13 +02:00
parent 2fc3e6e61c
commit a78f105056
No known key found for this signature in database
GPG Key ID: 2FE9C32E94AEABBE
3 changed files with 21 additions and 18 deletions

View File

@ -115,7 +115,6 @@ class Cluster
@vic = VCenterDriver::VIClient.new(connection, hid)
@cluster = VCenterDriver::ClusterComputeResource
.new_from_ref(connection[:ccr], @vic)
end
#---------------------------------------------------------------------------
@ -852,7 +851,7 @@ class ClusterSet
:last_monitor_host => 0,
:last_beacon_host => 0,
:last_monitor_vm => 0,
:last_state_vm => 0
:last_state_vm => 0
}
end
end

View File

@ -60,10 +60,16 @@ class VcenterMonitorManager
:state_vm => 30,
:monitor_vm => 30,
:beacon_host => 30,
:address => "127.0.0.1",
:address => '127.0.0.1',
:port => 4124
}.freeze
# Minimum interval for vCenter probes
# They run in the front-end and are RAM consuming
# so this is the minimum grain for the intervals
MINIMUM_INTERVAL = 30
#---------------------------------------------------------------------------
#
#---------------------------------------------------------------------------
@ -76,9 +82,7 @@ class VcenterMonitorManager
@conf = DEFAULT_CONFIGURATION.clone
# Create timer thread to monitor vcenters
Thread.new {
timer
}
Thread.new { timer }
end
#---------------------------------------------------------------------------
@ -87,7 +91,7 @@ class VcenterMonitorManager
def update_conf(conf64)
conftxt = Base64.decode64(conf64)
conf = REXML::Document.new(conftxt).root
@mutex.synchronize {
@mutex.synchronize do
@conf = {
:system_host => conf.elements['PROBES_PERIOD/SYSTEM_HOST'].text.to_i,
:monitor_host => conf.elements['PROBES_PERIOD/MONITOR_HOST'].text.to_i,
@ -97,14 +101,13 @@ class VcenterMonitorManager
:address => conf.elements['NETWORK/MONITOR_ADDRESS'].text.to_s,
:port => conf.elements['NETWORK/PORT'].text.to_s
}
}
@conf.each{ |k,v| @conf[k] = 30 if v.is_a?(Integer) && v < MINIMUM_INTERVAL }
end
@conf[:address] = '127.0.0.1' if @conf[:address] == 'auto'
rescue StandardError
@mutex.synchronize {
@conf = DEFAULT_CONF.clone
}
@mutex.synchronize { @conf = DEFAULT_CONF.clone }
end
#---------------------------------------------------------------------------
@ -141,7 +144,7 @@ end
# to monitord client and trigger operations on the Vcenter logic thread
# --------------------------------------------------------------------------
class IOThread
IO_FIFO = "/tmp/vcenter_monitor.fifo"
IO_FIFO = '/tmp/vcenter_monitor.fifo'
def initialize(vcentermm)
@vcentermm = vcentermm
@ -151,19 +154,20 @@ class IOThread
loop do
fifo = File.open(IO_FIFO)
fifo.each_line { |line|
fifo.each_line do |line|
action, hid, conf = line.split
@vcentermm.send(action.to_sym, hid.to_i, conf)
}
end
end
end
end
Thread.new {
Thread.new do
exit unless system('pgrep oned')
sleep 5
}
end
vcentermm = VcenterMonitorManager.new

View File

@ -94,7 +94,7 @@ PROBES_PERIOD = [
BEACON_HOST = 30,
SYSTEM_HOST = 600,
MONITOR_HOST = 120,
STATE_VM = 30,
STATE_VM = 5,
MONITOR_VM = 30,
SYNC_STATE_VM = 180
]