[train-only] Ensure we stop ovn-controller with cleanup

Turns out that gracefull shutdown of container running ovn_controller
does not disable routing to it. This means that after Leapp when the
node is clean we still try to send traffic to it and this causes
outage. By calling ovs-appctl -t ovn-controller exit we ensure that
ovn cleans up BFD interfaces from the node. For this to work we need
to disable docker autorestart of the container.

Change-Id: I9ec73e3d94884c339ea5e21817c24cf5e758f242
This commit is contained in:
Lukas Bezdicka 2021-02-02 12:34:19 +01:00 committed by Jesse Pretorius
parent ae6cbe611e
commit 988d5dc892
1 changed files with 22 additions and 0 deletions

View File

@ -318,6 +318,28 @@ outputs:
persistent: yes
state: yes
upgrade_tasks:
# system_upgrade
- name: ovn_controller system_upgrade_prepare step 1
tags:
- never
- system_upgrade
- system_upgrade_prepare
when:
- step|int == 1
block:
- name: Check ovn_controller is running in docker
shell: |
docker ps | grep ovn_controller
register: ovn_controller_running
failed_when: false
- name: Disable autorestart on ovn_controller container
command: docker update --restart=no ovn_controller
when: ovn_controller_running.rc == 0
- name: Tell ovn_controller to clean up and stop
shell: |
docker exec -u root ovn_controller bash -c "if [ -f /usr/bin/ovn-appctl ] ; then ovn-appctl -t ovn-controller exit ; else ovs-appctl -t ovn-controller exit ; fi"
when: ovn_controller_running.rc == 0
# nova_hybrid_state
- name: Gather missing facts
setup:
gather_subset: "distribution"