Pause/Unpause instance should generate a notification in ""

Bug #1043861 reported by Dimitri Souza on 2012-08-30
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Guangya Liu (Jay Lau)

Bug Description

All instance operations are generating proper notifications in "".

However the Pause/Unpause operation is not generating any event.

The expected behavior for pause/unpause should be consistent with other operations, where notification events are properly sent to the "" queue in RabbitMQ.

Mark McLoughlin (markmc) wrote :

hmm, in pause_instance() I see:


Have you tried adding notify_on_state_change=True or notify_on_any_change=True to nova.conf?

Also, please say what version you're using

Changed in nova:
status: New → Incomplete
Dimitri Souza (dimitri-souza) wrote :

I'm using Essex.

And I believe (but I'm not sure) the above code does not generate the notification. See on the same source code how the SUSPEND is implemented (it calls "self._instance_update" and then calls "self._notify_about_instance_usage").

So basically the methods "pause_instance" and "unpause_instance" are missing a call to "self._notify_about_instance_usage".

def suspend_instance(self, context, instance=None, instance_uuid=None):
        current_power_state = self._get_power_state(context, instance)

        self._notify_about_instance_usage(context, instance, 'suspend')


The solition suggested by Mark is implemented in Folsom, not Essex. This will send an event_type "compute.instance.update" informing the old state and the new state.

Dimitri Souza (dimitri-souza) wrote :

Thanks! Is there is any possibility of implementing the "compute.instance.update" in Essex?

Mark McLoughlin (markmc) wrote :

I think this would be too big a change for Essex, personally - although, if you backported the patch we could consider it

Closing as Invalid since it's not an issue in Folsom. Thanks!

Changed in nova:
status: Incomplete → Invalid

Mark, we leveraged the code from Folsom that notifies about any instance update (regarding your first suggestion) and include it in Essex.

This also resolved another issue we had that is about notifying ERRORs during an instance boot.

We kept the in order to send the events as closer as possible to the event that will be sent in Folsom.
We just commented out the piece of code related to initialize "system_metadata", "audit_period" & "bandwidth" because we haven't found such information in Essex.

Let us know if this patch is OK to be considered for Essex version.

Dimitri Souza (dimitri-souza) wrote :

Since this issue is valid for Essex, shouldn't it be moved back to a valid state?

Changed in nova:
status: Invalid → In Progress
Dimitri Souza (dimitri-souza) wrote :

OK, based on the fact that Gustavo provided a patch, I moved this issue to "In-Progress" state.

Mark McLoughlin (markmc) wrote :

Gustavo - please propose your patch in gerrit. That's the best place to discuss its suitability for Essex

Please do read our policy, though -

i.e. we want the branch to be a "safe source of high impact fixes" and, as such, we don't accept feature backports

Changed in nova:
status: In Progress → Invalid
Ala Rezmerita (arezmerita) wrote :

pause/unpause operations do not generate any notification in ""
call to self._notify_about_instance_usage is missing for the methods "pause_instance" and "unpause_instance"

Changed in nova:
status: Invalid → Confirmed
Changed in nova:
assignee: nobody → Jay Lau (jay-lau-513)
milestone: none → havana-rc1

Fix proposed to branch: master

Changed in nova:
status: Confirmed → In Progress
tags: added: compute

Submitter: Jenkins
Branch: master

commit 54f465fc63d0ded7d40704f7513d69efd986dba8
Author: Jay Lau <email address hidden>
Date: Fri Sep 27 20:52:48 2013 +0800

    Add notification for pause/unpause instance

    When pause/unpause instance, there are no notifications, this
    will cause someone cannot know when pause/unpause operation
    would be finished.

    All other instance operations do have notifications. We should
    also add notification support for those two operations.

    Change-Id: I5b8cc33a5992f5f028a3220217dcf7a0288d150d
    Closes-Bug: #1043861

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2013-10-03
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2013-10-17
Changed in nova:
milestone: havana-rc1 → 2013.2
Sean Dague (sdague) on 2014-09-19
no longer affects: nova/essex
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers