← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2120927] [NEW] Unshelved vm has wrong information

 

Public bug reported:

Description
===========
Unshelved vm sometimes makes error or has wrong information after unshelve finished

Steps to reproduce
==================
1. shelve vm
2. unshelve vm(scheduled to another node) when vm become shelved_offloaded state


Expected result
===============
unshelve finished successfully

Actual result
=============
VM state become error or after finish of unshelve, it has no host information in vm.
It can occur when unshelve command schedule vm to different host from initial host.

Environment
===========
I use 2025.1 version openstack.

Code
====
        instance.vm_state = vm_states.SHELVED_OFFLOADED
        instance.task_state = None
1       instance.save(expected_task_state=[task_states.SHELVING,
                                           task_states.SHELVING_OFFLOADING])

        # NOTE(ndipanov): Free resources from the resource tracker
        self._update_resource_tracker(context, instance)

        # NOTE(sfinucan): RPC calls should no longer be attempted against this
        # instance, so ensure any calls result in errors
        self._nil_out_instance_obj_host_and_node(instance)
2       instance.save(expected_task_state=None)

        # TODO(melwitt): We should clean up instance console tokens here. The
        # instance has no host at this point and will need to establish a new
        # console connection in the future after it is unshelved.
        self._delete_scheduler_instance_info(context, instance.uuid)
        self._notify_about_instance_usage(context, instance,
                'shelve_offload.end')
        compute_utils.notify_about_instance_action(context, instance,
                self.host, action=fields.NotificationAction.SHELVE_OFFLOAD,
                phase=fields.NotificationPhase.END, bdms=bdms)

While shelving, it process above code.
User can try to unshelve when instance become unshelved(1 is finished).
If update resource tracker takes time, initializing host information(2) can occur during unshelve or after unshelve.

** Affects: nova
     Importance: Undecided
         Status: New

-- 
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/2120927

Title:
  Unshelved vm has wrong information

Status in OpenStack Compute (nova):
  New

Bug description:
  Description
  ===========
  Unshelved vm sometimes makes error or has wrong information after unshelve finished

  Steps to reproduce
  ==================
  1. shelve vm
  2. unshelve vm(scheduled to another node) when vm become shelved_offloaded state

  
  Expected result
  ===============
  unshelve finished successfully

  Actual result
  =============
  VM state become error or after finish of unshelve, it has no host information in vm.
  It can occur when unshelve command schedule vm to different host from initial host.

  Environment
  ===========
  I use 2025.1 version openstack.

  Code
  ====
          instance.vm_state = vm_states.SHELVED_OFFLOADED
          instance.task_state = None
  1       instance.save(expected_task_state=[task_states.SHELVING,
                                             task_states.SHELVING_OFFLOADING])

          # NOTE(ndipanov): Free resources from the resource tracker
          self._update_resource_tracker(context, instance)

          # NOTE(sfinucan): RPC calls should no longer be attempted against this
          # instance, so ensure any calls result in errors
          self._nil_out_instance_obj_host_and_node(instance)
  2       instance.save(expected_task_state=None)

          # TODO(melwitt): We should clean up instance console tokens here. The
          # instance has no host at this point and will need to establish a new
          # console connection in the future after it is unshelved.
          self._delete_scheduler_instance_info(context, instance.uuid)
          self._notify_about_instance_usage(context, instance,
                  'shelve_offload.end')
          compute_utils.notify_about_instance_action(context, instance,
                  self.host, action=fields.NotificationAction.SHELVE_OFFLOAD,
                  phase=fields.NotificationPhase.END, bdms=bdms)

  While shelving, it process above code.
  User can try to unshelve when instance become unshelved(1 is finished).
  If update resource tracker takes time, initializing host information(2) can occur during unshelve or after unshelve.

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