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

F #5645: skip FOLLOWER vCenter monitoring (#1927)

This commit is contained in:
Alejandro Huertas Herrero 2022-04-11 13:39:18 +02:00 committed by GitHub
parent 570568fd57
commit 171d254318
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -827,6 +827,18 @@ class ClusterSet
#---------------------------------------------------------------------------
def monitor(conf)
@mutex.synchronize do
# Get current server raft status, to skip monitor being FOLLOWER
xml_e = OpenNebula::XMLElement.build_xml(
@client.call('zone.raftstatus'),
'RAFT'
)
xml = OpenNebula::XMLElement.new(xml_e)
# 0 -> SOLO
# 3 -> LEADER
next unless %w[0 3].include?(xml['//STATE'])
@clusters.each do |id, c|
if c[:cluster].nil?
c[:cluster] = Cluster.new(id, @client) rescue nil