Merge "Allow OVS bridges to connect directly to interface"

This commit is contained in:
Zuul 2020-05-18 11:23:22 +00:00 committed by Gerrit Code Review
commit 62665da88b
3 changed files with 29 additions and 13 deletions

View File

@ -71,7 +71,7 @@
- name: Initialise facts containing the network host interfaces - name: Initialise facts containing the network host interfaces
set_fact: set_fact:
# Initialise the following lists. # Initialise the following lists.
kolla_neutron_bridge_interfaces: [] kolla_neutron_interfaces: []
kolla_neutron_bridge_names: [] kolla_neutron_bridge_names: []
kolla_neutron_external_interfaces: [] kolla_neutron_external_interfaces: []
@ -79,24 +79,29 @@
# bridge interface rather than the untagged interface. We therefore # bridge interface rather than the untagged interface. We therefore
# strip the .<vlan> suffix of the interface name. We use a union here # strip the .<vlan> suffix of the interface name. We use a union here
# as a single tagged interface may be shared between these networks. # as a single tagged interface may be shared between these networks.
- name: Set a fact containing the bridges to be patched to the Neutron OVS bridges - name: Set a fact containing the interfaces to be plugged to the Neutron OVS bridges
set_fact: set_fact:
kolla_neutron_bridge_interfaces: > kolla_neutron_interfaces: >
{{ kolla_neutron_bridge_interfaces | {{ kolla_neutron_interfaces |
union([item | net_interface | replace('.' ~ item | net_vlan | default('!nomatch!'), '')]) | union([item | net_interface | replace('.' ~ item | net_vlan | default('!nomatch!'), '')]) |
list }} list }}
with_items: "{{ [provision_wl_net_name, cleaning_net_name] + external_net_names | unique | list }}" with_items: "{{ [provision_wl_net_name, cleaning_net_name] + external_net_names | unique | list }}"
when: item in network_interfaces when: item in network_interfaces
- name: Set facts containing the Neutron bridge and interface names - name: Set facts containing the Neutron bridge and interface names
vars:
is_bridge: "{{ item in (network_interfaces | net_select_bridges | map('net_interface')) }}"
# For a bridge, use a veth pair connected to the bridge. Otherwise use
# the interface directly.
external_interface: "{{ (network_patch_prefix ~ item ~ network_patch_suffix_ovs) if is_bridge else item }}"
set_fact: set_fact:
kolla_neutron_bridge_names: > kolla_neutron_bridge_names: >
{{ kolla_neutron_bridge_names + {{ kolla_neutron_bridge_names +
[item ~ network_bridge_suffix_ovs] }} [item ~ network_bridge_suffix_ovs] }}
kolla_neutron_external_interfaces: > kolla_neutron_external_interfaces: >
{{ kolla_neutron_external_interfaces + {{ kolla_neutron_external_interfaces +
[network_patch_prefix ~ item ~ network_patch_suffix_ovs] }} [external_interface] }}
with_items: "{{ kolla_neutron_bridge_interfaces }}" with_items: "{{ kolla_neutron_interfaces }}"
- name: Validate overcloud host Kolla Ansible network configuration - name: Validate overcloud host Kolla Ansible network configuration
fail: fail:

View File

@ -76,26 +76,28 @@
- config - config
- network - network
vars: vars:
veth_bridge_mtu_map: {} veth_mtu_map: {}
veth_interfaces: [] veth_interfaces: []
pre_tasks: pre_tasks:
# When these networks are VLANs, we need to use the underlying tagged # When these networks are VLANs, we need to use the underlying tagged
# bridge interface rather than the untagged interface. We therefore strip # interface rather than the untagged interface. We therefore strip
# the .<vlan> suffix of the interface name. We use a union here as a single # the .<vlan> suffix of the interface name. We use a union here as a single
# tagged interface may be shared between these networks. # tagged interface may be shared between these networks.
- name: Update a fact containing bridges to be patched to the Neutron OVS bridge - name: Update a fact containing bridges to be patched to the Neutron OVS bridge
set_fact: set_fact:
veth_bridge_mtu_map: > veth_mtu_map: >
{{ veth_bridge_mtu_map | combine({interface: mtu}) }} {{ veth_mtu_map | combine({interface: mtu}) }}
with_items: "{{ [provision_wl_net_name, cleaning_net_name] + external_net_names | unique | list }}" with_items: "{{ [provision_wl_net_name, cleaning_net_name] + external_net_names | unique | list }}"
when: item in network_interfaces when:
- item in network_interfaces
- item | net_is_bridge
vars: vars:
interface: "{{ item | net_interface | replace('.' ~ item | net_vlan | default('!nomatch!'), '') }}" interface: "{{ item | net_interface | replace('.' ~ item | net_vlan | default('!nomatch!'), '') }}"
# Determine the MTU as the maximum of all subinterface MTUs. Only # Determine the MTU as the maximum of all subinterface MTUs. Only
# interfaces with an explicit MTU set will be taken account of. If no # interfaces with an explicit MTU set will be taken account of. If no
# interface has an explicit MTU set, then the corresponding veth will # interface has an explicit MTU set, then the corresponding veth will
# not either. # not either.
mtu_list: "{{ [veth_bridge_mtu_map.get(interface), item | net_mtu] | select | map('int') | list }}" mtu_list: "{{ [veth_mtu_map.get(interface), item | net_mtu] | select | map('int') | list }}"
mtu: "{{ mtu_list | max if mtu_list | length > 0 else None }}" mtu: "{{ mtu_list | max if mtu_list | length > 0 else None }}"
- name: Update a fact containing veth interfaces - name: Update a fact containing veth interfaces
@ -110,6 +112,6 @@
'peer_bootproto': 'static', 'peer_bootproto': 'static',
'peer_mtu': item.value, 'peer_mtu': item.value,
'onboot': 'yes'}] }} 'onboot': 'yes'}] }}
with_dict: "{{ veth_bridge_mtu_map }}" with_dict: "{{ veth_mtu_map }}"
roles: roles:
- role: veth - role: veth

View File

@ -0,0 +1,9 @@
---
features:
- |
Adds support for plugging the Open vSwitch provider bridge directly into a
an Ethernet interface. Previously it was necessary to define a Linux
bridge, into which Kayobe would plug a virtual Ethernet pair. The use of a
direct connection may provide improved performance, or allow additional
hardware offloading. See `story 2007364
<https://storyboard.openstack.org/#!/story/2007364>`_ for details.