diff --git a/flow/lcm/LifeCycleManager.rb b/flow/lcm/LifeCycleManager.rb index b354263365..630cf61847 100644 --- a/flow/lcm/LifeCycleManager.rb +++ b/flow/lcm/LifeCycleManager.rb @@ -90,7 +90,11 @@ class ServiceLCM # TODO: Check scalability rules for roles that are # not scaling now? - if service.all_roles_running? + # The service is moved to RUNNING even if the + # roles scaling ended in failure. Any error is + # handled the next cycle in the RUNNING case + + if !service.any_role_scaling? service.set_state(Service::STATE['RUNNING']) end when Service::STATE['UNKNOWN'] diff --git a/flow/models/Service.rb b/flow/models/Service.rb index 5f9316ba66..b64c6942c6 100644 --- a/flow/models/Service.rb +++ b/flow/models/Service.rb @@ -144,6 +144,16 @@ module OpenNebula return false end + def any_role_scaling?() + @roles.each do |name, role| + if role.state == Role::STATE['SCALING'] + return true + end + end + + return false + end + # Create a new service based on the template provided # @param [String] template_json # @return [nil, OpenNebula::Error] nil in case of success, Error