Installing Openvswitch and KVM on CentOS 6.2

Installing Openvswitch and KVM on CentOS 6.2

Open Vswitch Lab

Installing Openvswitch and KVM on CentOS 6.2
Please see the updated how-to on Installing OpenvSwitch on CentOS.

This is all (mostly) covered in the INSTALL.Linux inside the tar. This might help folks with some of the

graph

Download and Install Open vSwitch

add yum -y install openssl-devel this package is necessary if you use SSL with OpenVSWitch. (Thanks for input Marcos)

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:

Verify the kernel mod loaded

If everything compiles and install create the sockets and db.

Setup the networking component by moving the IP off the physical interface to the new bridge interface

Installing and Integrating KVM into Open vSwitch

*Note* KVM is no longer supported on 32-bit HW.

KVM GUI management tool

Start the libvert daemon or reboot the system.

Start the KVM GUI

KVM Virt-Manager

See the updated Install at the top for accurate information!

Guest
Rizwan
2 years 5 months ago


@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??

Guest
Jay
2 years 7 months ago


I was able to resolve the pre­vi­ous issue (spe­cific to Cen­tOS 6.3) by edit­ing datapath/linux/compat/include/linux/skbuff.h and com­ment­ing out the following:

#if LINUX_VERSION_CODE &lt KERNEL_VERSION(3,2,0)
//static inline struct page *skb_frag_page(const skb_frag_t *frag)
//{
// return frag-&gtpage;
//}
#endif

Thank god for google trans­late:
http://www.xiaoyinzei.com/?p=32

Guest
Jay
2 years 7 months ago


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

Admin
2 years 7 months ago


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

Guest
Jay
2 years 7 months ago


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

Guest
Jay
2 years 7 months ago


Carlo, you can resolve that issue by installing the kernel-devel package

Guest
Carlo Santos
2 years 7 months ago


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?

Guest
StudentX
1 year 2 months ago


Carlo, did you solve that problem? I am having that problem too

Guest
ssedano
2 years 7 months ago


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.

Guest
Marcos Amorim
2 years 10 months ago


Please, add yum -y install openssl-devel this package is necessary if you use SSL with OpenVSWitch.

Great article, congrats

Admin
2 years 10 months ago


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.

Guest
Marcos Amorim
2 years 10 months ago


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.