From 0766df1673da0cc8c3a3d3d03e357ec5836e2d94 Mon Sep 17 00:00:00 2001
From: Mark Goddard <mark@stackhpc.com>
Date: Tue, 24 Nov 2020 10:35:00 +0000
Subject: [PATCH] CI: add dummy1 port for seed upgrade and VM jobs

For some reason this configuration was omitted or incomplete in these
jobs. Without this configuration, Kayobe development configuration adds
eth1 to the breth1 bridge if it exists, or leaves the bridge without a
port otherwise. This can lead to network connectivity issues, if the IP
address of eth1 becomes inaccessible when it is added to breth1.

This change fixes the issue by ensuring that the dummy1 interface
exists, and configuring the aio network to add it to breth1 as a port,
instead of eth1.

Change-Id: I47115e5d8d1fb448cb9e46dc43b56c64987e428b
---
 playbooks/kayobe-seed-upgrade-base/overrides.yml.j2 | 8 ++++++++
 playbooks/kayobe-seed-upgrade-base/pre.yml          | 8 ++++++++
 playbooks/kayobe-seed-vm-base/overrides.yml.j2      | 7 +++++++
 3 files changed, 23 insertions(+)

diff --git a/playbooks/kayobe-seed-upgrade-base/overrides.yml.j2 b/playbooks/kayobe-seed-upgrade-base/overrides.yml.j2
index f501782c..c88b5480 100644
--- a/playbooks/kayobe-seed-upgrade-base/overrides.yml.j2
+++ b/playbooks/kayobe-seed-upgrade-base/overrides.yml.j2
@@ -14,6 +14,7 @@ kolla_ansible_source_url: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org
 kolla_ansible_source_version: "{{ zuul.projects['opendev.org/openstack/kolla-ansible'].checkout }}"
 pip_upper_constraints_file: "/tmp/upper-constraints.txt"
 {% endif %}
+kolla_openstack_logging_debug: True
 
 # NOTE(mgoddard): We're using a cirros image, which doesn't require the
 # resolv.conf work around used for CentOS.
@@ -22,3 +23,10 @@ overcloud_host_image_workaround_resolv_enabled: false
 # Use the CI infra's PyPI mirror.
 pip_local_mirror: true
 pip_index_url: "http://{{ zuul_site_mirror_fqdn }}/pypi/simple"
+
+# NOTE(mgoddard): CentOS 8 removes interfaces from their bridge during ifdown,
+# and removes the bridge if there are no interfaces left. When Kayobe bounces
+# veth links plugged into the bridge, it causes the bridge which has the IP we
+# are using for SSH to be removed. Use a dummy interface.
+aio_bridge_ports:
+  - dummy1
diff --git a/playbooks/kayobe-seed-upgrade-base/pre.yml b/playbooks/kayobe-seed-upgrade-base/pre.yml
index c38f7beb..3d7c5af8 100644
--- a/playbooks/kayobe-seed-upgrade-base/pre.yml
+++ b/playbooks/kayobe-seed-upgrade-base/pre.yml
@@ -29,3 +29,11 @@
         - "ip l add breth1 type bridge"
         - "ip l set breth1 up"
         - "ip a add 192.168.33.5/24 dev breth1"
+        # NOTE(mgoddard): CentOS 8 removes interfaces from their bridge during
+        # ifdown, and removes the bridge if there are no interfaces left. When
+        # Kayobe bounces veth links plugged into the bridge, it causes the
+        # bridge which has the IP we are using for SSH to be removed. Use a
+        # dummy interface.
+        - "ip l add dummy1 type dummy"
+        - "ip l set dummy1 up"
+        - "ip l set dummy1 master breth1"
diff --git a/playbooks/kayobe-seed-vm-base/overrides.yml.j2 b/playbooks/kayobe-seed-vm-base/overrides.yml.j2
index 22061d14..cb759401 100644
--- a/playbooks/kayobe-seed-vm-base/overrides.yml.j2
+++ b/playbooks/kayobe-seed-vm-base/overrides.yml.j2
@@ -42,3 +42,10 @@ seed_vm_configdrive_device: disk
 # /etc/network/interfaces.
 configdrive_os_family: Debian
 configdrive_debian_network_interfaces_supports_glob: false
+
+# NOTE(mgoddard): CentOS 8 removes interfaces from their bridge during ifdown,
+# and removes the bridge if there are no interfaces left. When Kayobe bounces
+# veth links plugged into the bridge, it causes the bridge which has the IP we
+# are using for SSH to be removed. Use a dummy interface.
+aio_bridge_ports:
+  - dummy1
-- 
GitLab