From fdd9325df75652a95a96ccd4e59b73556df811c6 Mon Sep 17 00:00:00 2001 From: Stanislaw Pitucha Date: Thu, 20 Sep 2012 15:47:19 +0100 Subject: Fix startup with DELETED instances 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 --- nova/compute/manager.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'nova') diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 42a2fd447..76c91a575 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -278,6 +278,13 @@ class ComputeManager(manager.SchedulerDependentManager): 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) -- cgit