From cf70bf23a5472027b4866bba5f17b6acb0e92b1b Mon Sep 17 00:00:00 2001 From: Jeffrey Zhang Date: Mon, 8 Oct 2018 11:27:38 +0800 Subject: [PATCH] Configure coordination in default for cinder when redis is enabled Coordination is required for active-active cinder volume. Change-Id: I9b26831fd951a24c483840a55824fae06ccbbf81 Closes-Bug: #1796615 --- ansible/roles/cinder/templates/cinder.conf.j2 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ansible/roles/cinder/templates/cinder.conf.j2 b/ansible/roles/cinder/templates/cinder.conf.j2 index 3f91806dc4..99769247ca 100644 --- a/ansible/roles/cinder/templates/cinder.conf.j2 +++ b/ansible/roles/cinder/templates/cinder.conf.j2 @@ -212,3 +212,11 @@ connection_string = {{ osprofiler_backend_connection_string }} [barbican] auth_endpoint = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_public_port }} {% endif %} + +[coordination] +{% if enable_redis | bool %} +backend_url = redis://{% for host in groups['redis'] %}{% if host == groups['redis'][0] %}admin:{{ redis_master_password }}@{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ redis_sentinel_port }}?sentinel=kolla{% else %}&sentinel_fallback={{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ redis_sentinel_port }}{% endif %}{% endfor %}&socket_timeout=60&retry_on_timeout=yes +{% elif enable_etcd | bool %} +# NOTE(jeffrey4l): python-etcd3 module do not support multi endpoint here. +backend_url = etcd3://{{ hostvars[groups['etcd'][0]]['ansible_' + hostvars[groups['etcd'][0]]['api_interface']]['ipv4']['address'] }}:{{ etcd_client_port }} +{% endif %}