Skip to content

Commit

Permalink
vagrant: Provide basic Vagrantfile
Browse files Browse the repository at this point in the history
This is a basic Vagrantfile which compiles and provisions the local OVS
source tree in a Fedora 20 VM. The Vagrantfile.in can be extended to
support additional distributions.

To use this Vagrantfile:
 1. Install Vagrant plus a compatible hypervisor
 2. Run configure to translate Vagrantfile.in to Vagrantfile
 3. Run `vagrant up` to create & provision the VM
 4. Run `vagrant ssh` to log into the VM

Signed-off-by: Thomas Graf <[email protected]>
Acked-by: Kyle Mestery <[email protected]>
  • Loading branch information
Thomas Graf committed Jan 5, 2015
1 parent 6c3cc11 commit 1ce96d2
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,5 @@ tags
_debian
odp-netlink.h
OvsDpInterface.h
Vagrantfile
/.vagrant/
18 changes: 18 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,24 @@ test failures that you believe to represent bugs in Open vSwitch.
Include the precise versions of Open vSwitch and Ryu in your bug
report, plus any other information needed to reproduce the problem.
Vagrant
-------
Requires: Vagrant and a compatible hypervisor
A Vagrantfile is provided allowing to compile and provision the source
tree as found locally in a virtual machine using the following commands:
vagrant up
vagrant ssh
This will bring up w Fedora 20 VM by default, alternatively the
`Vagrantfile.in` can be modified to use a different distribution box as
base. Also, the VM can be reprovisioned at any time to recompile and
reinstall OVS:
vagrant provision
Continuous Integration with Travis-CI
-------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ EXTRA_DIST = \
build-aux/sodepends.pl \
build-aux/soexpand.pl \
$(MAN_FRAGMENTS) \
$(MAN_ROOTS)
$(MAN_ROOTS) \
Vagrantfile.in
bin_PROGRAMS =
sbin_PROGRAMS =
bin_SCRIPTS =
Expand Down
30 changes: 30 additions & 0 deletions Vagrantfile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

$bootstrap_fedora = <<SCRIPT
yum -y update
yum -y install autoconf automake openssl-devel libtool \
python-twisted-core python-zope-interface PyQt4 \
desktop-file-utils groff graphviz rpmdevtools
cd /vagrant
./boot.sh && ./configure
make clean && make dist
rpmdev-setuptree
cp openvswitch-@[email protected] $HOME/rpmbuild/SOURCES
rpmbuild --bb --without check rhel/openvswitch-fedora.spec
rpm -e openvswitch
rpm -ivh $HOME/rpmbuild/RPMS/x86_64/openvswitch-@[email protected]_64.rpm
systemctl enable openvswitch
systemctl start openvswitch
systemctl status openvswitch
SCRIPT

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "fedora-20" do |fedora|
fedora.vm.box = "chef/fedora-20"
fedora.vm.provision :shell, inline: $bootstrap_fedora
end
end
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ AC_CONFIG_FILES(lib/libsflow.pc)
AC_CONFIG_FILES(ofproto/libofproto.pc)
AC_CONFIG_FILES(ovsdb/libovsdb.pc)
AC_CONFIG_FILES(include/openvswitch/version.h)
AC_CONFIG_FILES(Vagrantfile)

dnl This makes sure that include/openflow gets created in the build directory.
AC_CONFIG_COMMANDS([include/openflow/openflow.h.stamp])
Expand Down

0 comments on commit 1ce96d2

Please sign in to comment.