This is all (mostly) covered in the INSTALL.Linux inside the tar. This might help folks with some of the
Download the following tars and packages to resolve dependencies or packages not in the Yum repositories.
DL Openvswitch tar
$ wget http://openvswitch.org/releases/openvswitch-1.3.0.tar.gz
$ wget http://www.graphviz.org/pub/graphviz/stable/SRPMS/graphviz-2.28.0-1.src.rpm
$ wget http://www.graphviz.org/pub/graphviz/stable/redhat/el6/i386/os/webdot-2.26-1.el6.noarch.rpm
wget http://download.fedoraproject.org/pub/fedora/linux/releases/16/Everything/source/SRPMS/autoconf-2.68-2.fc15.src.rpm
$rpm -ivh graphviz-2.28.0-1.src.rpm
$rpm -ivh webdot-2.26-1.el6.noarch.rpm
$yum -y install graphviz-devel
$rpm -ivh webdot-2.26-1.el6.noarch.rpm
$yum -y install graphviz-tcl
$yum -y install python-zope-filesystem
$yum -y install python-zope-interface
$yum -y install automake
$yum -y install autoconf
add yum -y install openssl-devel this package is necessary if you use SSL with OpenVSWitch. (Thanks for input Marcos)
$yum –y install gcc
The Open vSwitch datapath requires bridging support
(CONFIG_BRIDGE) to be built as a kernel module. (This is common
in kernels provided by Linux distributions.) The bridge module
must not be loaded or in use. If the bridge module is running
(check with “lsmod | grep bridge”), you must remove it (“rmmod
bridge”) before starting the datapath.
To build the Linux kernel module, so that you can run the
kernel-based switch, pass the location of the kernel build
directory on –with-linux. For example, to build for a running
instance of Linux:
./configure –with-linux=/lib/modules/`uname -r`/build
$make
$make install
Load the built kernel module
insmod datapath/linux/openvswitch_mod.ko
insmod datapath/linux/brcompat_mod.ko
Verify the kernel mod loaded
[root@localhost openvswitch-1.3.0]# lsmod
openvswitch_mod 82086 0
If everything compiles and install create the sockets and db.
$mkdir -p /usr/local/etc/openvswitch
$ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema
Start the configuration DB
$
ovsdb-server /usr/local/etc/openvswitch/conf.db
–remote=punix:/usr/local/var/run/openvswitch/db.sock
–remote=db:Open_vSwitch,manager_options
–private-key=db:SSL,private_key
–certificate=db:SSL,certificate
–bootstrap-ca-cert=db:SSL,ca_cert –pidfile –detach –log-file
Initialize the DB
$ovs-vsctl –no-wait init
Then start the main Open vSwitch daemon, telling it to connect to the
same Unix domain socket
$ovs-vswitchd –pidfile –detach
$sudo ovs-vswitchd –pidfile –log-file –detach -v
$ovs-vswitchd –pidfile –detach
$ifconfig eth0 0
$ifconfig br0 192.168.1.25 netmask 255.255.255.0 up
$ifconfig eth0 up
$ifconfig eth0 0.0.0.0
$sudo ovs-vsctl add-br br0
$sudo ovs-vsctl add-port br0 eth0
$route add default gw 192.168.1.1 br0
$route add default gw 192.168.1.1 br0
Looks at your empty but functional tables
ovsdb-client dump
Installing KVM
*Note* KVM is no longer supported on 32-bit HW.
KVM uses ‘tunctl’ to provision the bridging mechanisms. To install this on CentOS via a repository add the RPMforge repository which is not installed by default.
x86_64 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
$wget rpmforge-release-0.5.2-2.el6.rf.i686.rpm
$rpm -ivh rpmforge-release-0.5.2-2.el6.rf.i686.rpm
Install DAG’s GPG key
$rpm –import http://apt.sw.be/RPM-GPG-KEY.dag.txt
Install and load tunctl (only if having issues. brcompat module should take care)
$yum –y install tunctl
$modprobe tun
$yum -y install qemu-kvm qemu-kvm-tools libvert
KVM GUI management tool
$yum –y install virt-manager
$yum install dejavu-lgc-sans-fonts
$Start the libvert daemon or reboot the system.
$ Service libvertd start
Start the KVM GUI
$ Virt-manager
Part 2 soon..
















OK, Waiting on Part 2! I’m planning on use this to build a 2 host cluster running CentOS 6.2 with KVM. Doing what you have got here, what else do I need and should I just wait?
Oh man, I must have missed that lol. I will work on it later this week. I get so annoyed with the Yum repository its hard force myself to come out of Ubuntu. I used to love RH back in the day to
Or try backing off the Swig version in the meantime. Curious what distro you have if you get a second.
Please, add yum -y install openssl-devel this package is necessary if you use SSL with OpenVSWitch.
Great article, congrats
Thanks Marcos. Appreciate the feedback. I need to clean this post up. I haven’t done much in RedHat lately. Have you tried oVirt with OpenvSwitch yet? Last time I visited it had just released. I guess I’ve turned into an OpenStack junky. lol.
Thanks Brent,
I´m trying to create a new switch to replace dvSwitch, like this http://blog.ioshints.info/2012/02/nicira-open-vswitch-inside-vsphereesx.html?spref=tw, to controller in Layer 2 and others restrictions on virtualization environment.
Hi,
I am currently trying out the instructions you have posted here but I am encountering this error on a CentOS 6.2:
configure: error: source dir /lib/modules/2.6.32-220.el6.x86_64/build doesn’t exist
The build folder can be found in the same location mentioned above but it is only a symbolic link of the folder /usr/src/kernels/`uname -r`.
How do I solve this issue?
If after the installation of the kernel-devel package the issue persists. That is due a misconfiguration of the kernel-devel package. A simple and fast solution is to re-link to the actual sources. I mean, just re-link to /usr/src/kernels/[your_kernel]. Only the build link, source is a link to build.
Carlo, you can resolve that issue by installing the kernel-devel package
I recieve the following error while building kernel modules:
make -C /lib/modules/2.6.32-279.9.1.el6.x86_64/build M=/usr/src/openvswitch-1.7.1/datapath/linux modules
make[4]: Entering directory `/usr/src/kernels/2.6.32-279.9.1.el6.x86_64′
CC [M] /usr/src/openvswitch-1.7.1/datapath/linux/genetlink-brcompat.o
In file included from /usr/src/openvswitch-1.7.1/datapath/linux/compat/include/linux/netlink.h:4,
from /usr/src/openvswitch-1.7.1/datapath/linux/compat/include/net/genetlink.h:5,
from /usr/src/openvswitch-1.7.1/datapath/linux/compat/genetlink.inc:3,
from /usr/src/openvswitch-1.7.1/datapath/linux/genetlink-brcompat.c:10:
/usr/src/openvswitch-1.7.1/datapath/linux/compat/include/linux/skbuff.h:242: error: redefinition of ‘skb_frag_page’
include/linux/skbuff.h:1612: note: previous definition of ‘skb_frag_page’ was here
Hi guys, I will do an update next week for CentOS. I have been tunnel visioned on Ubuntu lately with other things. Will get it out this weekend.
Thanks!
-Brent
I was able to resolve the previous issue (specific to CentOS 6.3) by editing datapath/linux/compat/include/linux/skbuff.h and commenting out the following:
#if LINUX_VERSION_CODE page;
//}
#endif
Thank god for google translate:
http://www.xiaoyinzei.com/?p=32
I was able to resolve the previous issue (specific to CentOS 6.3) by editing datapath/linux/compat/include/linux/skbuff.h and commenting out the following:
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)
//static inline struct page *skb_frag_page(const skb_frag_t *frag)
//{
// return frag->page;
//}
#endif
Thank god for google translate:
http://www.xiaoyinzei.com/?p=32
@Jay, where did you find the file: datapath/linux/compat/include/linux/skbuff.h
I have looked everywehre but can’t figure out where to find this file, i have similar problem and build directory in my running kernel src directory does not exist, what should i do??