From 1a57af20e848095821193166efd747267470e7c7 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Mon, 17 Aug 2020 18:27:44 +0300 Subject: [PATCH] Fix neutron-server default serial By default we should prevent all neutron server going down at the same time Instead we should apply approach where we upgrade single neutron server and the rest of hosts next time to decrease API downtime Additionally changed default for neutron_other_serial, to safe 1 as in case of big amount of network nodes, several l3 agents may went down at the same time, and make ha router unavaliable. Change-Id: I618ea5083da29e7188c093c96f40ca3db6f9e5cc --- playbooks/common-playbooks/neutron.yml | 24 ++++++++++++++++++++++++ playbooks/os-neutron-install.yml | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/playbooks/common-playbooks/neutron.yml b/playbooks/common-playbooks/neutron.yml index 204abdb2af..8782aec735 100644 --- a/playbooks/common-playbooks/neutron.yml +++ b/playbooks/common-playbooks/neutron.yml @@ -32,6 +32,18 @@ - neutron pre_tasks: + # In order to ensure that any container, software or + # config file changes which causes a container/service + # restart do not cause an unexpected outage, we drain + # the load balancer back end for this container. + - include_tasks: ../common-tasks/haproxy-endpoint-manage.yml + vars: + haproxy_backend: neutron_server-back + haproxy_state: disabled + when: + - "'neutron_server' in group_names" + - "groups['neutron_server'] | length > 1" + - name: Determine tunnel bridge IP address include_tasks: ../common-tasks/dynamic-address-fact.yml vars: @@ -95,3 +107,15 @@ - role: "system_crontab_coordination" tags: - crontab + + post_tasks: + # Now that container changes are done, we can set + # the load balancer back end for this container + # to available again. + - include_tasks: ../common-tasks/haproxy-endpoint-manage.yml + vars: + haproxy_backend: neutron_server-back + haproxy_state: enabled + when: + - "'neutron_server' in group_names" + - "groups['neutron_server'] | length > 1" diff --git a/playbooks/os-neutron-install.yml b/playbooks/os-neutron-install.yml index 680a84b764..01779fe63d 100644 --- a/playbooks/os-neutron-install.yml +++ b/playbooks/os-neutron-install.yml @@ -31,7 +31,7 @@ include: common-playbooks/neutron.yml vars: neutron_hosts: "neutron_server" - neutron_serial: "{{ neutron_server_serial | default('100%') }}" + neutron_serial: "{{ neutron_server_serial | default(['1', '100%']) }}" @@ -47,4 +47,4 @@ include: common-playbooks/neutron.yml vars: neutron_hosts: "neutron_all:!neutron_linuxbridge_agent:!neutron_openvswitch_agent:!neutron_server" - neutron_serial: "{{ neutron_other_serial | default('20%') }}" + neutron_serial: "{{ neutron_other_serial | default('1') }}"