summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorPádraig Brady <pbrady@redhat.com>2013-02-08 13:45:14 +0000
committerPádraig Brady <pbrady@redhat.com>2013-02-09 04:12:16 +0000
commitad101ce5bac1af60adeeb5be12ec30fbd00a624e (patch)
treed8644872215011521c6882df74f6470d9431e5e1 /nova/compute
parentba708eaa7fbeb78e683bd576850643fe46ddd693 (diff)
downloadnova-ad101ce5bac1af60adeeb5be12ec30fbd00a624e.tar.gz
nova-ad101ce5bac1af60adeeb5be12ec30fbd00a624e.tar.xz
nova-ad101ce5bac1af60adeeb5be12ec30fbd00a624e.zip
fix VM power state to be NOSTATE when instance not found
* nova/compute/manager.py (_sync_power_states): Revert what looks like an inadvertent change that was part of commit 95e77703. Also log the condition. Fixes bug: 1085771 Change-Id: Ic6eeb9207323f05b93f0b613bd1bddd681ad8ce5
Diffstat (limited to 'nova/compute')
-rwxr-xr-xnova/compute/manager.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index bb4af94a6..504d16da2 100755
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -3371,7 +3371,7 @@ class ComputeManager(manager.SchedulerDependentManager):
vm_instance = self.driver.get_info(db_instance)
vm_power_state = vm_instance['state']
except exception.InstanceNotFound:
- vm_power_state = power_state.SHUTDOWN
+ vm_power_state = power_state.NOSTATE
# Note(maoy): the above get_info call might take a long time,
# for example, because of a broken libvirt driver.
# We re-query the DB to get the latest instance info to minimize
@@ -3458,6 +3458,12 @@ class ComputeManager(manager.SchedulerDependentManager):
# instrumentation is done. See bug 1097806 for details.
LOG.warn(_("Instance is paused unexpectedly. Ignore."),
instance=db_instance)
+ elif vm_power_state == power_state.NOSTATE:
+ # Occasionally, depending on the status of the hypervisor,
+ # which could be restarting for example, an instance may
+ # not be found. Therefore just log the condidtion.
+ LOG.warn(_("Instance is unexpectedly not found. Ignore."),
+ instance=db_instance)
elif vm_state == vm_states.STOPPED:
if vm_power_state not in (power_state.NOSTATE,
power_state.SHUTDOWN,