← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1248802] Re: shelve/unshelve notification may be out of order

 

** Changed in: nova
       Status: Fix Committed => Fix Released

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

Title:
  shelve/unshelve notification may be out of order

Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  when shelve a vm and CONF.shelved_offload_time == 0,the vm would be offloaded right now.
  referring to nova/compute/manager.py:def shelve_instance(self, context, instance, image_id):
          if CONF.shelved_offload_time == 0:
              instance.task_state = task_states.SHELVING_OFFLOADING
          instance.power_state = current_power_state
          instance.save(expected_task_state=[
                  task_states.SHELVING,
                  task_states.SHELVING_IMAGE_UPLOADING])

          if CONF.shelved_offload_time == 0:
              self.shelve_offload_instance(context, instance)

          self._notify_about_instance_usage(context, instance,
  'shelve.end')

  thus,notification may occurs like:
  compute.instance.shelve.start
  compute.instance.shelve_offload.start
  compute.instance.shelve_offload.end
  compute.instance.shelve.end

  in fact,order should be like:
  compute.instance.shelve.start
  compute.instance.shelve.end
  compute.instance.shelve_offload.start
  compute.instance.shelve_offload.end

  I suggest that "self._notify_about_instance_usage(context, instance, 'shelve.end')" should be moved before
   " if CONF.shelved_offload_time == 0:
              self.shelve_offload_instance(context, instance)"

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