Pause/Unpause instance should generate a notification in "notification.info"

Bug #1043861 reported by Dimitri Souza
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Guangya Liu (Jay Lau)

Bug Description

All instance operations are generating proper notifications in "notification.info".

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 "notification.info" queue in RabbitMQ.

Tags: compute
Revision history for this message
Mark McLoughlin (markmc) wrote :

hmm, in pause_instance() I see:

        self._instance_update(context,
                              instance['uuid'],
                              power_state=current_power_state,
                              vm_state=vm_states.PAUSED,
                              task_state=None)

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
Revision history for this message
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._instance_update(context,
                              instance['uuid'],
                              power_state=current_power_state,
                              vm_state=vm_states.SUSPENDED,
                              task_state=None)

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

---------------

Revision history for this message
Gustavo Knüppe (gustavo-knuppe) wrote :

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.

Revision history for this message
Dimitri Souza (dimitri-souza) wrote :

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

Revision history for this message
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
Revision history for this message
Gustavo Knüppe (gustavo-knuppe) wrote :

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 notifications.py 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.

Revision history for this message
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
Revision history for this message
Dimitri Souza (dimitri-souza) wrote :

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

Revision history for this message
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 - http://wiki.openstack.org/StableBranch

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
Revision history for this message
Ala Rezmerita (arezmerita) wrote :

pause/unpause operations do not generate any notification in "notification.info"
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
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/48647

Changed in nova:
status: Confirmed → In Progress
tags: added: compute
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/48647
Committed: http://github.com/openstack/nova/commit/54f465fc63d0ded7d40704f7513d69efd986dba8
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)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-rc1 → 2013.2
Sean Dague (sdague)
no longer affects: nova/essex
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.