shelve/unshelve notification may be out of order

Bug #1248802 reported by hougangliu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Guangya Liu (Jay Lau)

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)"

Tags: compute
Changed in nova:
assignee: nobody → Jay Lau (jay-lau-513)
Revision history for this message
Andrew Laski (alaski) wrote :

I think it makes sense either way, but I can see the reasoning behind ordering them sequentially.

Changed in nova:
importance: Undecided → Low
Matt Riedemann (mriedem)
tags: added: compute
Changed in nova:
status: New → Triaged
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/56811

Changed in nova:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/56811
Committed: http://github.com/openstack/nova/commit/dd6765f751f9c6f36c027ba7c945c919ecf825e2
Submitter: Jenkins
Branch: master

commit dd6765f751f9c6f36c027ba7c945c919ecf825e2
Author: Jay Lau <email address hidden>
Date: Sat Nov 23 09:05:07 2013 +0800

    Adjust the order of notification for shelve instance

    When shelve instance, if CONF.shelved_offload_time == 0, then the
    notification order for shelve_instance() is as following:
    1) compute.instance.shelve.start
    2) compute.instance.shelve_offload.start
    3) compute.instance.shelve_offload.end
    4) compute.instance.shelve.end

    This order is not correct, as actually before shelve_offload.start,
    the instance was already reached shelve.end, so we should adjust the
    order of notification for shelve instance as following:
    1) compute.instance.shelve.start
    2) compute.instance.shelve.end
    3) compute.instance.shelve_offload.start
    4) compute.instance.shelve_offload.end

    Change-Id: I6e075b3f29e1c3f641ab1e459e1fbe3b05869a9a
    Closes-Bug: #1248802

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-1 → 2014.1
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.