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

M #-: subscribe to service changes

This commit is contained in:
Alejandro Huertas 2020-05-18 18:28:07 +02:00
parent 13f6ea8684
commit 181cdce470
No known key found for this signature in database
GPG Key ID: 3044AF06BE405104
2 changed files with 7 additions and 3 deletions

View File

@ -91,7 +91,7 @@ class ServiceLCM
Thread.new do
wd = ServiceWD.new(client, em_conf)
wd.start @srv_pool
wd.start(@srv_pool)
end
Thread.new do

View File

@ -62,6 +62,8 @@ class ServiceWD
def start(service_pool)
Log.info LOG_COMP, 'Start watch dog'
service_pool.info_all
# check that all nodes are in RUNNING state, if not, notify
check_roles_state(client, service_pool)
@ -161,10 +163,12 @@ class ServiceWD
# @param service_id [Integer] Service ID to check
# @param roles [Array] Service roles with its nodes
def check_roles_state(client, service_pool)
service_pool.each do |service|
service_pool.each do |service|
service.info
service.roles.each do |name, role|
role.nodes_ids.each do |node|
check_role_state(client, service_id, name, node)
check_role_state(client, service.id, name, node)
end
end
end