UPDATE: If you need help to run Open vSwitch 2.5.0 LTS have a look at a more recent post
this post has been rewritten (reloaded?). I’ve found a little spare time to update this article. A couple months ago I wrote a post about how to install openvswitch 1.9.0 version. It was a tricky installation and I even had to create a little patch, but with the latest stable 1.10 version the installation is a piece of cake. Only 5 minutes!.
Update: I’ve checked that the following instructions allows me to build openvswitch 2.0.0 and openvswitch LTS 1.9.3
I’m showing you the steps after a clean minimal installation of CentOS. If you see # it means that the command must be executed as root, and if you see $ the command must me executed as the ovswitch user that I’ve created.
Note that all this information is in the INSTALL.RHEL file that comes with the tar.gz file, but if you’re too lazy (like me) that’s what I’ve executed.
I’d like to thank Openvswitch creators for such a great code and Nicira Inc for the daemon scripts.
#yum install wget openssl-devel #yum groupinstall "Development Tools" #adduser ovswitch #su ovswitch $cd $wget http://openvswitch.org/releases/openvswitch-1.10.0.tar.gz $tar xvfz openvswitch-1.10.0.tar.gz $cd openvswitch-1.10.0 $mkdir -p /home/ovswitch/rpmbuild/SOURCES $cp ../openvswitch-1.10.0.tar.gz /home/ovswitch/rpmbuild/SOURCES/ $cp rhel/openvswitch-kmod.files /home/ovswitch/rpmbuild/SOURCES/ $rpmbuild -bb rhel/openvswitch.spec $rpmbuild -bb rhel/openvswitch-kmod-rhel6.spec $exit #yum localinstall /home/ovswitch/rpmbuild/RPMS/x86_64/kmod-openvswitch-1.10.0-1.el6.x86_64.rpm #yum localinstall /home/ovswitch/rpmbuild/RPMS/x86_64/openvswitch-1.10.0-1.x86_64.rpm
Let’s start the daemon!
#/etc/init.d/openvswitch start /usr/share/openvswitch/scripts/ovs-lib: line 49: /var/log/openvswitch/ovs-ctl.log: No such file or directory tee: /var/log/openvswitch/ovs-ctl.log: No such file or directory /etc/openvswitch/conf.db does not exist ... (warning). Creating empty database /etc/openvswitch/conf.db [ OK ] Starting ovsdb-server [ OK ] Configuring Open vSwitch system IDs [ OK ] Inserting openvswitch module [ OK ] Starting ovs-vswitchd [ OK ] Enabling remote OVSDB managers [ OK ] Enabling gre with iptables [ OK ]
CentOS 6.4 kernel comes with a openvswitch kernel module but the kmod-openvswitch installation will deal with it and load the new module. Let’s check what module is loaded:
# modinfo openvswitch filename: /lib/modules/2.6.32-358.el6.x86_64/weak-updates/openvswitch/openvswitch.ko version: 1.10.0 license: GPL description: Open vSwitch switching datapath srcversion: 33CB73C0C5A83F3CD6B7B0F depends: vermagic: 2.6.32-358.6.2.el6.x86_64 SMP mod_unload modversions parm: vlan_tso:Enable TSO for VLAN packets (int)
Great! The installation is quick and clean.
P.S: If you need information about openvswitch installation for 1.9 version let me know (use a comment or contact me) because I’ve retired the old post info and I have a copy.