diff options
author | Yun Mao <yunmao@gmail.com> | 2013-01-11 11:59:23 -0500 |
---|---|---|
committer | Yun Mao <yunmao@gmail.com> | 2013-01-11 11:59:23 -0500 |
commit | f7fbdeb5672bae7d3bffd6fa76de1ce81fc132bf (patch) | |
tree | e73b7845295684dd457f18f455036c78b289b244 | |
parent | 2b737b9f1bc18db822709f4073d7de1fd34388a6 (diff) | |
download | nova-f7fbdeb5672bae7d3bffd6fa76de1ce81fc132bf.tar.gz nova-f7fbdeb5672bae7d3bffd6fa76de1ce81fc132bf.tar.xz nova-f7fbdeb5672bae7d3bffd6fa76de1ce81fc132bf.zip |
Fix state sync logic related to the PAUSED VM state
A VM may get into the paused state not only because the user request
via API calls, but also due to (temporary) external instrumentations.
Before the virt layer can reliably report the reason, we simply ignore
the state discrepancy. In many cases, the VM state will go back to
running after the external instrumentation is done.
Fix bug 1097806.
Change-Id: I8edef45d60fa79d6ddebf7d0438042a7b3986b55
-rw-r--r-- | nova/compute/manager.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index f138a3708..c2609a78f 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -3397,10 +3397,8 @@ class ComputeManager(manager.SchedulerDependentManager): LOG.exception(_("error during stop() in " "sync_power_state."), instance=db_instance) - elif vm_power_state in (power_state.PAUSED, - power_state.SUSPENDED): - LOG.warn(_("Instance is paused or suspended " - "unexpectedly. Calling " + elif vm_power_state == power_state.SUSPENDED: + LOG.warn(_("Instance is suspended unexpectedly. Calling " "the stop API."), instance=db_instance) try: self.compute_api.stop(context, db_instance) @@ -3408,6 +3406,16 @@ class ComputeManager(manager.SchedulerDependentManager): LOG.exception(_("error during stop() in " "sync_power_state."), instance=db_instance) + elif vm_power_state == power_state.PAUSED: + # Note(maoy): a VM may get into the paused state not only + # because the user request via API calls, but also + # due to (temporary) external instrumentations. + # Before the virt layer can reliably report the reason, + # we simply ignore the state discrepancy. In many cases, + # the VM state will go back to running after the external + # instrumentation is done. See bug 1097806 for details. + LOG.warn(_("Instance is paused unexpectedly. Ignore."), + instance=db_instance) elif vm_state == vm_states.STOPPED: if vm_power_state not in (power_state.NOSTATE, power_state.SHUTDOWN, |