From 87d070f4be3aeb99e22efa8acef3a2cd171c0c2f Mon Sep 17 00:00:00 2001 From: Andrew Smith Date: Tue, 24 Apr 2018 11:43:21 -0400 Subject: [PATCH] Update to use oslo.messaging services for RPC and Notify This introduces oslo.messaging variables that define the RPC and Notify transports for the OpenStack services. These parameters replace the rabbitmq values and are used to generate the messaging transport_url for the service. The association of the messaging backend server to the oslo.messaging services will then be transparent to the glance service. This patch: * Add oslo.messaging variables for RPC and Notify to defaults * Update transport_url generation * Add oslo.messaging to inventory * Add release note Depends-On: If4326a6848d2d32af284fdbb94798eb0b03734d5 Change-Id: Ib647d87df040c77ee3906b1bf58764ca5f3d765d --- defaults/main.yml | 31 +++++++++++-------- ...ng-separate-backends-61d279ded1bc999e.yaml | 20 ++++++++++++ templates/glance-api.conf.j2 | 5 ++- templates/glance-registry.conf.j2 | 6 ++-- tests/inventory | 6 ++++ 5 files changed, 48 insertions(+), 20 deletions(-) create mode 100644 releasenotes/notes/oslo-messaging-separate-backends-61d279ded1bc999e.yaml diff --git a/defaults/main.yml b/defaults/main.yml index 7d4395b3..5132d8ac 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -90,20 +90,25 @@ glance_enable_v2_registry: False ## RabbitMQ info -## Configuration for RPC communications -glance_rabbitmq_userid: glance -glance_rabbitmq_vhost: /glance -glance_rabbitmq_port: 5672 -glance_rabbitmq_servers: 127.0.0.1 -glance_rabbitmq_use_ssl: False +## Oslo Messaging Info -## Configuration for notifications communication, i.e. [oslo_messaging_notifications] -glance_rabbitmq_telemetry_userid: "{{ glance_rabbitmq_userid }}" -glance_rabbitmq_telemetry_password: "{{ glance_rabbitmq_password }}" -glance_rabbitmq_telemetry_vhost: "{{ glance_rabbitmq_vhost }}" -glance_rabbitmq_telemetry_port: "{{ glance_rabbitmq_port }}" -glance_rabbitmq_telemetry_servers: "{{ glance_rabbitmq_servers }}" -glance_rabbitmq_telemetry_use_ssl: "{{ glance_rabbitmq_use_ssl }}" +# RPC + +glance_oslomsg_rpc_transport: rabbit +glance_oslomsg_rpc_servers: 127.0.0.1 +glance_oslomsg_rpc_port: 5672 +glance_oslomsg_rpc_use_ssl: False +glance_oslomsg_rpc_userid: glance +glance_oslomsg_rpc_vhost: /glance + +# Notify + +glance_oslomsg_notify_transport: rabbit +glance_oslomsg_notify_servers: 127.0.0.1 +glance_oslomsg_notify_port: 5672 +glance_oslomsg_notify_use_ssl: False +glance_oslomsg_notify_userid: glance +glance_oslomsg_notify_vhost: /glance ## Database info glance_db_setup_host: "{{ ('galera_all' in groups) | ternary(groups['galera_all'][0], 'localhost') }}" diff --git a/releasenotes/notes/oslo-messaging-separate-backends-61d279ded1bc999e.yaml b/releasenotes/notes/oslo-messaging-separate-backends-61d279ded1bc999e.yaml new file mode 100644 index 00000000..50a9fc29 --- /dev/null +++ b/releasenotes/notes/oslo-messaging-separate-backends-61d279ded1bc999e.yaml @@ -0,0 +1,20 @@ +--- +features: + - Support separate oslo.messaging services for RPC and Notifications + to enable operation of separate and different messaging backend servers. +deprecations: + - | + The rabbitmq server parameters have been replaced by corresponding + oslo.messaging RPC and Notify parameters in order to abstract the + messaging service from the actual backend server deployment. + - glance_oslomsg_rpc_servers replaces glance_rabbitmq_servers + - glance_oslomsg_rpc_port replaces glance_rabbitmq_port + - glance_oslomsg_rpc_use_ssl replaces glance_rabbitmq_use_ssl + - glance_oslomsg_rpc_userid replaces glance_rabbitmq_userid + - glance_oslomsg_rpc_vhost replaces glance_rabbitmq_vhost + - glance_oslomsg_notify_servers replaces glance_rabbitmq_telemetry_servers + - glance_oslomsg_notify_port replaces glance_rabbitmq_telemetry_port + - glance_oslomsg_notify_use_ssl replaces glance_rabbitmq_telemetry_use_ssl + - glance_oslomsg_notify_userid replaces glance_rabbitmq_telemetry_userid + - glance_oslomsg_notify_vhost replaces glance_rabbitmq_telemetry_vhost + - glance_oslomsg_notify_password replaces glance_rabbitmq_telemetry_password diff --git a/templates/glance-api.conf.j2 b/templates/glance-api.conf.j2 index 5b39fa6c..168da58c 100644 --- a/templates/glance-api.conf.j2 +++ b/templates/glance-api.conf.j2 @@ -26,7 +26,7 @@ enable_v2_registry = {{ glance_enable_v2_registry | bool }} data_api = glance.db.registry.api {% endif %} -transport_url = rabbit://{% for host in glance_rabbitmq_servers.split(',') %}{{ glance_rabbitmq_userid }}:{{ glance_rabbitmq_password }}@{{ host }}:{{ glance_rabbitmq_port }}{% if not loop.last %},{% else %}/{{ glance_rabbitmq_vhost }}{% endif %}{% endfor %} +transport_url = {{ glance_oslomsg_rpc_transport }}://{% for host in glance_oslomsg_rpc_servers.split(',') %}{{ glance_oslomsg_rpc_userid }}:{{ glance_oslomsg_rpc_password }}@{{ host }}:{{ glance_oslomsg_rpc_port }}{% if not loop.last %},{% else %}/{{ glance_oslomsg_rpc_vhost }}{% if glance_oslomsg_rpc_use_ssl | bool %}?ssl=1{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} delayed_delete = False scrub_time = 43200 @@ -68,14 +68,13 @@ policy_default_rule = {{ glance_policy_default_rule }} policy_dirs = {{ glance_policy_dirs }} [oslo_messaging_rabbit] -ssl = {{ glance_rabbitmq_use_ssl }} rabbit_notification_exchange = glance rabbit_notification_topic = notifications {% if glance_ceilometer_enabled %} [oslo_messaging_notifications] driver = messagingv2 -transport_url = rabbit://{% for host in glance_rabbitmq_telemetry_servers.split(',') %}{{ glance_rabbitmq_telemetry_userid }}:{{ glance_rabbitmq_telemetry_password }}@{{ host }}:{{ glance_rabbitmq_telemetry_port }}{% if not loop.last %},{% else %}/{{ glance_rabbitmq_telemetry_vhost }}{% endif %}{% endfor %} +transport_url = {{ glance_oslomsg_notify_transport }}://{% for host in glance_oslomsg_notify_servers.split(',') %}{{ glance_oslomsg_notify_userid }}:{{ glance_oslomsg_notify_password }}@{{ host }}:{{ glance_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ glance_oslomsg_notify_vhost }}{% if glance_oslomsg_notify_use_ssl | bool %}?ssl=1{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} {% endif %} [paste_deploy] diff --git a/templates/glance-registry.conf.j2 b/templates/glance-registry.conf.j2 index 86e89491..65ae5b06 100644 --- a/templates/glance-registry.conf.j2 +++ b/templates/glance-registry.conf.j2 @@ -19,8 +19,7 @@ enable_v1_registry = {{ glance_enable_v1_api | bool }} enable_v2_api = {{ glance_enable_v2_api | bool }} enable_v2_registry = {{ glance_enable_v2_registry | bool }} -transport_url = rabbit://{% for host in glance_rabbitmq_servers.split(',') %}{{ glance_rabbitmq_userid }}:{{ glance_rabbitmq_password }}@{{ host }}:{{ glance_rabbitmq_port }}{% if not loop.last %},{% else %}/{{ glance_rabbitmq_vhost }}{% endif %}{% endfor %} - +transport_url = {{ glance_oslomsg_rpc_transport }}://{% for host in glance_oslomsg_rpc_servers.split(',') %}{{ glance_oslomsg_rpc_userid }}:{{ glance_oslomsg_rpc_password }}@{{ host }}:{{ glance_oslomsg_rpc_port }}{% if not loop.last %},{% else %}/{{ glance_oslomsg_rpc_vhost }}{% if glance_oslomsg_rpc_use_ssl | bool %}?ssl=1{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} [database] connection = mysql+pymysql://{{ glance_galera_user }}:{{ glance_container_mysql_password }}@{{ glance_galera_address }}/{{ glance_galera_database }}?charset=utf8{% if glance_galera_use_ssl | bool %}&ssl_ca={{ glance_galera_ssl_ca_cert }}{% endif %} @@ -46,14 +45,13 @@ memcache_security_strategy = ENCRYPT memcache_secret_key = {{ memcached_encryption_key }} [oslo_messaging_rabbit] -ssl = {{ glance_rabbitmq_use_ssl }} rabbit_notification_exchange = glance rabbit_notification_topic = notifications {% if glance_ceilometer_enabled %} [oslo_messaging_notifications] driver = messagingv2 -transport_url = rabbit://{% for host in glance_rabbitmq_telemetry_servers.split(',') %}{{ glance_rabbitmq_telemetry_userid }}:{{ glance_rabbitmq_telemetry_password }}@{{ host }}:{{ glance_rabbitmq_telemetry_port }}{% if not loop.last %},{% else %}/{{ glance_rabbitmq_telemetry_vhost }}{% endif %}{% endfor %} +transport_url = {{ glance_oslomsg_notify_transport }}://{% for host in glance_oslomsg_notify_servers.split(',') %}{{ glance_oslomsg_notify_userid }}:{{ glance_oslomsg_notify_password }}@{{ host }}:{{ glance_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ glance_oslomsg_notify_vhost }}{% if glance_oslomsg_notify_use_ssl | bool %}?ssl=1{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} {% endif %} [oslo_policy] diff --git a/tests/inventory b/tests/inventory index 857bb886..a5950d2e 100644 --- a/tests/inventory +++ b/tests/inventory @@ -7,6 +7,12 @@ openstack1 infra1 openstack1 +[oslomsg_rpc_all] +infra1 + +[oslomsg_notify_all] +infra1 + [rabbitmq_all] infra1