From a4b785e4f1d5b1766e31c03355319e89a372f04a Mon Sep 17 00:00:00 2001 From: jgilaber Date: Mon, 18 Aug 2025 12:43:39 +0200 Subject: [PATCH] Fix doc section to enable cinder notifications The section in the Watcher docs that describes how to enable cinder notifications incorrectly tells the user to change the cinder config to send notification to the watcher.watcher_notifications exchange and topic. Instead, it should instruct the user to change the Watcher configuration of the notification_topics [1] to listen to the 'openstack.notifications', which is the one used by cinder by default[2]. This patch also adds 'openstack.notifications' to the default value for the 'notification_topics' parameter. [1] https://docs.openstack.org/watcher/latest/configuration/watcher.html#watcher_decision_engine.notification_topics [2] https://docs.openstack.org/cinder/latest/configuration/block-storage/samples/cinder.conf.html Partial-Bug: 2121384 Change-Id: I4dc1a72af79a23c9ca07d2da5ff41bd7741e37d8 Signed-off-by: jgilaber --- doc/source/configuration/configuring.rst | 34 ++++++++++++++----- ...-notification-topics-daf6303a63963ee9.yaml | 7 ++++ watcher/conf/decision_engine.py | 3 +- 3 files changed, 35 insertions(+), 9 deletions(-) create mode 100644 releasenotes/notes/update-notification-topics-daf6303a63963ee9.yaml diff --git a/doc/source/configuration/configuring.rst b/doc/source/configuration/configuring.rst index 636650eda..8e20608c9 100644 --- a/doc/source/configuration/configuring.rst +++ b/doc/source/configuration/configuring.rst @@ -429,20 +429,38 @@ Configure Cinder Notifications Watcher can also consume notifications generated by the Cinder services, in order to build or update, in real time, its cluster data model related to -storage resources. To do so, you have to update the Cinder configuration -file on controller and volume nodes, in order to let Watcher receive Cinder -notifications in a dedicated ``watcher_notifications`` channel. +storage resources. - * In the file ``/etc/cinder/cinder.conf``, update the section - ``[oslo_messaging_notifications]``, by redefining the list of topics - into which Cinder services will publish events :: +Cinder emits notifications on the ``notifications`` topic, in the openstack +control exchange (as it can be seen in the `Cinder conf`_). + + * In the file ``/etc/cinder/cinder.conf``, the value of driver in the section + ``[oslo_messaging_notifications]`` can't be noop. [oslo_messaging_notifications] driver = messagingv2 - topics = notifications,watcher_notifications - * Restart the Cinder services. +.. _`Cinder conf`: https://docs.openstack.org/cinder/latest/configuration/block-storage/samples/cinder.conf.html +Configure Watcher listening to the Notifications +================================================ + +To consume either Cinder or Nova notifications, (or both), Watcher must be +configured to listen to the notifications topics that Cinder and Nova emit. + +Use the `notification_topics`_ config option to indicate to Watcher that it +should listen to the correct topics. By default, Cinder emits notifications +on ``openstack.notifications``, while Nova emits notifications on +``nova.versioned_notifications``. The Watcher conf should have the topics for +the desired notifications, below is an example for both Cinder and Nova:: + + [watcher_decision_engine] + + ... + + notification_topics = nova.versioned_notifications,openstack.notifications + +.. _`notification_topics`: https://docs.openstack.org/watcher/latest/configuration/watcher.html#watcher_decision_engine.notification_topics Workers ======= diff --git a/releasenotes/notes/update-notification-topics-daf6303a63963ee9.yaml b/releasenotes/notes/update-notification-topics-daf6303a63963ee9.yaml new file mode 100644 index 000000000..82a045724 --- /dev/null +++ b/releasenotes/notes/update-notification-topics-daf6303a63963ee9.yaml @@ -0,0 +1,7 @@ +--- +upgrade: + - | + Watcher now listens by default to the exchange and channel used by default + in Cinder, which is 'openstack.notifications'. The previous instructions + in the documentation to enable cinder notifications have been modified to + make clear that there is no need of changing the cinder conf. diff --git a/watcher/conf/decision_engine.py b/watcher/conf/decision_engine.py index 770924bee..b48f5750f 100644 --- a/watcher/conf/decision_engine.py +++ b/watcher/conf/decision_engine.py @@ -31,7 +31,8 @@ WATCHER_DECISION_ENGINE_OPTS = [ 'used for RPC calls'), cfg.ListOpt('notification_topics', default=['nova.versioned_notifications', - 'watcher.watcher_notifications'], + 'watcher.watcher_notifications', + 'openstack.notifications'], help='The exchange and topic names from which ' 'notification events will be listened to. ' 'The exchange should be specified to get '