From d833b3d2ee44c0da55a3aa57b989e5b34ae51699 Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Mon, 7 Dec 2020 14:09:34 +0100 Subject: [PATCH] Fix connectivity between multinode devstack jobs To have connectivity through public network to the vms which are on various nodes in the ci job, we need to configure special bridge called "br-infra" and connect this bridge with br-ex with patch ports. This can be done using "multi-node-bridge" role from zuul roles and "multi-node-setup" added to this repository. Change-Id: I80d7d2bed8291ba21ddc68b48fef5d0aac996b39 --- .pre-commit-config.yaml | 2 +- playbooks/multinode-setup.yaml | 3 +++ roles/multi-node-setup/README.rst | 23 ++++++++++++++++ roles/multi-node-setup/defaults/main.yaml | 4 +++ roles/multi-node-setup/tasks/main.yaml | 32 +++++++++++++++++++++++ zuul.d/jobs.yaml | 1 + 6 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 playbooks/multinode-setup.yaml create mode 100644 roles/multi-node-setup/README.rst create mode 100644 roles/multi-node-setup/defaults/main.yaml create mode 100644 roles/multi-node-setup/tasks/main.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4732ebf..0ac2cae 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.3.0 + rev: v3.4.0 hooks: - id: check-added-large-files - id: check-byte-order-marker diff --git a/playbooks/multinode-setup.yaml b/playbooks/multinode-setup.yaml new file mode 100644 index 0000000..8afd8a5 --- /dev/null +++ b/playbooks/multinode-setup.yaml @@ -0,0 +1,3 @@ +- hosts: all + roles: + - multi-node-setup diff --git a/roles/multi-node-setup/README.rst b/roles/multi-node-setup/README.rst new file mode 100644 index 0000000..3580d3f --- /dev/null +++ b/roles/multi-node-setup/README.rst @@ -0,0 +1,23 @@ +Set up connection between infra bridge and Neutron external bridge + +Network topology used in CI multinode jobs is described In `Devstack documention +`_ + +In case when DVR is used, there is also additional bridge ``br-infra`` added +on each node to provide connectivity to floating IPs from main node. + +This bridge needs to be connected with bridge used by Neutron as +external bridge. Typically it is ``br-ex`` and this role adds patch ports +between those bridges. + +**Role Variables** + +.. zuul:rolevar:: neutron_external_bridge_name + :default: br-ex + + Name of the Neutron external bridge. + +.. zuul:rolevar:: infra_bridge_name + :default: br-infra + + Name of the infra bridge. diff --git a/roles/multi-node-setup/defaults/main.yaml b/roles/multi-node-setup/defaults/main.yaml new file mode 100644 index 0000000..bba1866 --- /dev/null +++ b/roles/multi-node-setup/defaults/main.yaml @@ -0,0 +1,4 @@ +--- + +infra_bridge_name: br-infra +neutron_external_bridge_name: br-ex diff --git a/roles/multi-node-setup/tasks/main.yaml b/roles/multi-node-setup/tasks/main.yaml new file mode 100644 index 0000000..f4de2af --- /dev/null +++ b/roles/multi-node-setup/tasks/main.yaml @@ -0,0 +1,32 @@ +--- + +- name: Configure Neutron bridge for multi node setup + when: "( ansible_play_hosts | length ) > 1" + block: + + - name: Ensure the infra bridge exists + become: true + openvswitch_bridge: + bridge: "{{ infra_bridge_name }}" + state: present + fail_mode: standalone + + - name: Ensure the Neutron external bridge exists + become: true + openvswitch_bridge: + bridge: "{{ neutron_external_bridge_name }}" + state: present + fail_mode: standalone + + - name: Create patch port between bridges + become: true + command: >- + ovs-vsctl + --may-exist add-port {{ infra_bridge_name }} + patch-{{ neutron_external_bridge_name }} -- + set interface patch-{{ neutron_external_bridge_name }} + type=patch options:peer=patch-{{ infra_bridge_name }} -- + --may-exist add-port {{ neutron_external_bridge_name }} + patch-{{ infra_bridge_name }} -- + set interface patch-{{ infra_bridge_name }} + type=patch options:peer=patch-{{ neutron_external_bridge_name }} diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 2d843fe..2f0c86b 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -228,6 +228,7 @@ abstract: true description: Base DevStack Tobiko job with multinode. timeout: 10800 + pre-run: playbooks/multinode-setup.yaml vars: topology: multinode devstack_localrc: