If a VM goes to `DOWN` state during CheckBoot, restart the VM.

This commit is contained in:
Ryan Petrello 2014-06-26 13:46:58 -04:00 committed by Doug Hellmann
parent 13c0c2329b
commit b951a98411
2 changed files with 4 additions and 3 deletions

View File

@ -232,7 +232,8 @@ class CheckBoot(State):
return action
def transition(self, action, worker_context):
if self.vm.state == vm_manager.GONE:
if self.vm.state in (vm_manager.DOWN,
vm_manager.GONE):
return StopVM(self.params)
if self.vm.state == vm_manager.UP:
return ConfigureVM(self.params)

View File

@ -32,8 +32,8 @@ digraph rug {
CREATE_VM -> CALC_ACTION [ label = "vm:E" ];
CHECK_BOOT -> CONFIG [ label = "vm>U" ];
CHECK_BOOT -> CALC_ACTION [ label = "vm:[DBCR]" ];
CHECK_BOOT -> STOP_VM [ label = "vm:G" ];
CHECK_BOOT -> CALC_ACTION [ label = "vm:[BCR]" ];
CHECK_BOOT -> STOP_VM [ label = "vm:[DG]" ];
CONFIG -> STATS [ label = "ACT:R,vm>C" ];
CONFIG -> CALC_ACTION [ label = "ACT>P,vm>C" ];