Open vSwitch appears to be the up and coming mechanism for connecting virtual guests to the physical network through bridges, vlans, and network cards.
Through my previous postings, I described the processes I went through to get basic networking running with
my virtual guests in a QEMU/KVM environment on Debian Sid/Wheezy. After getting basic, simple bridged connectivity
working with bridge-utils, I realized I wanted to make things a bit more complicated. I want to be able to make
use of 802.1q VLAN trunking ports, and to bridge to individual VLANs from various virtualized guests.
I believe it would have been relatively straightforward to add the Debian VLAN module in, and start bridging that way.
But after a bit more research, it looks like Open vSwitch handles that, plus has a number of other capabilities.
Namely, it can deal with sFlow and Netflow exporting. It has other monitoring features as well. On top of that,
it Open vSwitches on different machines can be linked together via tunnels. I understand it also integrates into
OpenStack.
Therefore, I decided to take the big leap and start into Open vSwitch. With the basic knowledge gained from this tool,
I can start to integrate additional infrastructure into the solution.
The first step is to install Open vSwitch. It isn't as simple as expected.
I first shut down and removed existing bridge configurations from the /etc/network/interfaces file. Then removed
bridge-utils:
apt-get remove bridge-utils
Open vSwitch requires a kernel module to be built and installed. It doesn't come pre-built. And I see the reason. The
kernel in Sid/Wheezy is in a state of flux. I started with 3.2.0-1-amd64, but the current is 3.2.0-2-amd64. When
building the kernel module, linux-headers are needed. I had an error like:
FATAL: Module openvswitch_mod not found.
* Inserting openvswitch module
So the following was needed to sync headers and kernel:
apt-get install linux-headers
apt-get install linux-image-3.2.0-2-amd64
With the kernel and headers consistent, the Open vSwitch kernel module is downloaded and built:
apt-get install openvswitch-datapath-source
module-assistant auto-install openvswitch-datapath
The main Open vSwitch modules can then be installed:
apt-get install openvswitch-common
apt-get install openvswitch-switch
Output similar to the following should be obtained:
[ ok ] ovs-brcompatd is not running.
[ ok ] ovs-vswitchd is not running.
[ ok ] ovsdb-server is not running.
[ ok ] Inserting openvswitch module.
[warn] /etc/openvswitch/conf.db does not exist ... (warning).
[ ok ] Creating empty database /etc/openvswitch/conf.db.
[ ok ] Starting ovsdb-server.
[ ok ] Configuring Open vSwitch system IDs.
[ ok ] Starting ovs-vswitchd.
[ ok ] Enabling gre with iptables.
I can now start to experiment with Open vSwitch.