Skip to content

Commit dc79ad0

Browse files
fultonjopenshift-merge-bot[bot]
authored andcommitted
Remove unused glance backends in ci_dcn_site role
The enabled_backends for Glance were wrong. Simplify the jinja to define them by basing their logic on a new `ci_dcn_site_glance_map` fact which maps backend names to a list of enabled backned names such that: - The map for az0 contains all AZ backends - The map for AZs other than az0 contains backends for az0 and itself Two new Ansible tasks named after the above define the new map. In the case of three AZs it looks like this: map: az0: ['az0', 'az1', 'az2'] az1: ['az0', 'az1'] az2: ['az0', 'az2'] Also, remove the customServiceConfig from the Glance template since it's different for each Glance API pod and rename the default backend to 'az0' by setting the `keystoneEndpoint`. Also, as recommended by glance team, set replica count for glance pods of type edge to 1 instead of 3. Signed-off-by: John Fulton <[email protected]>
1 parent 6f73675 commit dc79ad0

File tree

4 files changed

+24
-41
lines changed

4 files changed

+24
-41
lines changed

roles/ci_dcn_site/tasks/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- name: Initialize vars
1818
ansible.builtin.set_fact:
1919
_ceph_vars_list: []
20+
_all_azs: []
2021

2122
- name: Set Network related facts
2223
ansible.builtin.include_tasks: set_network_facts.yml

roles/ci_dcn_site/tasks/post-ceph.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,21 @@
3939
ansible.builtin.set_fact:
4040
_ceph_vars_list: "{{ _ceph_vars_list | union([item.ansible_facts]) }}"
4141

42+
- name: Define _all_azs list for all Ceph backends
43+
loop: "{{ _ceph_vars_list }}"
44+
ansible.builtin.set_fact:
45+
_all_azs: "{{ _all_azs | default([]) + [ item.cifmw_ceph_client_cluster ] }}"
46+
47+
- name: The map for az0 contains all AZ backends
48+
ansible.builtin.set_fact:
49+
ci_dcn_site_glance_map: "{{ { 'az0': _all_azs } }}"
50+
51+
- name: The map for AZs other than az0 contains backends for az0 and itself
52+
loop: "{{ _all_azs }}"
53+
when: item != "az0"
54+
ansible.builtin.set_fact:
55+
ci_dcn_site_glance_map: "{{ ci_dcn_site_glance_map | combine( { item: ['az0', item ] } ) }}"
56+
4257
- name: Render the post-ceph service-values.yaml
4358
ansible.builtin.template:
4459
mode: "0644"

roles/ci_dcn_site/templates/service-values.yaml.j2

Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ data:
2626
customServiceConfig: |
2727
[DEFAULT]
2828
enabled_backends = ceph
29-
{% if 'az0' not in _ceph.cifmw_ceph_client_cluster %}
3029
glance_api_servers = https://glance-{{ _ceph.cifmw_ceph_client_cluster }}-internal.openstack.svc:9292
31-
{% endif %}
3230
[ceph]
3331
volume_backend_name = ceph
3432
volume_driver = cinder.volume.drivers.rbd.RBDDriver
@@ -41,51 +39,23 @@ data:
4139
backend_availability_zone = {{ _ceph.cifmw_ceph_client_cluster }}
4240
{% endfor %}
4341
glance:
44-
customServiceConfig: |
45-
[DEFAULT]
46-
enabled_backends = default_backend:rbd
47-
[glance_store]
48-
default_backend = default_backend
49-
[default_backend]
50-
rbd_store_ceph_conf = /etc/ceph/az0.conf
51-
store_description = "RBD backend"
52-
rbd_store_pool = images
53-
rbd_store_user = openstack
54-
rbd_thin_provisioning = True
42+
keystoneEndpoint: az0
5543
glanceAPIs:
56-
{% set backends = [] %}
5744
{% for _ceph in _ceph_vars_list %}
58-
{% if _ceph.cifmw_ceph_client_cluster not in backends %}
59-
{% set _ = backends.append(_ceph.cifmw_ceph_client_cluster + ':rbd') %}
60-
{% endif %}
61-
{% endfor %}
62-
{% for _ceph in _ceph_vars_list %}
63-
{% if 'az0' in _ceph.cifmw_ceph_client_cluster %}
64-
default:
65-
{% else %}
6645
{{ _ceph.cifmw_ceph_client_cluster }}:
67-
{% endif %}
6846
customServiceConfig: |
6947
[DEFAULT]
7048
enabled_import_methods = [web-download,copy-image,glance-direct]
71-
enabled_backends = {{ backends | join(',') }}
49+
enabled_backends = {{ ci_dcn_site_glance_map[_ceph.cifmw_ceph_client_cluster] | join(':rbd,') + ':rbd'}}
7250
[glance_store]
7351
default_backend = {{ _ceph.cifmw_ceph_client_cluster }}
74-
[{{ _ceph.cifmw_ceph_client_cluster }}]
75-
rbd_store_ceph_conf = /etc/ceph/{{ _ceph.cifmw_ceph_client_cluster }}.conf
76-
store_description = "{{ _ceph.cifmw_ceph_client_cluster }} RBD backend"
77-
rbd_store_pool = images
78-
rbd_store_user = openstack
79-
rbd_thin_provisioning = True
80-
{% for _ceph_az in _ceph_vars_list %}
81-
{% if _ceph_az.cifmw_ceph_client_cluster != _ceph.cifmw_ceph_client_cluster %}
82-
[{{ _ceph_az.cifmw_ceph_client_cluster }}]
83-
rbd_store_ceph_conf = /etc/ceph/{{ _ceph_az.cifmw_ceph_client_cluster }}.conf
84-
store_description = "{{ _ceph_az.cifmw_ceph_client_cluster }} RBD backend"
52+
{% for _ceph_az in ci_dcn_site_glance_map[_ceph.cifmw_ceph_client_cluster] %}
53+
[{{ _ceph_az }}]
54+
rbd_store_ceph_conf = /etc/ceph/{{ _ceph_az }}.conf
55+
store_description = "{{ _ceph_az }} RBD backend"
8556
rbd_store_pool = images
8657
rbd_store_user = openstack
8758
rbd_thin_provisioning = True
88-
{% endif %}
8959
{% endfor %}
9060
networkAttachments:
9161
- storage
@@ -99,10 +69,11 @@ data:
9969
metallb.universe.tf/loadBalancerIPs: 172.17.0.8{{ loop.index0 }}
10070
spec:
10171
type: LoadBalancer
102-
replicas: 3
10372
{% if _ceph.cifmw_ceph_client_cluster == 'az0' %}
73+
replicas: 3
10474
type: split
10575
{% else %}
76+
replicas: 1
10677
type: edge
10778
{% endif %}
10879
{% endfor %}

roles/ci_dcn_site/templates/values.yaml.j2

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@ data:
3939
rbd_user=openstack
4040
rbd_secret_uuid={{ cifmw_ceph_client_fsid }}
4141
[glance]
42-
{% if 'az0' in cifmw_ceph_client_cluster %}
43-
endpoint_override = https://glance-default-internal.openstack.svc:9292
44-
{% else %}
4542
endpoint_override = https://glance-{{ _az }}-internal.openstack.svc:9292
46-
{% endif %}
4743
valid_interfaces = internal
4844
[cinder]
4945
cross_az_attach = False

0 commit comments

Comments
 (0)