Use kolla_internal_vip_address for glance_api servers

Nova and Cinder used a list of glance api servers - this list
does not provide a proper high availability because the servers
are connected at random without recalling who is failed last
time. E.g. out of three controllers with a failed first one nova
and cinder can try connection to the first controller because of
random / shuffled choice of the glance server. A proper solution
is to use VIP that connects to alive server from the beginning.
Also as workaround one could significantly increase max number
of retries in configuration files in hope that a random function
will choose a healthy glance server sometime - not a good choice.

Change-Id: Ifaf8ffe3697ec88a6da4c2b43c83975b63dc2e8c
Closes-Bug: #1643509
This commit is contained in:
Vladislav Belogrudov 2016-11-21 13:55:23 +03:00
parent 62c1b4f89c
commit ac3e4cf9c9
2 changed files with 2 additions and 2 deletions
ansible/roles
cinder/templates
nova/templates

@ -12,7 +12,7 @@ enable_v1_api=false
osapi_volume_workers = {{ openstack_service_workers }}
volume_name_template = volume-%s
glance_api_servers = {% for host in groups['glance-api'] %}{{ internal_protocol }}://{% if orchestration_engine == 'KUBERNETES' %}glance-api{% else %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}{% endif %}:{{ glance_api_port }}{% if not loop.last %},{% endif %}{% endfor %}
glance_api_servers = {{ internal_protocol }}://{% if orchestration_engine == 'KUBERNETES' %}glance-api{% else %}{{ kolla_internal_vip_address }}{% endif %}:{{ glance_api_port }}
glance_num_retries = {{ groups['glance-api'] | length }}
glance_api_version = 2

@ -106,7 +106,7 @@ api_endpoint = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ ironic_api
lock_path = /var/lib/nova/tmp
[glance]
api_servers = {% for host in groups['glance-api'] %}{{ internal_protocol }}://{% if orchestration_engine == 'KUBERNETES' %}glance-api{% else %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}{% endif %}:{{ glance_api_port }}{% if not loop.last %},{% endif %}{% endfor %}
api_servers = {{ internal_protocol }}://{% if orchestration_engine == 'KUBERNETES' %}glance-api{% else %}{{ kolla_internal_vip_address }}{% endif %}:{{ glance_api_port }}
num_retries = {{ groups['glance-api'] | length }}