From 439aed8852ba54092d20d8c2dc1d5f1ebeaf012a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Piliszek?= Date: Tue, 13 Aug 2019 20:22:54 +0200 Subject: [PATCH] Allow cinder coordination backend to be configured MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is to allow operator to prevent enabling redis and/or etcd from magically configuring cinder coordinator. Note this change is backwards-compatible. Change-Id: Ie10be55968e43e3b9cc347b1b58771c1f7b1b910 Related-Bug: #1840070 Signed-off-by: Radosław Piliszek (cherry picked from commit 03b4c706fae54a381b78c0f516499bfac986fb26) --- ansible/group_vars/all.yml | 3 +++ ansible/roles/cinder/templates/cinder.conf.j2 | 4 ++-- etc/kolla/globals.yml | 2 ++ ...riable-cinder-coordination-backend-3426a4e1bd22cbbb.yaml | 6 ++++++ 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/new-variable-cinder-coordination-backend-3426a4e1bd22cbbb.yaml diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index e30a117106..b82503a107 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -815,6 +815,9 @@ cinder_volume_group: "cinder-volumes" cinder_iscsi_helper: "tgtadm" cinder_target_helper: "{{ cinder_iscsi_helper }}" +# Valid options are [ '', redis, etcd ] +cinder_coordination_backend: "{{ 'redis' if enable_redis|bool else 'etcd' if enable_etcd|bool else '' }}" + # Valid options are [ nfs, swift, ceph ] cinder_backup_driver: "ceph" cinder_backup_share: "" diff --git a/ansible/roles/cinder/templates/cinder.conf.j2 b/ansible/roles/cinder/templates/cinder.conf.j2 index 5b131c1027..f79145b017 100644 --- a/ansible/roles/cinder/templates/cinder.conf.j2 +++ b/ansible/roles/cinder/templates/cinder.conf.j2 @@ -220,9 +220,9 @@ auth_endpoint = {{ keystone_internal_url }} {% endif %} [coordination] -{% if enable_redis | bool %} +{% if cinder_coordination_backend == 'redis' %} backend_url = {{ redis_connection_string }} -{% elif enable_etcd | bool %} +{% elif cinder_coordination_backend == 'etcd' %} # 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 %} diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml index 41cc4c6198..c84cc51f8a 100644 --- a/etc/kolla/globals.yml +++ b/etc/kolla/globals.yml @@ -417,6 +417,8 @@ glance_enable_rolling_upgrade: "no" #cinder_backend_ceph: "{{ enable_ceph }}" #cinder_backend_vmwarevc_vmdk: "no" #cinder_volume_group: "cinder-volumes" +# Valid options are [ '', redis, etcd ] +#cinder_coordination_backend: "{{ 'redis' if enable_redis|bool else 'etcd' if enable_etcd|bool else '' }}" # Valid options are [ nfs, swift, ceph ] #cinder_backup_driver: "ceph" diff --git a/releasenotes/notes/new-variable-cinder-coordination-backend-3426a4e1bd22cbbb.yaml b/releasenotes/notes/new-variable-cinder-coordination-backend-3426a4e1bd22cbbb.yaml new file mode 100644 index 0000000000..b4053b48ea --- /dev/null +++ b/releasenotes/notes/new-variable-cinder-coordination-backend-3426a4e1bd22cbbb.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Cinder coordination backend can now be configured via + cinder_coordination_backend variable. + Coordination is optional and can now be set to either redis or etcd.