Installing Openvswitch and KVM on CentOS 6.2

[fancy_header3] Installing Openvswitch and KVM on CentOS 6.2 [/fancy_header3]

[info_box]Please see the updated how-to on Installing OpenvSwitch on CentOS.[/info_box]

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

graph

[fancy_header3] Download and Install Open vSwitch[/fancy_header3]

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

[fancy_header3] Installing and Integrating KVM into Open vSwitch [/fancy_header3]

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

[fancy_header3] KVM GUI management tool [/fancy_header3]

Start the libvert daemon or reboot the system.

Start the KVM GUI

[image_frame style=”framed_shadow” align=”center” alt=”KVM Virt-Manager”]http://networkstatic.net/~bbsali0/wp-content/uploads/2012/01/virt-manager.png[/image_frame]


See the updated Install at the top for accurate information!

16 comments


  1. 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?


    1. 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 🙁 That said oVirt looked pretty cool that was released a a couple months ago have you tried it? KVM + oVswitch later this week.


    2. Or try backing off the Swig version in the meantime. Curious what distro you have if you get a second.


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

    Great article, congrats


    1. 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.


  3. 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?


    1. 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.


  4. 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


  5. 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


  6. 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


  7. 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


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

Comments are closed.