diff --git a/flow/models/Role.rb b/flow/models/Role.rb index 91d8bd8daf..a665c71f20 100644 --- a/flow/models/Role.rb +++ b/flow/models/Role.rb @@ -730,6 +730,11 @@ module OpenNebula @body['cooldown_duration'] = cooldown_duration.to_i end + # Updates the duration for the next cooldown with the default value + def set_default_cooldown_duration() + set_cooldown_duration(@body['cooldown'].to_i) + end + # Sets the cooldown end time from now + the duration set in set_cooldown_duration # @return [true, false] true if the cooldown duration is bigger than 0 def apply_cooldown_duration() diff --git a/flow/models/Service.rb b/flow/models/Service.rb index 081f6ce29f..1d0d56123b 100644 --- a/flow/models/Service.rb +++ b/flow/models/Service.rb @@ -345,6 +345,8 @@ module OpenNebula role.set_state(Role::STATE['SCALING']) + role.set_default_cooldown_duration() + self.set_state(Service::STATE['SCALING']) return self.update end