haproxy running configuration change openstack-ansible (ussuri)
Hi All I 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-connect I can see this configuration as part of group_vars of the source package* /opt/openstack-ansible <https://opendev.org/openstack/openstack-ansible/src/commit/6520d0bb2c689ed7caa5df581be6a966133cdce0>/inventory <https://opendev.org/openstack/openstack-ansible/src/commit/6520d0bb2c689ed7caa5df581be6a966133cdce0/inventory>/group_vars <https://opendev.org/openstack/openstack-ansible/src/commit/6520d0bb2c689ed7caa5df581be6a966133cdce0/inventory/group_vars>/haproxy <https://opendev.org/openstack/openstack-ansible/src/commit/6520d0bb2c689ed7caa5df581be6a966133cdce0/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: source* haproxy_balance_type: http haproxy_backend_options: Can you please let me know how to do so?
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/08d90900f01ec25f6... Some 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 All
I 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-connect
I can see this configuration as part of group_vars of the source package* /opt/openstack-ansible <https://opendev.org/openstack/openstack-ansible/src/commit/6520d0bb2c689ed7caa5df581be6a966133cdce0>/inventory <https://opendev.org/openstack/openstack-ansible/src/commit/6520d0bb2c689ed7caa5df581be6a966133cdce0/inventory>/group_vars <https://opendev.org/openstack/openstack-ansible/src/commit/6520d0bb2c689ed7caa5df581be6a966133cdce0/inventory/group_vars>/haproxy <https://opendev.org/openstack/openstack-ansible/src/commit/6520d0bb2c689ed7caa5df581be6a966133cdce0/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: source* haproxy_balance_type: http haproxy_backend_options:
Can you please let me know how to do so?
Hi Dmitriy Thanks 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 parameters* openstack-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? Regards Keshav On 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/08d90900f01ec25f6...
Some 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 All
I 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-connect
I can see this configuration as part of group_vars of the source package* /opt/openstack-ansible <https://opendev.org/openstack/openstack-ansible/src/commit/6520d0bb2c689ed7caa5df581be6a966133cdce0>/inventory <https://opendev.org/openstack/openstack-ansible/src/commit/6520d0bb2c689ed7caa5df581be6a966133cdce0/inventory>/group_vars <https://opendev.org/openstack/openstack-ansible/src/commit/6520d0bb2c689ed7caa5df581be6a966133cdce0/inventory/group_vars>/haproxy <https://opendev.org/openstack/openstack-ansible/src/commit/6520d0bb2c689ed7caa5df581be6a966133cdce0/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: source* haproxy_balance_type: http haproxy_backend_options:
Can you please let me know how to do so?
Yeah, copying the whole variable to /etc/openstack_deploy/group_vars/haproxy/haproxy_all.yml should do the trick. Eventually, any file inside /etc/openstack_deploy/group_vars/haproxy/ folder will be treated as a group_vars file for the group "haproxy", so you can name it to your taste:) Alternatively, you can also create smth like /etc/openstack_deploy/user_haproxy_services.yml which will have precedence over any host/group_vars and be loaded as extra-vars file. Regarding --tag 'haproxy-config' - frankly speaking I don;t know if tags work as expected on Ussuri or not - we had some hassle with them in previous releases and I don't recall if haproxy was even affected. If not - try running without tags. Yes, if `haproxy_balance_alg` is not defined, the default would be "leastconn" [1]. This part, actually, is still the same for master. If you think it would make sense to control the default balance algorithm of haproxy with some var (which sounds quite reasonable) - feel free to propose a patch to implement it. [1] https://opendev.org/openstack/openstack-ansible-haproxy_server/src/tag/ussur... сб, 10 февр. 2024 г. в 16:47, keshav bareja <keshav.bareja@gmail.com>:
Hi Dmitriy
Thanks 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 parameters*
openstack-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?
Regards Keshav
On 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/08d90900f01ec25f6...
Some 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 All
I 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-connect
I can see this configuration as part of group_vars of the source package* /opt/openstack-ansible <https://opendev.org/openstack/openstack-ansible/src/commit/6520d0bb2c689ed7caa5df581be6a966133cdce0>/inventory <https://opendev.org/openstack/openstack-ansible/src/commit/6520d0bb2c689ed7caa5df581be6a966133cdce0/inventory>/group_vars <https://opendev.org/openstack/openstack-ansible/src/commit/6520d0bb2c689ed7caa5df581be6a966133cdce0/inventory/group_vars>/haproxy <https://opendev.org/openstack/openstack-ansible/src/commit/6520d0bb2c689ed7caa5df581be6a966133cdce0/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: source* haproxy_balance_type: http haproxy_backend_options:
Can you please let me know how to do so?
participants (2)
-
Dmitriy Rabotyagov
-
keshav bareja