From 1ecde3e228d1ef9ce84d2506a8af5379755a80c7 Mon Sep 17 00:00:00 2001 From: Travis Truman Date: Wed, 20 Jul 2016 13:47:22 -0400 Subject: [PATCH] Allow configuration of multiple rabbit clusters In the mitaka release, neutron enabled configuring separate transport_url values for RPC and notification messaging. Change-Id: I03449c93532ccce6eded49ac1d9c6e84716ffe2c Implements: blueprint multi-rabbitmq-clusters --- defaults/main.yml | 12 ++++++++++++ templates/neutron.conf.j2 | 19 +++++++++---------- tests/test-vars.yml | 16 ++++++++-------- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index b35c0a98..ec4b1abe 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -70,8 +70,20 @@ neutron_db_pool_size: 120 neutron_db_pool_timeout: 30 ## RabbitMQ info + +## Configuration for RPC communications neutron_rabbitmq_userid: neutron neutron_rabbitmq_vhost: /neutron +neutron_rabbitmq_port: 5672 +neutron_rabbitmq_servers: 127.0.0.1 +neutron_rabbitmq_use_ssl: False + +## Configuration for notifications communication, i.e. [oslo_messaging_notifications] +neutron_rabbitmq_telemetry_userid: "{{ neutron_rabbitmq_userid }}" +neutron_rabbitmq_telemetry_vhost: "{{ neutron_rabbitmq_vhost }}" +neutron_rabbitmq_telemetry_port: "{{ neutron_rabbitmq_port }}" +neutron_rabbitmq_telemetry_servers: "{{ neutron_rabbitmq_servers }}" +neutron_rabbitmq_telemetry_use_ssl: "{{ neutron_rabbitmq_use_ssl }}" ## Plugins neutron_plugin_core: "{{ neutron_plugins[neutron_plugin_type].plugin_core }}" diff --git a/templates/neutron.conf.j2 b/templates/neutron.conf.j2 index a5f886b6..218e53d5 100644 --- a/templates/neutron.conf.j2 +++ b/templates/neutron.conf.j2 @@ -32,9 +32,6 @@ auth_strategy = keystone network_scheduler_driver = {{ neutron_driver_network_scheduler }} router_scheduler_driver = {{ neutron_driver_router_scheduler }} loadbalancer_pool_scheduler_driver = {{ neutron_driver_loadbalancer_pool_scheduler }} -{% if neutron_ceilometer_enabled %} -notification_driver = messagingv2 -{% endif %} # Schedulers network_auto_schedule = True @@ -89,6 +86,7 @@ rpc_backend = {{ neutron_rpc_backend }} executor_thread_pool_size = {{ neutron_rpc_thread_pool_size }} rpc_conn_pool_size = {{ neutron_rpc_conn_pool_size }} rpc_response_timeout = {{ neutron_rpc_response_timeout }} +transport_url = rabbit://{% for host in neutron_rabbitmq_servers.split(',') %}{{ neutron_rabbitmq_userid }}:{{ neutron_rabbitmq_password }}@{{ host }}:{{ neutron_rabbitmq_port }}/{{ neutron_rabbitmq_vhost }}?rabbit_use_ssl={{ neutron_rabbitmq_use_ssl }},{% endfor %} [nova] auth_plugin = {{ nova_keystone_auth_plugin }} @@ -178,14 +176,15 @@ polling_interval = {{ neutron_agent_polling_interval|default(5) }} report_interval = {{ neutron_report_interval|int }} root_helper = sudo {{ neutron_bin }}/neutron-rootwrap /etc/neutron/rootwrap.conf -# Messaging service +# Messaging [oslo_messaging_rabbit] -rabbit_port = {{ neutron_rabbitmq_port }} -rabbit_userid = {{ neutron_rabbitmq_userid }} -rabbit_password = {{ neutron_rabbitmq_password }} -rabbit_virtual_host = {{ neutron_rabbitmq_vhost }} -rabbit_hosts = {{ neutron_rabbitmq_servers }} -rabbit_use_ssl = {{ neutron_rabbitmq_use_ssl }} + +# Notifications +{% if neutron_ceilometer_enabled %} +[oslo_messaging_notifications] +driver = messagingv2 +transport_url = rabbit://{% for host in neutron_rabbitmq_telemetry_servers.split(',') %}{{ neutron_rabbitmq_telemetry_userid }}:{{ neutron_rabbitmq_telemetry_password }}@{{ host }}:{{ neutron_rabbitmq_telemetry_port }}/{{ neutron_rabbitmq_telemetry_vhost }}?rabbit_use_ssl={{ neutron_rabbitmq_telemetry_use_ssl }},{% endfor %} +{% endif %} # Concurrency (locking mechanisms) [oslo_concurrency] diff --git a/tests/test-vars.yml b/tests/test-vars.yml index e31c8bef..1862e445 100644 --- a/tests/test-vars.yml +++ b/tests/test-vars.yml @@ -13,9 +13,9 @@ keystone_galera_address: 10.100.100.2 keystone_galera_database: keystone keystone_git_install_branch: master keystone_rabbitmq_password: secrete -keystone_rabbitmq_port: 5671 -keystone_rabbitmq_servers: 10.100.100.2 -keystone_rabbitmq_use_ssl: false +keystone_rabbitmq_port: "{{ rabbitmq_port }}" +keystone_rabbitmq_servers: "{{ rabbitmq_servers }}" +keystone_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}" keystone_rabbitmq_userid: keystone keystone_rabbitmq_vhost: /keystone keystone_requirements_git_install_branch: master @@ -43,9 +43,9 @@ neutron_provider_networks: neutron_rabbitmq_password: secrete neutron_rabbitmq_userid: neutron neutron_rabbitmq_vhost: /neutron -neutron_rabbitmq_port: 5671 -neutron_rabbitmq_servers: 10.100.100.2 -neutron_rabbitmq_use_ssl: true +neutron_rabbitmq_port: "{{ rabbitmq_port }}" +neutron_rabbitmq_servers: "{{ rabbitmq_servers }}" +neutron_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}" neutron_requirements_git_install_branch: master neutron_service_password: secrete neutron_venv_tag: testing @@ -62,6 +62,6 @@ nova_service_user_name: nova openrc_os_auth_url: "http://127.0.0.1:5000/v3" openrc_os_domain_name: Default openrc_os_password: "{{ keystone_auth_admin_password }}" -rabbitmq_port: 5671 +rabbitmq_port: 5672 rabbitmq_servers: 10.100.100.2 -rabbitmq_use_ssl: true +rabbitmq_use_ssl: False