Skip to content

Commit

Permalink
Fix startup with DELETED instances
Browse files Browse the repository at this point in the history
Make sure that compute manager with DELETED and SOFT_DELETED instances
starts up properly. Before it was possible to end up with only the db
entry and no local configuration allowing a successful restart (even
then it would be the wrong decision to try).

Fixes bug 1053441

Change-Id: Iab1ca81068733a5e8546c32ad122f1d60d22310b
  • Loading branch information
viraptor committed Sep 20, 2012
1 parent 2fb9fe9 commit fdd9325
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions nova/compute/manager.py
Expand Up @@ -278,6 +278,13 @@ def init_host(self):
for count, instance in enumerate(instances):
db_state = instance['power_state']
drv_state = self._get_power_state(context, instance)
closing_vm_states = (vm_states.DELETED,
vm_states.SOFT_DELETED)

# instance was supposed to shut down - don't attempt
# recovery in any case
if instance['vm_state'] in closing_vm_states:
continue

expect_running = (db_state == power_state.RUNNING and
drv_state != db_state)
Expand Down

0 comments on commit fdd9325

Please sign in to comment.