Hi DmitriyThanks for the prompt feedback.Do you think the below steps can help to change the value in the Ussuri release?Copy the whole variable haproxy_default_services from /opt/openstack-ansible/inventory/group_vars/haproxy/haproxy.yml to /etc/openstack_deploy/group_vars/haproxy/haproxy_all.yml and change haproxy_balance_alg from source to least-connect under the section for glance_api of this file.
and then run the playbook haproxy-install.yml with below parametersopenstack-ansible haproxy-install.yml --tag 'haproxy-config'Also, can you please confirm if there is no "haproxy_balance_alg" field mentioned under any service group var file, what is the default value of the balancing algorithm assigned to the service in the haproxy configuration. is it least-connect?Is there any configuration for this in the openstack-ansible configuration?RegardsKeshavOn Fri, Feb 9, 2024 at 9:53 PM Dmitriy Rabotyagov <noonedeadpunk@gmail.com> wrote:Hey,
I would highly discourage changing balancing algorithms for glance.
It has been set to source IP by design, since requests to create image and upload image data in some cases may end up in different backends, which will result in image upload failure.Additionally, I'm really not sure there is a good way of doing so on Ussuri release :( From what I see there all haproxy backends are represented with only 1 variable: haproxy_default_services
Since Victoria we have splitted this big variable into smaller service specific ones, which can be more or less nicely overriden.
So starting from Victoria there is a variable haproxy_glance_api_service which can be used for configuring glance only:
https://opendev.org/openstack/openstack-ansible/src/commit/08d90900f01ec25f624ea7bfb31b2a7a58fdb8db/inventory/group_vars/haproxy/haproxy.yml#L142Some more improvements came only in Antelope (2023.1), where the basic override method can be used to adjust only a specific value in such service variables.
On Fri, Feb 9, 2024, 22:00 keshav bareja <keshav.bareja@gmail.com> wrote:Hi AllI need to change haproxy configuration in the openstack-ussuri environment using openstack-ansible.for glance-api service I need to change backend load-balancing algorithm from source to least-connectI can see this configuration as part of group_vars of the source package /opt/openstack-ansible/inventory/group_vars/haproxy/haproxy.yml
-service:
haproxy_service_name: glance_api
haproxy_backend_nodes: "{{ groups['glance_api'] | default([]) }}"
haproxy_ssl: "{{ haproxy_ssl }}"
haproxy_port: 9292
haproxy_balance_alg: sourcehaproxy_balance_type: http
haproxy_backend_options:
Can you please let me know how to do so?