.project\r
.settings\r
MANIFEST.MF\r
+.vagrant\r
+.DS_Store\r
--- /dev/null
+ODL OVSDB Vagrant
+=================
+
+# Installation
+
+You can download an install for your system from [here](http://www.vagrantup.com/downloads.html)
+Vagrant can also be installed using RubyGems
+
+ gem install vagrant
+
+# Usage
+
+Vagrant is a tool for creating development/test environments.
+The environment created for this project is as follows:
+
+1 x DevStack Control/Compute VM
+1 x DevStack Compute VM
+1 x Mininet VM
+
+It's assumed you already have an OVSDB development environment set up.
+
+1. Run `mvn clean install`
+2. Run `vagrant up`
+3. Start the controller (in distirbution/target/opendaylight/...)
+
+> Note: It's assumed that the subnet 192.168.50.x/24 is not in use
+> Your PC is 192.168.50.1. If you would like to change the addressing,
+> you will need to edit the Vagrantfile and hosts.json
+
+Follow the instructions below for Devstack and Mininet
+
+## DevStack VMs
+
+There are two DevStack VMs. One combined control/compute node and one dedicated compute node.
+The following steps are performed when the VM is created or when `vagrant provision` is run.
+
+- Check dependencies are installed
+- Clone the devstack repository to `devstack`
+- Generate a `local.conf` file
+
+To start DevStack
+
+ vagrant ssh devstack-control
+ # or vagrant ssh devstack-compute
+ cd devstack
+ ./stack.sh
+
+## Mininet
+
+There is a single VM provided for running mininet.
+This is for testing that does not require OpenStack Neutron.
+
+The following steps are performed when the VM is created or when `vagrant provision` is run.
+- Check dependencies are installed
+- Clone the mininet repository
+- Install mininet and Open vSwitch
+
+To start Mininet
+
+ vagrant ssh mininet
+ sudo mn
+
+# Port Forwarding
+
+The following ports are forwarded:
+
+localhost:8080 -> opendaylight:8080
+localhost:8000 -> opendaylight:8000
+localhost:8081 -> devstack-control:8080
--- /dev/null
+# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
+VAGRANTFILE_API_VERSION = "2"
+
+Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+
+ config.vm.provision "shell", path: "resources/puppet/scripts/bootstrap.sh"
+
+ config.vm.provision "puppet" do |puppet|
+ puppet.hiera_config_path = "resources/puppet/hiera.yaml"
+ puppet.working_directory = "/vagrant/resources/puppet"
+ puppet.manifests_path = "resources/puppet/manifests"
+ puppet.manifest_file = "base.pp"
+ end
+
+ config.vm.define "mininet" do |mininet|
+ mininet.vm.box = "saucy64"
+ mininet.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-13.10_chef-provisionerless.box"
+ mininet.vm.hostname = "mininet"
+ mininet.vm.network "private_network", ip: "192.168.50.15"
+ mininet.vm.provider :virtualbox do |vb|
+ vb.memory = 2048
+ end
+ mininet.vm.provision "puppet" do |puppet|
+ puppet.hiera_config_path = "resources/puppet/hiera.yaml"
+ puppet.working_directory = "/vagrant/resources/puppet"
+ puppet.manifests_path = "resources/puppet/manifests"
+ puppet.manifest_file = "mininet.pp"
+ end
+ end
+
+ config.vm.define "devstack-control" do |dsctl|
+ dsctl.vm.box = "saucy64"
+ dsctl.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-13.10_chef-provisionerless.box"
+ dsctl.vm.hostname = "devstack-control"
+ dsctl.vm.network "private_network", ip: "192.168.50.20"
+ dsctl.vm.network "forwarded_port", guest: 8080, host: 8081
+ dsctl.vm.provider :virtualbox do |vb|
+ vb.memory = 4096
+ end
+ dsctl.vm.provision "puppet" do |puppet|
+ puppet.hiera_config_path = "resources/puppet/hiera.yaml"
+ puppet.working_directory = "/vagrant/resources/puppet"
+ puppet.manifests_path = "resources/puppet/manifests"
+ puppet.manifest_file = "devstack-control.pp"
+ end
+ end
+
+ config.vm.define "devstack-compute" do |dscom|
+ dscom.vm.box = "saucy64"
+ dscom.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-13.10_chef-provisionerless.box"
+ dscom.vm.hostname = "devstack-compute"
+ dscom.vm.network "private_network", ip: "192.168.50.21"
+ dscom.vm.provider :virtualbox do |vb|
+ vb.memory = 4096
+ end
+ dscom.vm.provision "puppet" do |puppet|
+ puppet.hiera_config_path = "resources/puppet/hiera.yaml"
+ puppet.working_directory = "/vagrant/resources/puppet"
+ puppet.manifests_path = "resources/puppet/manifests"
+ puppet.manifest_file = "devstack-compute.pp"
+ end
+ end
+
+end
--- /dev/null
+---
+:backends:
+ - yaml
+ - json
+:yaml:
+ :datadir: /vagrant/resources/puppet/hieradata
+:json:
+ :datadir: /vagrant/resources/puppet/hieradata
+:hierarchy:
+ - hosts
--- /dev/null
+{
+ "hosts": {
+ "opendaylight": {
+ "name": "opendaylight",
+ "ipaddress": "192.168.50.1"
+ },
+ "mininet": {
+ "name": "mininet",
+ "ipaddress": "192.168.50.15"
+ },
+ "devstack-control": {
+ "name": "devstack-control",
+ "ipaddress": "192.168.50.20"
+ },
+ "devstack-compute": {
+ "name": "devstack-compute",
+ "ipaddress": "192.168.50.21"
+ }
+ }
+}
--- /dev/null
+package {"git":
+ ensure => "installed"
+}
+
+$hosts = hiera('hosts')
+
+file { "/etc/hosts":
+ ensure => file,
+ owner => "root",
+ group => "root",
+ content => template('/vagrant/resources/puppet/templates/hosts.erb')
+}
--- /dev/null
+vcsrepo { "/home/vagrant/devstack":
+ provider => git,
+ ensure => present,
+ user => "vagrant",
+ source => "https://github.com/openstack-dev/devstack.git",
+ before => File['/home/vagrant/devstack/local.conf']
+}
+
+$hosts = hiera('hosts')
+
+file { "/home/vagrant/devstack/local.conf":
+ ensure => present,
+ owner => "vagrant",
+ group => "vagrant",
+ content => template('/vagrant/resources/puppet/templates/compute.local.conf.erb')
+}
--- /dev/null
+vcsrepo { "/home/vagrant/devstack":
+ provider => git,
+ ensure => present,
+ user => "vagrant",
+ source => "https://github.com/openstack-dev/devstack.git",
+ before => File['/home/vagrant/devstack/local.conf']
+}
+
+$hosts = hiera('hosts')
+
+file { "/home/vagrant/devstack/local.conf":
+ ensure => present,
+ owner => "vagrant",
+ group => "vagrant",
+ content => template('/vagrant/resources/puppet/templates/control.local.conf.erb')
+}
--- /dev/null
+vcsrepo { "/home/vagrant/mininet":
+ provider => git,
+ ensure => present,
+ user => "vagrant",
+ source => "git://github.com/mininet/mininet",
+ revision => '2.1.0p1',
+ before => Exec['Install Mininet']
+}
+
+exec { "Install Mininet":
+ command => "/bin/bash mininet/util/install.sh -nfv > /dev/null",
+ cwd => '/home/vagrant',
+ user => 'vagrant',
+ timeout => 0
+}
--- /dev/null
+#!/usr/bin/env bash
+#
+# This bootstraps Puppet on Ubuntu 12.04 LTS.
+#
+set -e
+
+# Load up the release information
+. /etc/lsb-release
+
+REPO_DEB_URL="http://apt.puppetlabs.com/puppetlabs-release-${DISTRIB_CODENAME}.deb"
+
+#--------------------------------------------------------------------
+# NO TUNABLES BELOW THIS POINT
+#--------------------------------------------------------------------
+if [ "$(id -u)" != "0" ]; then
+ echo "This script must be run as root." >&2
+ exit 1
+ fi
+
+ if which puppet > /dev/null 2>&1; then
+ echo "Puppet is already installed."
+ exit 0
+ fi
+
+ # Do the initial apt-get update
+ echo "Initial apt-get update..."
+ apt-get update >/dev/null
+
+ # Install wget if we have to (some older Ubuntu versions)
+ echo "Installing wget..."
+ apt-get install -y wget >/dev/null
+
+ # Install the PuppetLabs repo
+ echo "Configuring PuppetLabs repo..."
+ repo_deb_path=$(mktemp)
+ wget --output-document="${repo_deb_path}" "${REPO_DEB_URL}" 2>/dev/null
+ dpkg -i "${repo_deb_path}" >/dev/null
+ apt-get update >/dev/null
+
+ # Install Puppet
+ echo "Installing Puppet..."
+ apt-get install -y puppet >/dev/null
+
+ echo "Puppet installed!"
+
+ # Install RubyGems for the provider
+ echo "Installing RubyGems..."
+ apt-get install -y rubygems >/dev/null
+ gem install --no-ri --no-rdoc rubygems-update
+ update_rubygems >/dev/null
+
+ # Installing Puppet Modules
+ puppet module install puppetlabs/vcsrepo
+ puppet module install puppetlabs/stdlib
+
+
--- /dev/null
+[[local|localrc]]
+SCREEN_LOGDIR=/opt/stack/log
+LOGFILE=stack.sh.log
+LOG_COLOR=False
+#OFFLINE=True
+#RECLONE=yes
+
+HOST_IP=<%= @hosts['devstack-compute']['ipaddress'] %>
+HOST_NAME=<%= @hosts['devstack-compute']['name'] %>
+SERVICE_HOST=<%= @hosts['devstack-control']['name'] %>
+SERVICE_HOST_NAME=<%= @hosts['devstack-control']['name'] %>
+
+Q_HOST=$SERVICE_HOST
+MYSQL_HOST=$SERVICE_HOST
+RABBIT_HOST=$SERVICE_HOST
+GLANCE_HOSTPORT=$SERVICE_HOST:9292
+KEYSTONE_AUTH_HOST=$SERVICE_HOST
+KEYSTONE_SERVICE_HOST=$SERVICE_HOST
+
+MYSQL_PASSWORD=mysql
+RABBIT_PASSWORD=rabbit
+QPID_PASSWORD=rabbit
+SERVICE_TOKEN=service
+SERVICE_PASSWORD=admin
+ADMIN_PASSWORD=admin
+
+VNCSERVER_PROXYCLIENT_ADDRESS=$HOST_IP
+VNCSERVER_LISTEN=0.0.0.0
+
+disable_all_services
+enable_service neutron quantum nova n-cpu n-novnc rabbit odl-compute
+
+# ODL WITH ML2
+Q_PLUGIN=ml2
+Q_ML2_PLUGIN_MECHANISM_DRIVERS=opendaylight,logger
+ODL_MGR_IP=<%= @hosts['opendaylight']['ipaddress'] %>
+
+ENABLE_TENANT_TUNNELS=True
+# Q_ML2_TENANT_NETWORK_TYPE=vlan
+# ENABLE_TENANT_VLANS=True
+Q_ML2_TENANT_NETWORK_TYPE=vxlan
+#Q_AGENT_EXTRA_AGENT_OPTS=(tunnel_types=vxlan)
+
+#FLOATING_RANGE=192.168.254.64/26
+
+EXTRA_OPTS=(scheduler_default_filters=AllHostsFilter)
+
+[[post-config|/etc/neutron/plugins/ml2/ml2_conf.ini]]
+[agent]
+minimize_polling=True
+
+[ml2_odl]
+url=http://<%= @hosts['opendaylight']['ipaddress'] %>:8080/controller/nb/v2/neutron
+username=admin
+password=admin
--- /dev/null
+[[local|localrc]]
+SCREEN_LOGDIR=/opt/stack/log
+LOGFILE=stack.sh.log
+LOG_COLOR=False
+#OFFLINE=True
+RECLONE=yes
+
+HOST_IP=<%= @hosts['devstack-control']['ipaddress'] %>
+HOST_NAME=<%= @hosts['devstack-control']['name'] %>
+SERVICE_HOST=$HOST_IP
+SERVICE_HOST_NAME=$HOST_NAME
+
+Q_HOST=$SERVICE_HOST
+MYSQL_HOST=$SERVICE_HOST
+RABBIT_HOST=$SERVICE_HOST
+GLANCE_HOSTPORT=$SERVICE_HOST:9292
+KEYSTONE_AUTH_HOST=$SERVICE_HOST
+KEYSTONE_SERVICE_HOST=$SERVICE_HOST
+
+MYSQL_PASSWORD=mysql
+RABBIT_PASSWORD=rabbit
+QPID_PASSWORD=rabbit
+SERVICE_TOKEN=service
+SERVICE_PASSWORD=admin
+ADMIN_PASSWORD=admin
+
+enable_service rabbit
+disable_service qpid
+
+enable_service n-cond
+enable_service n-cpu
+enable_service n-novnc
+disable_service n-net
+enable_service q-svc
+# enable_service q-agt
+enable_service q-dhcp
+enable_service q-l3
+enable_service q-meta
+enable_service quantum
+enable_service odl-compute
+
+# ODL WITH ML2
+Q_PLUGIN=ml2
+Q_ML2_PLUGIN_MECHANISM_DRIVERS=opendaylight,logger
+ODL_MGR_IP=<%= @hosts['opendaylight']['ipaddress'] %>
+
+ENABLE_TENANT_TUNNELS=True
+# ENABLE_TENANT_VLANS=True
+# TENANT_VLAN_RANGE=500:510
+
+Q_ML2_TENANT_NETWORK_TYPE=vxlan
+# Q_AGENT_EXTRA_AGENT_OPTS=(tunnel_types=vxlan)
+
+#FLOATING_RANGE=192.168.254.64/26
+#PUBLIC_NETWORK_GATEWAY=192.168.75.254
+
+[[post-config|/etc/neutron/plugins/ml2/ml2_conf.ini]]
+[agent]
+minimize_polling=True
+
+[ml2_odl]
+url=http://<%= @hosts['opendaylight']['ipaddress'] %>:8080/controller/nb/v2/neutron
+username=admin
+password=admin
--- /dev/null
+## Do Not Edit. Created by Puppet ##
+127.0.0.1 localhost
+255.255.255.255 broadcasthost
+::1 localhost
+fe80::1%lo0 localhost
+<% @hosts.values.each do |h| %>
+<%= h["ipaddress"] %> <%= h["name"] %>
+<% end %>