Thursday, October 3, 2013

Installing and Configuring OpenVSwitch on Ubuntu 12.10


System Preperation

Install dependencies

$apt-get update 
$apt-get install python-simplejson automake autoconf gcc uml-utilities libtool build-essential git pkg-config

Download the OVS tarball Note: you can also pull from the git repository 

$wget http://openvswitch.org/releases/openvswitch-1.10.0.tar.gz

$tar zxvf openvswitch-1.10.0.tar.gz

$cd openvswitch-1.10.0

Compiling Open vSwitch From Source 

$./boot.sh   
$./configure --with-linux=/lib/modules/`uname -r`/build 
$make 
$make install

#Load the OVS Kernel Module
$insmod datapath/linux/openvswitch.ko

#Pull down the headers for your kernel
$sudo apt-get install linux-headers-`uname -r`

Open vSwitch Configuration 
$touch /usr/local/etc/ovs-vswitchd.conf 
$mkdir -p /usr/local/etc/openvswitch 
$ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema

#Start ovsdb-server, this stores the config into a file that is persistent even after restarts.

$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

#Only need to run this the first time. 
$ovs-vsctl --no-wait init

#Start vswitch  
$ovs-vswitchd --pidfile --detach


#Verify the kernel module(s) in case you didn't earlier and get errors. 
$lsmod | grep br 
brcompat               13512  0
openvswitch            98196  1 brcompat

#If they are not there try loading again and check your path to the kernel module. 
$insmod datapath/linux/openvswitch.ko

#At this point you have a fucntioning vanilla OVS install. Output should look something like this. 
$ovs-vsctl show
b6d574d7-5582-4cc0-93e5-a90cf0eb0a38
root@demo-139:/home/ubuntu/ovs-vxlan# ovs-vsctl --version
ovs-vsctl (Open vSwitch) 1.8.90
Compiled October 03 2013 06:23:36

1 comment:

  1. After Restart, start the process from

    ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema

    ======== if it gives an error, dont care and follow next steps

    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

    ReplyDelete