mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
(cherry picked from commit 5333ecf86cd7ce51fe92dadf93def6dc6feb59ff)
This commit is contained in:
parent
790f139f22
commit
613ea388ba
@ -689,15 +689,18 @@ class ServiceLCM
|
||||
role = service.roles[role_name]
|
||||
cardinality = role.cardinality - 1
|
||||
|
||||
next unless role.nodes.find {|n| n['deploy_id'] == node }
|
||||
|
||||
# just update if the cardinality is positive
|
||||
set_cardinality(role, cardinality, true) if cardinality >= 0
|
||||
set_cardinality(role, cardinality, false) if cardinality >= 0
|
||||
|
||||
role.nodes.delete_if {|n| n['deploy_id'] == node }
|
||||
|
||||
service.update
|
||||
|
||||
Log.info 'WD',
|
||||
"Update #{service_id}:#{role_name} " \
|
||||
"Node #{node} is done, " \
|
||||
"updating service #{service_id}:#{role_name} " \
|
||||
"cardinality to #{cardinality}"
|
||||
end
|
||||
|
||||
|
@ -233,22 +233,16 @@ class ServiceWD
|
||||
|
||||
if WARNING_STATES.include?(vm_lcm_state) ||
|
||||
WARNING_STATES.include?(vm_state)
|
||||
action = :error_wd_cb
|
||||
action_msg = 'Warning'
|
||||
action = :error_wd_cb
|
||||
elsif vm_state == 'DONE'
|
||||
action = :done_wd_cb
|
||||
action_msg = 'Warning'
|
||||
action = :done_wd_cb
|
||||
elsif vm_lcm_state == 'RUNNING'
|
||||
action = :running_wd_cb
|
||||
action_msg = 'Running'
|
||||
action = :running_wd_cb
|
||||
else
|
||||
# in case there is other state, ignore it
|
||||
return
|
||||
end
|
||||
|
||||
Log.info LOG_COMP,
|
||||
"#{action_msg} #{service_id}: #{role_name} is #{vm_state}"
|
||||
|
||||
# execute callback
|
||||
@lcm.trigger_action(action,
|
||||
service_id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user