vm_state inaccurate when operate virsh command

Bug #1413833 reported by Eric Xie
6
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-a0db-4b43-9483-c4b8401fdd1c | instance_test | PAUSED | - | Paused | |
2. Use "virsh pause DOM", and get:
| e4ce6895-a0db-4b43-9483-c4b8401fdd1c | instance_test | ACTIVE | - | Paused | |

Another case:
1. nova pause INSTANCE;
| e4ce6895-a0db-4b43-9483-c4b8401fdd1c | instance_test | PAUSED | - | Paused | |
2. virsh resume INSTANCE;
| e4ce6895-a0db-4b43-9483-c4b8401fdd1c | instance_test | PAUSED | - | Running | |

Revision history for this message
Eric Xie (mark-xiett) wrote :

I check the related code:
nova.compute.manager.py
_sync_instance_power_state()
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.
                LOG.warn(_("Instance is paused unexpectedly. Ignore."),
                         instance=db_instance)
reason of case 2: (Why not process power_state 'PAUSED')
        elif vm_state == vm_states.PAUSED:
            if vm_power_state in (power_state.SHUTDOWN,
                                  power_state.CRASHED):
                self.heal_instance_state(context, db_instance,
                    vm_state,vm_power_state,default_action = instance_actions.FORCE_STOP)

Revision history for this message
Sean Dague (sdague) wrote :

This is working as designed. virsh commands outside of openstack are not supported.

Changed in nova:
status: New → Won't Fix
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.