diff options
| author | Stanislaw Pitucha <stanislaw.pitucha@hp.com> | 2012-09-20 15:47:19 +0100 |
|---|---|---|
| committer | Stanislaw Pitucha <stanislaw.pitucha@hp.com> | 2012-09-20 16:19:41 +0100 |
| commit | fdd9325df75652a95a96ccd4e59b73556df811c6 (patch) | |
| tree | 96a0f41d3fecc8a9459c762cc03ac7f434dcf876 /nova | |
| parent | 2fb9fe92fd24ecf52720f6762c32c2056ecbe2b9 (diff) | |
| download | nova-fdd9325df75652a95a96ccd4e59b73556df811c6.tar.gz nova-fdd9325df75652a95a96ccd4e59b73556df811c6.tar.xz nova-fdd9325df75652a95a96ccd4e59b73556df811c6.zip | |
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
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/compute/manager.py | 7 |
1 files changed, 7 insertions, 0 deletions
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) |
