diff --git a/doc/source/reference/architecture/container-networking.rst b/doc/source/reference/architecture/container-networking.rst index 4be5485a73..848391cf47 100644 --- a/doc/source/reference/architecture/container-networking.rst +++ b/doc/source/reference/architecture/container-networking.rst @@ -26,20 +26,21 @@ the same multiport network card for the same bonded interface, because a network card failure affects both of the physical network interfaces used by the bond. -Linux bridges -~~~~~~~~~~~~~ +Linux bridges/switches +~~~~~~~~~~~~~~~~~~~~~~ The combination of containers and flexible deployment options requires -implementation of advanced Linux networking features, such as bridges and -namespaces. +implementation of advanced Linux networking features, such as bridges, +switches and namespaces. -* Bridges provide layer 2 connectivity (similar to switches) among +* Bridges/switches provide layer 2 connectivity (similar to switches) among physical, logical, and virtual network interfaces within a host. After - a bridge is created, the network interfaces are virtually plugged in to - it. + a bridge/switch is created, the network interfaces are virtually plugged + in to it. - OpenStack-Ansible uses bridges to connect physical and logical network - interfaces on the host to virtual network interfaces within containers. + OpenStack-Ansible can use linux bridges or openvswitches to connect + physical and logical network interfaces on the host to virtual network + interfaces within containers. * Namespaces provide logically separate layer 3 environments (similar to routers) within a host. Namespaces use virtual interfaces to connect diff --git a/etc/netplan/01-static.yml b/etc/netplan/01-static.yml index 22d169b1ed..6a27e2314f 100644 --- a/etc/netplan/01-static.yml +++ b/etc/netplan/01-static.yml @@ -48,6 +48,7 @@ network: interfaces: - bond0.20 mtu: 9000 + openvswitch: {} br-vxlan: addresses: - 172.29.240.10/22 diff --git a/etc/openstack_deploy/openstack_user_config.yml.example b/etc/openstack_deploy/openstack_user_config.yml.example index cc66aec578..1e6405c38e 100644 --- a/etc/openstack_deploy/openstack_user_config.yml.example +++ b/etc/openstack_deploy/openstack_user_config.yml.example @@ -138,6 +138,11 @@ # Name of unique bridge on target hosts to use for this network. Typical # values include 'br-mgmt', 'br-storage', 'br-vlan', 'br-vxlan', etc. # +# Option: container_bridge_type (optional, string) +# Type of container_bridge on target hosts. This option should only set +# to "openvswitch" when the container_bridge is set up with openvswitch. +# The default value is undefined, which means bridge type is linux bridge. +# # Option: container_interface (required, string) # Name of unique interface in containers to use for this network. # Typical values include 'eth1', 'eth2', etc. This option is OPTIONAL diff --git a/osa_toolkit/generate.py b/osa_toolkit/generate.py index c578f59d4c..8619cefd39 100755 --- a/osa_toolkit/generate.py +++ b/osa_toolkit/generate.py @@ -527,7 +527,7 @@ def skel_load(skeleton, inventory): def network_entry(is_metal, interface, - bridge=None, net_type=None, net_mtu=None): + bridge=None, bridge_type=None, net_type=None, net_mtu=None): """Return a network entry for a container.""" # TODO(cloudnull) After a few releases this conditional should be @@ -542,6 +542,9 @@ def network_entry(is_metal, interface, if bridge: _network['bridge'] = bridge + if bridge_type: + _network['bridge_type'] = bridge_type + if net_type: _network['type'] = net_type @@ -552,9 +555,9 @@ def network_entry(is_metal, interface, def _add_additional_networks(key, inventory, ip_q, q_name, netmask, interface, - bridge, net_type, net_mtu, user_config, - is_container_address, static_routes, gateway, - reference_group, address_prefix): + bridge, bridge_type, net_type, net_mtu, + user_config, is_container_address, static_routes, + gateway, reference_group, address_prefix): """Process additional ip adds and append then to hosts as needed. If the host is found to be "is_metal" it will be marked as "on_metal" @@ -588,6 +591,7 @@ def _add_additional_networks(key, inventory, ip_q, q_name, netmask, interface, netmask, interface, bridge, + bridge_type, net_type, net_mtu, user_config, @@ -640,6 +644,7 @@ def _add_additional_networks(key, inventory, ip_q, q_name, netmask, interface, is_metal, interface, bridge, + bridge_type, net_type, net_mtu ) @@ -766,6 +771,7 @@ def container_skel_load(container_skel, inventory, config): netmask=netmask, interface=p_net.get('container_interface'), bridge=p_net.get('container_bridge'), + bridge_type=p_net.get('container_bridge_type'), net_type=p_net.get('container_type'), net_mtu=p_net.get('container_mtu'), user_config=config,