← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1445881] [NEW] vm_state and power_state are inconsistent after creating a VM which is not power-on.

 

Public bug reported:

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)

** Affects: nova
     Importance: Undecided
     Assignee: javeme (javaloveme)
         Status: New

** Changed in: nova
     Assignee: (unassigned) => javeme (javaloveme)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1445881

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

Status in OpenStack Compute (Nova):
  New

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)

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1445881/+subscriptions


Follow ups

References