RabbitMQ¶
This page is the starting point for RabbitMQ, the rabbitmq role: one container, rabbitmq (the container is named
after project_name, roles/rabbitmq/defaults/main.yml:4, which the role sets to rabbitmq,
roles/rabbitmq/vars/main.yml:2), on the control nodes of the example inventory (inventory/multinode:90-91). The
role is not applied by a play of site.yml itself: site.yml:483 imports rabbitmq.yml, whose three plays all carry
the tag rabbitmq: apply the role (no serial), restart the hosts the handler put in the rabbitmq_restart group
(serial: "33%"), then post-configuration (rabbitmq.yml:3-70) CODE. Every play sets max_fail_percentage, default
100 (rabbitmq.yml:8-11,37-40,56-59), which never stops a play early
(Tags §2.5).
Changed in 2025.1 CODE:
- Queues:
om_enable_rabbitmq_high_availability,om_enable_rabbitmq_quorum_queuesandom_enable_rabbitmq_transient_quorum_queueare gone; every service rendersuse_queue_manager = true,rabbit_quorum_queue = trueandrabbit_transient_quorum_queue = true, andrabbit_stream_fanout = truewhileom_enable_rabbitmq_stream_fanoutkeeps its defaulttrue(group_vars/all.yml:292;roles/nova/templates/nova.conf.j2:142-156) (F17). - Version: the default image moves from RabbitMQ 3.13 to 4.0 (kolla
docker/rabbitmq/rabbitmq/apt_preferences_rabbitmq.ubuntu:1-3), and there is nokolla-ansible rabbitmq-upgradecommand any more. - Restarts: no config task notifies; the shared
service-check-containersrole compares the container and notifiesRestart rabbitmq container(roles/rabbitmq/tasks/check-containers.yml:2-3); the image name takesdocker_image_name_prefix(roles/rabbitmq/defaults/main.yml:30);check.ymlruns theservice-checkrole ofkolla-ansible check(roles/rabbitmq/tasks/check.yml:2-4).
The service card below summarises these plays. The lists below say where the study covers how to operate it, its impact, its dependencies and the evidence, what to check around a run and what stays open; the service card follows them.
Where to look¶
Operate¶
- Scenario: Change control-plane membership §2
- Command: Change control-plane membership §1.1, Command quick lookup by tag
- RabbitMQ version step, changed in 2025.1 CODE: the CLI has no
rabbitmq-upgradecommand (setup.cfg:50-77). The playbookrabbitmq-upgrade.ymlis still in the tree: it importsrabbitmq.ymlwithkolla_action: upgradeand the imagerabbitmq-<rabbitmq_version_suffix with dots replaced by hyphens>, a name that ignoresdocker_image_name_prefix(rabbitmq-upgrade.yml:18-21). The kolla 2025.1 tree defines two RabbitMQ images:rabbitmq, pinned to RabbitMQ 4.0 and Erlang 26.2 (kolladocker/rabbitmq/rabbitmq/rabbitmq_packages_rpm.rocky:1-4,apt_preferences_rabbitmq.ubuntu:1-3), andrabbitmq-4-1, pinned to RabbitMQ 4.1 and Erlang 27 (kolladocker/rabbitmq/rabbitmq-4-1/rabbitmq_packages_rpm.rocky:1-4). To move to 4.1, an operator can setrabbitmq_imageto therabbitmq-4-1image and runupgrade -t rabbitmq(the default is set atroles/rabbitmq/defaults/main.yml:30). NOT AVAILABLE Whether the cliff CLI can runrabbitmq-upgrade.ymlsome other way; the commands ofkolla_ansible/cli/commands.pyeach name their playbook. - Reset the state:
kolla-ansible rabbitmq-reset-staterunsstop_app,force_reset,start_appandawait_online_nodeson every rabbitmq host at once (kolla_ansible/cli/commands.py:426-434;roles/rabbitmq/tasks/reset-state.yml:1-16) CODE.
Impact and risk¶
- What the tag executes (
rabbitmq): Tags §3 and Tags §3.1, rowsrabbitmq - Risks: R3, R10
- Quorum, transient quorum and stream fanout always on: F17. The
[oslo_messaging_rabbit]section of 26 templates in 24 roles rendersrabbit_quorum_queue = true(grep ofroles/*/templates; e.g.roles/nova/templates/nova.conf.j2:151-156,roles/nova-cell/templates/nova.conf.j2:201-206,roles/neutron/templates/neutron.conf.j2:139-144) CODE. A 2024.1 cloud with the 2024.1 defaults already had quorum queues, but not the queue manager, transient quorum queues or stream fanout (2024.1group_vars/all.yml:269-279). Its first 2025.1 run that renders configs therefore changes the messaging config of those services, computes included, and restarts them. NOT AVAILABLE What oslo.messaging does with the existing classicreply_queues and fanout exchanges when the services restart with these options; to be confirmed by the community.
Dependencies¶
- Dependencies: Component dependencies §1, Component dependencies §2
- Transport URLs:
rpc_transport_urlandnotify_transport_urllist every host of therabbitmqgroup one by one (group_vars/all.yml:274,284); nova-cell builds its own URLs from the same group by default (roles/nova-cell/defaults/main.yml:202,217-218) CODE. Still holds in 2025.1: a change of therabbitmqmembership changes thetransport_urlof every service that uses them.
Evidence¶
- Fact sheet: fact sheet B §2
- Image side: Kolla images
§4 (row
rabbitmq), Kolla images §5 - Also: handlers: Tags §5. The only handler, "Restart rabbitmq
container", restarts nothing; it adds the host to the group
rabbitmq_restart(roles/rabbitmq/handlers/main.yml:2-4), and the restart play then, when arabbitmqcontainer is listed, drains the node withcommunity.rabbitmq.rabbitmq_upgradedrainif the group has more than one host, or runsrabbitmqctl stop_appon a single-node broker (new in 2025.1), recreates or restarts it and waits withrabbitmqctl wait --timeout 60(roles/rabbitmq/tasks/restart_services.yml:2-49), inserial: "33%"batches (rabbitmq.yml:30-49) CODE.
Before and after a run¶
- Pre-execution checklist, step 3 (batch size): changed in 2025.1,
reconfigureandupgradealways passkolla_serial=0(F19) and onlydeploy -e kolla_serial=Nbatches; mariadb and rabbitmq ignore it anyway: the RabbitMQ plays set noserialexcept the restart play, which has its ownserial: "33%"(rabbitmq.yml:3-70,:36) CODE. - Pre-execution checklist, step 5 (health gates): before the run, check
RabbitMQ: cluster status, no partitions. Repeat after each batch. New in 2025.1:
kolla-ansible check -t rabbitmqfails when therabbitmqcontainer is missing, stopped orunhealthy(roles/rabbitmq/tasks/check.yml:2-4,roles/service-check/tasks/main.yml:3-40); it does not look at the cluster itself. kolla-ansible prechecks, changed in 2025.1 (F17) CODE:- The
prechecksrole no longer compares HA and quorum settings; the variables are gone. - When a
rabbitmqcontainer exists, the RabbitMQ precheck lists the queues once and asserts, with no switch, that every queue whose name contains neitherreply_nor_fanoutis a quorum queue, thatreply_queues are quorum queues, and that_fanoutqueues are streams while stream fanout is on (roles/rabbitmq/tasks/precheck.yml:110-164). A 2024.1 cloud with the 2024.1 defaults has classicreply_and fanout queues, so the precheck fails there until they are migrated; the message calls the migration manual and says it may take several hours (:121-125). Theha-allassert is gone. The block carries the tagrabbitmq-ha-precheck(:164). - These checks run only for
kolla_actionprecheck, set bykolla-ansible prechecks(kolla_ansible/cli/commands.py:99-110; the prechecks play,site.yml:77-86; the role entry point includes<kolla_action>.yml,roles/rabbitmq/tasks/main.yml:2-3).deploy,reconfigureandupgradedo not run them.
- The
- Tags §3.1, row
rabbitmq: safe on its own "yes on a healthy cluster; membership changes are R3"; prerequisites: no partitions, all nodes running. - R3, precautions for a change of RabbitMQ group membership, password or port: plan as a
maintenance; batch with
--limit; verify RabbitMQ cluster health first. - R10, precautions for a RabbitMQ image change (
upgrade): maintenance window; watch for agent and compute services reported down. Still holds in 2025.1:upgradedoes not stop every broker; the role renders the config, enables all stable feature flags on the running brokers, then checks the containers (roles/rabbitmq/tasks/upgrade.yml:1-10,feature-flags.yml:2-5), and the restart play drains, recreates and waits for each node inserial: "33%"batches (rabbitmq.yml:30-49,roles/rabbitmq/tasks/restart_services.yml:10-49) CODE. - The version check CODE:
deploy.ymlandupgrade.ymlimportversion-check.ymlfirst (roles/rabbitmq/tasks/deploy.yml:2,upgrade.yml:2), and so doesreconfigure(reconfigure.yml:2). When arabbitmqcontainer exists, once, on the first host of the group (version-check.yml:76-80), it reads the running version withrabbitmqctl --versionand the new one from a one-shotrabbitmq_version_checkcontainer of the target image (:13-38), then asserts that both have the same major version and at most one minor version between them, or that the step is 3.13 to 4.0 or 4.1 (:45-65). Otherwise it fails with "Looks like you're trying to run a skip-release upgrade!" and, an oddity in 2025.1, names akolla-ansible rabbitmq-upgradestep that the CLI no longer has (:64). The downgrade assert follows (:67-74). The whole file carries the tagrabbitmq-version-check(:80), so--skip-tags rabbitmq-version-checkskips it. - Consequence for an upgrade from 2024.1 CODE (from the image pins): the 2024.1
rabbitmqimage pinned RabbitMQ 3.13, the 2025.1 one pins 4.0 (kolladocker/rabbitmq/rabbitmq/apt_preferences_rabbitmq.ubuntu:2), a step the check allows. A cloud that moved to the 2024.1rabbitmq-4-1image is on 4.1, and the default 2025.1 image would be a downgrade that the check refuses (version-check.yml:67-74) unlessrabbitmq_imagepoints at therabbitmq-4-1image again. NOT AVAILABLE Which RabbitMQ version a given cloud runs, and what RabbitMQ 4.0 does with a cluster that still has classic mirrored queues.
Known limits and open points¶
- Known bugs and limitations, row
rabbitmq: the image writes.erlang.cookieonly in the bootstrap container (kolladocker/rabbitmq/rabbitmq/extend_start.sh:7-18), which runs only when the volume was just created (roles/rabbitmq/tasks/bootstrap.yml:2-26); a cookie change recreates the brokers (env compare,roles/rabbitmq/defaults/main.yml:13-16,roles/service-check-containers/tasks/main.yml:19) but they keep the old cookie, whilekolla_toolboxgets the new one. Status: still holds in 2025.1 CODE; consequences NOT AVAILABLE. - The data volume is
rabbitmq_datadir_volume(defaultrabbitmq,group_vars/all.yml:1049;roles/rabbitmq/defaults/main.yml:52), but the bootstrap still creates, and gates on, the volume named afterproject_name(roles/rabbitmq/tasks/bootstrap.yml:2-8,26). With the default the two are the same volume CODE. NOT AVAILABLE What happens to the cookie whenrabbitmq_datadir_volumeis changed on an existing cloud. - New in 2025.1,
ha-allremoval on every run CODE:remove-ha-all-policy.ymlnow runs on every deploy, reconfigure and upgrade, with no condition, and clears anha-allpolicy found on the first rabbitmq host (roles/rabbitmq/tasks/deploy.yml:4,remove-ha-all-policy.yml:12-24). - The HA tuning variables are dead CODE:
rabbitmq_ha_replica_count,rabbitmq_ha_promote_on_shutdown,rabbitmq_message_ttl_msandrabbitmq_queue_expiry_msare still defined (roles/rabbitmq/defaults/main.yml:65-85), butdefinitions.json.j2renders"policies":[]unconditionally (roles/rabbitmq/templates/definitions.json.j2:13). - What is not known, row "RabbitMQ": the sources do not establish whether nova-compute heartbeats are lost and services are reported down while brokers are drained and restarted on upgrade (R10); whether, during a one-by-one restart, nova-compute and the agents lose RPC and reconnect by themselves; the consequences of a changed Erlang cookie; what oslo.messaging does with existing classic transient queues once transient quorum queues and stream fanout are rendered (F17). These points are to be confirmed by the community.
- Q14, answered from the source CODE: RabbitMQ writes the Erlang cookie
only in its bootstrap container (kolla
docker/rabbitmq/rabbitmq/extend_start.sh:7-18). - F6, "Global inputs are rendered into per-host files":
enable_*flags, RabbitMQ/memcached membership, service passwords and the external FQDN end up in compute-side files CODE. - F17, "RabbitMQ quorum queues are on by default": the only choice in 2025.1 CODE.
- fact sheet B
§2.8,
"Operationally notable behaviour, risks and oddities". Checked against 2025.1 CODE: reconfigure with a config
change is a drained restart in
serial: "33%"batches (roles/rabbitmq/tasks/reconfigure.yml:2,rabbitmq.yml:30-49);upgradeis not a full outage of the message bus:roles/rabbitmq/tasks/upgrade.yml:1-10has no cluster-wide stop (R10); uncontrolled full stop (the brokers come back through the same batched restart play; which node starts first is NOT AVAILABLE,group_byorder); scaling the rabbitmq group changestransport_url(the templates of 25 roles referencerpc_transport_url, grep ofroles/*/templates;group_vars/all.yml:274,284); password change; the precheck still runsgetentfor every rabbit host on every rabbit host, N² lookups (roles/rabbitmq/tasks/precheck.yml:62-78). - Kolla images §6, items 9 and 10: the RabbitMQ cookie is fixed at
bootstrap CODE (consequences NOT AVAILABLE);
kolla_toolboxgets the new cookie only when thecommonplay runs (an untagged run or-t common;roles/common/templates/rabbitmq-erlang.cookie.j2:1,roles/common/tasks/config.yml:241-249,site.yml:88-103); recursive chown on data volumes at every start, the RabbitMQ mnesia directory among them (roles/rabbitmq/templates/rabbitmq.json.j2:59-70) CODE.
Service card¶
The rows of the card are explained in How to read a service card.
| Item | Value |
|---|---|
| Play | rabbitmq.yml (import_playbook at site.yml:483; 3 plays) |
| Tags | rabbitmq |
| Play host patterns | rabbitmq, rabbitmq_restart |
| Node types in play (example inventory) | control |
| Node types running its containers | – |
| Containers | rabbitmq |
deploy/reconfigure flow (tasks/) |
version-check → remove-ha-all-policy → config → check-containers → bootstrap |
| Task files | bootstrap.yml, check-containers.yml, check.yml, config.yml, config_validate.yml, copy-certs.yml, deploy-containers.yml, deploy.yml, feature-flags.yml, loadbalancer.yml, main.yml, post-deploy.yml, precheck.yml, pull.yml, reconfigure.yml, remove-ha-all-policy.yml, reset-state.yml, restart_services.yml, stop.yml, upgrade.yml, version-check.yml |
| Templates | advanced.config.j2, definitions.json.j2, enabled_plugins.j2, erl_inetrc.j2, rabbitmq-env.conf.j2, rabbitmq.conf.j2, rabbitmq.json.j2 |
| Handlers (definition order) | Restart rabbitmq container |
| Key variables | enable_rabbitmq, om_rpc_*, rabbitmq_*, rpc_transport_url |
| Role dependencies | none |
Related¶
- Change control-plane membership — changing the
rabbitmqmembership changes the transport URL everywhere - Update container images §4 — with a tag change,
deployandupgradeboth restart RabbitMQ in batches of 33 %, each node drained first; both run the version check first - Component dependencies §1 — RabbitMQ hosts are listed one by one in the configs of the services that use them
- Common: fluentd, cron, kolla_toolbox —
kolla_toolboxgets the new cookie whenrabbitmq_cluster_cookiechanges and thecommonplay runs - Technical findings F17 — quorum queues, the only choice in 2025.1
- Pre-execution checklist — the eight checks before every production run
- Components — the other component pages