Portal:Wicked/OpenvSwitch

Jump to: navigation, search

Wicked + OpenvSwitch - An Overview

Update - Wicked 0.6.23:
Wicked 0.6.23 has enhanced support for the creation and configuration of OpenvSwitch (OVS) bridges. It is highly recommended to upgrade Wicked and refer to the 'ifcfg-ovs-bridge' man page for further information. However, before Wicked can interact with OVS, the OVS service needs to be enabled and started. Please refer to Step 1 - OVS Service Start below.

The remainder of this guide is targeted at older (pre 0.6.23) versions of Wicked, where OVS configuration requires a number of manual steps (involving OVS tooling directly) and workarounds.

Once an OVS bridge has been created and port interfaces have been assigned, this configuration is stored in the OVS database. When the OVS service is started after a reboot, any OVS bridges will be re-created, and the designated ports enslaved. Wicked (pre 0.6.23) simply treats OVS bridges as hot-plug devices (ie. Wicked does not create them). Once they appear on the system, if proper ifcfg files exist, Wicked can drive their further configuration.

Below are step-by-step instructions to configure a basic OVS bridge with one bridge port, on a system running Wicked < 0.6.23. Where appropriate, the instructions specify details related to particular Wicked versions.

Step 1 - OVS Service Start

 systemctl enable openvswitch
 systemctl start openvswitch
Wicked 0.6.23+

Please ensure that the OpenvSwitch service starts before the Network service by verifying/editing the OpenvSwitch service file:

 # /usr/lib/systemd/system/openvswitch.service
 [Unit]
 Description=Open vSwitch
 Before=network.service
 ...

Wicked 0.6.23+ requires the OVS service to start quite early in order to be able to interact with the service during boot (ie. to create bridges, add ports, etc). The other advantage of starting the service before the network, is that it will be stopped after the network. This will ensure timely shutdown of services such as NFS mounts.

Note: Ordering before network.service might not be enough as parts of Wicked are started before that, thus ordering Before wickedd.service might help.

Step 2 - OVS Bridge Creation and Port Addition

 # The naming convention is arbitrary. Replace eth0 with the interface that will be used as the OVS bridge port.
 ovs-vsctl add-br ovsbr_eth0
 ovs-vsctl add-port ovsbr_eth0 eth0

Step 3 - Nanny Enablement

  • Wicked nanny must be enabled to drive configuration of any hot-plug devices.
 # /etc/wicked/common.xml:
 ...
   <use-nanny>true</use-nanny>
 ...

Step 4 - Create Configuration Files

 # /etc/sysconfig/network/ifcfg-ovsbr_eth0:
 STARTMODE='auto'
 BOOTPROTO=dhcp
 OVS_BRIDGE='yes'
 OVS_BRIDGE_PORT_DEVICE='eth0'
 # /etc/sysconfig/network/ifcfg-eth0:
 STARTMODE='auto'
 BOOTPROTO='none'

Step 5 - Interface Bringup

 wicked ifup all
 # OR
 reboot

Step 6 - Give the Configuration a Test

 ping www.suse.com -I ovsbr_eth0
 PING www.suse.com (130.57.66.10) 56(84) bytes of data.
 64 bytes from www.suse.com (130.57.66.10): icmp_seq=1 ttl=50 time=86.6 ms
 64 bytes from www.suse.com (130.57.66.10): icmp_seq=2 ttl=50 time=87.5 ms
 ^C