Ask Your Question
5

Nova/Quantum Notifications in RabbitMQ

asked 2013-06-16 08:30:31 -0500

tzafrir gravatar image

updated 2013-06-16 14:07:42 -0500

Hi all,

I'm trying to catch nova/quantum modules (and others later) notifications.

What I would like to catch are events that indicate changes in instances and network:

  • Instance create/delete/suspend
  • IP assigning/deleting
  • Port add/delete
  • Security Groups changes

The problem is that I don't catch any notification messages.

I noticed that Nova doesn't send notifications.# to the nova exchange but to the default AMQP exchange.

As an example, when I suspend/resume an instance, the only messages I get are requests from Nova and Quantum. I don't see any messages with event_type.

I found the following documents: https://wiki.openstack.org/wiki/Oslo/Messaging https://wiki.openstack.org/wiki/SystemUsageData https://wiki.openstack.org/wiki/NotificationEventExamples and of course - http://docs.openstack.org/developer/nova/devref/rpc.html

I am using the RabbitMQ API to query the exchanges/queues existing on the controller and bind a queue to each exchange.

I am "listening" to the following exchanges (topic/fanout): nova, quantum, openstack, compute, q-agent, scheduler, conductor

and I filter out the following methods: service_update, report_state, update_service_capabilities.

  • Am I doing something wrong? (probably yes)
  • Where are the notifications being sent to?
  • For what exchanges should I bind to get the notifications I need?
  • I didn't quite understand what is the oslo.message...

Thanks in advance! Tzafrir

can't attach output - no karma!

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
6

answered 2013-06-20 05:54:52 -0500

darragh-oreilly gravatar image

I'm not sure this will help, but I get messages from both quantum and nova with this:

from kombu import Connection, Exchange, Queue
from pprint import pprint

nova_x = Exchange('nova', type='topic', durable=False)
info_q = Queue('notifications.info', exchange=nova_x, durable=False, 
               routing_key='notifications.info')

def process_msg(body, message):
    print '='*80
    pprint(body)
    message.ack()

with Connection('amqp://guest:guest@10.0.10.10//') as conn:
    with conn.Consumer(info_q, callbacks=[process_msg]):
        while True:
            try:
                conn.drain_events()
            except KeyboardInterrupt:
                break

qauntum.conf:

notification_driver = quantum.openstack.common.notifier.rpc_notifier
#notification_driver = quantum.openstack.common.notifier.log_notifier
default_notification_level = INFO
notification_topics = notifications

nova.conf

notification_driver = nova.openstack.common.notifier.rpc_notifier
#notification_driver = nova.openstack.common.notifier.log_notifier
default_notification_level = INFO
notification_topics = notifications
notify_on_state_change = vm_and_task_state
notify_api_faults = true
edit flag offensive delete link more

Comments

Thanks for the answer. This is exactly what i'm doing (just using the Java API). Perhaps I should mention that i'm using the latest devstack as an environment... I guess it's not an official OpenStack build. I will try with Grizzly.

tzafrir gravatar imagetzafrir ( 2013-06-21 01:32:26 -0500 )edit

Yeah, that might be your problem - I used Grizzly. Look for blueprints, bugs and git-blame around this code to see what's changing. I found the RabbitMQ web interface very useful http://www.rabbitmq.com/management.html

darragh-oreilly gravatar imagedarragh-oreilly ( 2013-06-21 03:09:45 -0500 )edit

I am using it. really useful in understanding how everything connects. Should there be any difference in the configuration when setting the nova.conf on the compute node?

tzafrir gravatar imagetzafrir ( 2013-06-21 03:15:58 -0500 )edit

I haven't tried it on nova-compute. Maybe you could 'grep -r' the whole nova source tree to find all notifier calls. The rabbit_notifier is deprecated https://github.com/openstack/nova/blob/master/nova/openstack/common/notifier/rabbit_notifier.py

darragh-oreilly gravatar imagedarragh-oreilly ( 2013-06-21 03:26:01 -0500 )edit

Hi tzaffir,

Were you able to receive notifications in your java code ? How does the notification subscription setup look like ?

Murali G D gravatar imageMurali G D ( 2014-03-19 22:38:31 -0500 )edit
0

answered 2014-10-01 10:01:49 -0500

Goblja gravatar image

hello everybody... I wanted to try this code to listen notifications.info from heat. But i dont get messages... if i change from notifications.info to engine queue then i recieve messages, but i need notifications... Also tried to do this with nova. Bad luck dont get no notification messages I use devstack with icehouse... mybe i am doing something wrong :) how could i check are there notifications or not?

edit flag offensive delete link more

Comments

Try to use the special routing key #

Tosugueur gravatar imageTosugueur ( 2015-09-28 05:20:26 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

5 followers

Stats

Asked: 2013-06-16 08:30:31 -0500

Seen: 2,974 times

Last updated: Oct 01 '14