Feature #1852: Automatic scaling failure recovery

This commit is contained in:
Carlos Martín committed 2013-05-30 18:26:35 +02:00
1 parent efcc6c0b70
commit e57620f0f3
2 files changed
+20 -1

No files matched your search

+6
View File
@@ -101,6 +101,12 @@ class ServiceLCM
elsif !service.any_role_scaling?
service.set_state(Service::STATE['RUNNING'])
end
when Service::STATE['FAILED_SCALING']
strategy.monitor_step(service)
if !service.any_role_failed_scaling?
service.set_state(Service::STATE['SCALING'])
end
when Service::STATE['UNKNOWN']
strategy.monitor_step(service)
+14 -1
View File
@@ -177,6 +177,10 @@ class Strategy
if !OpenNebula.is_error?(rc) && role_nodes_done?(role)
role.set_state(Role::STATE['DONE'])
end
when Role::STATE['FAILED_SCALING']
if !OpenNebula.is_error?(rc) && role_finished_scaling?(role)
role.set_state(Role::STATE['SCALING'])
end
end
}
end
@@ -264,8 +268,13 @@ protected
role.get_nodes.each { |node|
if node && node['vm_info']
vm_state = node['vm_info']['VM']['STATE']
if vm_state == '7' # FAILED
# TODO: return error message and log it into the service log
#msg = "Role #{role.name()} : VM #{node['deploy_id']} found in FAILED state"
#Log.error LOG_COMP, msg
return true
end
end
@@ -303,4 +312,8 @@ protected
return any_node_failed?(role)
end
def role_finished_scaling?(role)
return role_nodes_running?(role) && role.get_nodes.size() == role.cardinality()
end
end