OpenStack cluster event notification
Hi All, So far, based on my understanding of OpenStack Python SDK, I am able to read the Hypervisor, Servers instances, however, I do not see an API to receive and handle the change notification/events for the operations that happens on the cluster e.g. A new VM is added, an existing VM is deleted etc. I see a documentation, which talks about emitting notifications over a message bus that indicate different events that occur within the service. Notifications in OpenStack <https://docs.openstack.org/ironic/latest/admin/notifications.html> https://docs.openstack.org/ironic/latest/admin/notifications.html 1. Does Openstack Python SDK support notification APIs? 2. How do I receive/monitor notifications for VM related changes? 3. How do I receive/monitor notifications for compute/hypervisor related changes? 4. How do I receive/monitor notifications for Virtual Switch related changes? Thanks in advance for any help in this regard. /anil.
Greetings! Unfortunately, I don't know the eventing context outside of ironic's ability to emit them, but I'll try my best to answer questions with my context. On Tue, Jul 7, 2020 at 1:02 AM Anil Jangam <anilj.mailing@gmail.com> wrote:
Hi All,
So far, based on my understanding of OpenStack Python SDK, I am able to read the Hypervisor, Servers instances, however, I do not see an API to receive and handle the change notification/events for the operations that happens on the cluster e.g. A new VM is added, an existing VM is deleted etc.
I see a documentation, which talks about emitting notifications over a message bus that indicate different events that occur within the service.
Notifications in OpenStack
https://docs.openstack.org/ironic/latest/admin/notifications.html
I suspect you may also find https://docs.openstack.org/nova/latest/reference/notifications.html useful.
Does Openstack Python SDK support notification APIs?
I'm going to guess the answer is no to this. As you noted earlier, the notifications are emitted to the message bus. These notifications can be read by a subscriber to the message bus itself, but this also means that the bus is directly connected to by some sort of messaging client. The Python SDK is intended for developers to use to leverage the REST APIs offered by services and components, not the message bus.
How do I receive/monitor notifications for VM related changes? How do I receive/monitor notifications for compute/hypervisor related changes? How do I receive/monitor notifications for Virtual Switch related changes?
I think what you are looking for is ceilometer. https://docs.openstack.org/ceilometer/latest/admin/telemetry-data-collection... Although that being said, I don't think much would really prevent you from consuming the notifications directly from the message bus, if you so desire. Maybe someone already has some code for this on hand.
Thanks in advance for any help in this regard.
Hope this helped.
/anil.
-Julia
On Tue, Jul 7, 2020 at 16:32, Julia Kreger <juliaashleykreger@gmail.com> wrote: [snip]
Although that being said, I don't think much would really prevent you from consuming the notifications directly from the message bus, if you so desire. Maybe someone already has some code for this on hand.
Here is some example code that forwards the nova versioned notifications from the message bus out to a client via websocket [1]. I used this sample code in my demo [2] during a summit presentation. Cheers, gibi [1] https://github.com/gibizer/nova-notification-demo/blob/master/ws_forwarder.p... [2] https://www.youtube.com/watch?v=WFq5JWXa9AM
Thanks Julia for comments. Also thanks Gibi for the github link and sharing the example. I will take a look and adopt it. On Wed, Jul 8, 2020 at 5:05 AM Balázs Gibizer <balazs.gibizer@est.tech> wrote:
On Tue, Jul 7, 2020 at 16:32, Julia Kreger <juliaashleykreger@gmail.com> wrote: [snip]
Although that being said, I don't think much would really prevent you from consuming the notifications directly from the message bus, if you so desire. Maybe someone already has some code for this on hand.
Here is some example code that forwards the nova versioned notifications from the message bus out to a client via websocket [1]. I used this sample code in my demo [2] during a summit presentation.
Cheers, gibi
[1]
https://github.com/gibizer/nova-notification-demo/blob/master/ws_forwarder.p... [2] https://www.youtube.com/watch?v=WFq5JWXa9AM
Hello Gibi. I looked at your sample code. Other than providing the username password of the user in transport url, *transport = oslo_messaging.get_notification_transport(cfg.CONF, url='rabbit://stackrabbit:admin@100.109.0.10:5672/ <http://stackrabbit:admin@100.109.0.10:5672/>')* What changes are to be done in the nova.conf file? Can you please provide the exact set of changes? /anil. On Wed, Jul 8, 2020 at 5:05 AM Balázs Gibizer <balazs.gibizer@est.tech> wrote:
On Tue, Jul 7, 2020 at 16:32, Julia Kreger <juliaashleykreger@gmail.com> wrote: [snip]
Although that being said, I don't think much would really prevent you from consuming the notifications directly from the message bus, if you so desire. Maybe someone already has some code for this on hand.
Here is some example code that forwards the nova versioned notifications from the message bus out to a client via websocket [1]. I used this sample code in my demo [2] during a summit presentation.
Cheers, gibi
[1]
https://github.com/gibizer/nova-notification-demo/blob/master/ws_forwarder.p... [2] https://www.youtube.com/watch?v=WFq5JWXa9AM
participants (3)
-
Anil Jangam
-
Balázs Gibizer
-
Julia Kreger