From af90cef667423b0d3474cc2b89955e45bfead5b4 Mon Sep 17 00:00:00 2001 From: Lukas Bezdicka Date: Wed, 18 Nov 2020 10:15:53 +0100 Subject: [PATCH] [train-only][ffwd] Dont reuse tripleo_step4 for hybrid state Due to changes in paunch in Queens we had to separate out the config of hybrid state containers. We run them up separately but we were reusing the tripleo_step4 config id. By creating separate config id for each hybrid container. But this requires us to remove the running container in different config. Change-Id: I31581f176bb4f056309f127608451caec0202a68 --- .../neutron-sriov-agent-container-puppet.yaml | 9 +++++++-- deployment/nova/nova-compute-container-puppet.yaml | 9 +++++++-- deployment/ovn/ovn-controller-container-puppet.yaml | 13 +++++++++---- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/deployment/neutron/neutron-sriov-agent-container-puppet.yaml b/deployment/neutron/neutron-sriov-agent-container-puppet.yaml index cdc08254ad..a7654bc2f0 100644 --- a/deployment/neutron/neutron-sriov-agent-container-puppet.yaml +++ b/deployment/neutron/neutron-sriov-agent-container-puppet.yaml @@ -290,9 +290,14 @@ outputs: service: name: docker state: restarted + - name: Remove neutron_sriov_agent container before applying new paunch config + docker_container: + name: neutron_sriov_agent + state: absent # Finally apply the paunch config to start the new nova_compute - - name: Apply paunch config - shell: paunch apply --file /var/lib/tripleo-config/docker-container-hybrid_neutron_sriov.json --config-id tripleo_step4 + - name: Apply paunch config for neutron_sriov + shell: | + paunch apply --file /var/lib/tripleo-config/docker-container-hybrid_neutron_sriov.json --config-id hybrid_neutron_sriov - name: upgrade prepare for leapp to remove extra sriov vfs tags: diff --git a/deployment/nova/nova-compute-container-puppet.yaml b/deployment/nova/nova-compute-container-puppet.yaml index 21c6ed90d4..f8ed780323 100644 --- a/deployment/nova/nova-compute-container-puppet.yaml +++ b/deployment/nova/nova-compute-container-puppet.yaml @@ -1213,9 +1213,14 @@ outputs: service: name: docker state: restarted + - name: Remove nova_compute container before applying new paunch config + docker_container: + name: nova_compute + state: absent # Finally apply the paunch config to start the new nova_compute - - name: Apply paunch config - shell: paunch apply --file /var/lib/tripleo-config/docker-container-hybrid_nova_compute.json --config-id tripleo_step4 + - name: Apply paunch config for nova_compute + shell: | + paunch apply --file /var/lib/tripleo-config/docker-container-hybrid_nova_compute.json --config-id hybrid_nova_compute - name: Remove openstack-nova-compute and python-nova package during upgrade package: name: diff --git a/deployment/ovn/ovn-controller-container-puppet.yaml b/deployment/ovn/ovn-controller-container-puppet.yaml index 386d3282b5..ca3b86b90d 100644 --- a/deployment/ovn/ovn-controller-container-puppet.yaml +++ b/deployment/ovn/ovn-controller-container-puppet.yaml @@ -333,8 +333,8 @@ outputs: - name: Update the ovn_controller paunch image in config shell: | set -o pipefail - jq '.ovn_controller.image = "{{ ovn_controller_image }}" |\ - .ovn_controller.volumes += ["/var/lib/openvswitch/ovn:/run/ovn:shared", "/var/log/containers/openvswitch:/var/log/ovn"] |\ + jq '.ovn_controller.image = "{{ ovn_controller_image }}" | + .ovn_controller.volumes += ["/var/lib/openvswitch/ovn:/run/ovn:shared", "/var/log/containers/openvswitch:/var/log/ovn"] | {"ovn_controller": .ovn_controller }' \ /var/lib/tripleo-config/docker-container-startup-config-step_4.json >\ /var/lib/tripleo-config/docker-container-hybrid_ovn_controller.json @@ -363,8 +363,6 @@ outputs: RUNNING="$( docker ps --format '{{ '{{' }}.Names{{ '}}' }}' )" # Restart docker systemctl restart docker - # Apply the paunch so if we start even more stuff we start it before shutting down - paunch apply --file /var/lib/tripleo-config/docker-container-hybrid_ovn_controller.json --config-id tripleo_step4 # Compare running containers now vs before TO_STOP="$(grep -v -f <(echo "${RUNNING}") <(docker ps --format '{{ '{{' }}.Names{{ '}}' }}'))" # Check if we need to stop anything and stop it @@ -373,6 +371,13 @@ outputs: fi args: executable: /usr/bin/bash + - name: Remove ovn_controller container before applying new paunch config + docker_container: + name: ovn_controller + state: absent + - name: Apply paunch config if insecure registries are empty + shell: | + paunch apply --file /var/lib/tripleo-config/docker-container-hybrid_ovn_controller.json --config-id hybrid_ovn_controller - name: Get ovn remote setting shell: | ovs-vsctl get open . external_ids:ovn-remote