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

B #5532: fix service keeps in WARNING state (#1782)

(cherry picked from commit c0d32b71950918dd03499ba18b78fa3df18be83d)
This commit is contained in:
Alejandro Huertas Herrero 2022-02-17 16:12:44 +01:00 committed by Ruben S. Montero
parent eb1927750d
commit 96c40d94c9
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
2 changed files with 23 additions and 0 deletions

View File

@ -960,7 +960,11 @@ class ServiceLCM
end
def running_wd_cb(client, service_id, role_name, _node)
undeploy = false
rc = @srv_pool.get(service_id, client) do |service|
role = service.roles[role_name]
if service.roles[role_name].state != Role::STATE['RUNNING']
service.roles[role_name].set_state(Role::STATE['RUNNING'])
end
@ -970,10 +974,19 @@ class ServiceLCM
service.set_state(Service::STATE['RUNNING'])
end
# If the role has 0 nodes, delete role
undeploy = service.check_role(role)
service.update
end
Log.error 'WD', rc.message if OpenNebula.is_error?(rc)
return unless undeploy
Log.info LOG_COMP, "Automatically deleting service #{service_id}"
undeploy_action(client, service_id)
end
############################################################################

View File

@ -214,6 +214,16 @@ class ServiceWD
next unless nodes_ids
if nodes_ids.empty?
# If there are no VM, the role should be running
@lcm.trigger_action(:running_wd_cb,
service.id,
client,
service.id,
name,
[])
end
nodes_ids.each do |node|
check_role_state(client, service.id, name, node)
end