vm_state and power_state are inconsistent after creating a VM which is not power-on.

Bug #1445881 reported by javeme
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Low
Unassigned

Bug Description

vm_state and power_state are inconsistent after creating a VM which is not power-on, until periodic task _sync_power_states().
It's need to set the vm_state to the state decided by the power_state(such as STOPPED) instead of ACTIVE, after it is created.

[master] nova/compute/manager.py class ComputeManager._update_instance_after_spawn():
    def _update_instance_after_spawn(self, context, instance):
        instance.power_state = self._get_power_state(context, instance)
        instance.vm_state = vm_states.ACTIVE # todo: decided by the power_state(such as STOPPED) instead of ACTIVE
        instance.task_state = None
        instance.launched_at = timeutils.utcnow()
        configdrive.update_instance(instance)

Tags: compute
javeme (javaloveme)
Changed in nova:
assignee: nobody → javeme (javaloveme)
Changed in nova:
status: New → Confirmed
importance: Undecided → Low
tags: added: compute
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/181661

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
melanie witt (melwitt) wrote :

Can you elaborate about what you mean by "creating a VM which is not powered on?" When an instance is created, it should be powered on. What behavior have you observed?

Changed in nova:
status: In Progress → Incomplete
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by javeme (<email address hidden>) on branch: master
Review: https://review.openstack.org/181661

liunian (839274949-c)
Changed in nova:
status: Incomplete → New
status: New → Opinion
status: Opinion → Incomplete
Revision history for this message
Sean Dague (sdague) wrote :

This bug does not have enough information to be actionable, it would have auto expired, except it was assigned to a user.

Changed in nova:
assignee: javeme (javaloveme) → nobody
status: Incomplete → Invalid
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.