vm_state inaccurate when operate virsh command
Bug #1413833 reported by
Eric Xie
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Won't Fix
|
Wishlist
|
Unassigned |
Bug Description
"vm_state" of instance is inaccurate when user operate "virsh pause DOM" command.
One case:
1. Use "nova pause INSTANCE", and get:
| e4ce6895-
2. Use "virsh pause DOM", and get:
| e4ce6895-
Another case:
1. nova pause INSTANCE;
| e4ce6895-
2. virsh resume INSTANCE;
| e4ce6895-
To post a comment you must log in.
I check the related code: manager. py power_state( )
LOG.warn( _("Instance is paused unexpectedly. Ignore."),
instance= db_instance) state.SHUTDOWN,
power_ state.CRASHED) :
self. heal_instance_ state(context, db_instance,
vm_ state,vm_ power_state, default_ action = instance_ actions. FORCE_STOP)
nova.compute.
_sync_instance_
reason of case 1:
elif vm_state == vm_states.ACTIVE:
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.
reason of case 2: (Why not process power_state 'PAUSED')
elif vm_state == vm_states.PAUSED:
if vm_power_state in (power_