Build OVN

Update & install dependencies

  1. apt-get update
  2. apt-get -y install build-essential fakeroot

Install Build-Depends from debian/control file

  1. apt-get -y install graphviz autoconf automake bzip2 debhelper dh-autoreconf libssl-dev libtool openssl
  2. apt-get -y install procps python-all python-twisted-conch python-zopeinterface python-six

Check the working directory & build

  1. curl -o openvswitch-2.7.0.tar.gz http://openvswitch.org/releases/openvswitch-2.7.0.tar.gz
  2. tar zxvf openvswitch-2.7.0.tar.gz
  3. cd openvswitch-2.7.0
  4. # if everything is ok then this should return no output
  5. dpkg-checkbuilddeps
  6. `DEB_BUILD_OPTIONS='parallel=8 nocheck' fakeroot debian/rules binary`

The .deb files for ovs will be built and placed in the parent directory (ie. in …/). The next step is to
build the kernel modules.

Install datapath sources

  1. cd ..
  2. apt-get -y install module-assistant
  3. dpkg -i openvswitch-datapath-source_2.7.0-1_all.deb

Build kernel modules using module-assistant

  1. m-a prepare
  2. m-a build openvswitch-datapath

Copy the resulting deb package. Note that your version may differ slightly depending on your specific kernel version.

  1. cp /usr/src/openvswitch-datapath-module-*.deb ./
  2. apt-get -y install python-six python2.7
  3. dpkg -i openvswitch-datapath-module-*.deb
  4. dpkg -i openvswitch-common_2.7.0-1_amd64.deb openvswitch-switch_2.7.0-1_amd64.deb
  5. dpkg -i ovn-central_2.7.0-1_amd64.deb ovn-common_2.7.0-1_amd64.deb ovn-controller-vtep_2.7.0-1_amd64.deb ovn-docker_2.7.0-1_amd64.deb ovn-host_2.7.0-1_amd64.deb python-openvswitch_2.7.0-1_all.deb
  1. /usr/share/openvswitch/scripts/ovs-ctl start --system-id=random
  2. /usr/share/openvswitch/scripts/ovn-ctl start_northd
  3. /usr/share/openvswitch/scripts/ovn-ctl start_controller
  4. /usr/share/openvswitch/scripts/ovn-ctl start_controller_vtep
  5. export CENTRAL_IP=10.140.0.2
  6. export LOCAL_IP=10.140.0.2
  7. export ENCAP_TYPE=vxlan
  8. ovs-vsctl set Open_vSwitch . external_ids:ovn-remote="tcp:$CENTRAL_IP:6642" external_ids:ovn-nb="tcp:$CENTRAL_IP:6641" external_ids:ovn-encap-ip=$LOCAL_IP external_ids:ovn-encap-type="$ENCAP_TYPE"