Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+ config.vm.box = "trusty64"
+ config.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box"
+ config.vm.provider "vmware_fusion" do |v, override|
+ override.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/vmware/opscode_ubuntu-14.04_chef-provisionerless.box"
+ end
+
config.vm.provision "shell", path: "resources/puppet/scripts/bootstrap.sh"
config.vm.provision "puppet" do |puppet|
compute_ip_base = "192.168.50."
compute_ips = num_compute_nodes.times.collect { |n| compute_ip_base + "#{n+21}" }
- config.vm.define "mininet" do |mininet|
- mininet.vm.box = "trusty64"
- mininet.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box"
- mininet.vm.provider "vmware_fusion" do |v, override|
- override.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/vmware/opscode_ubuntu-14.04_chef-provisionerless.box"
- end
- 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.provider "vmware_fusion" do |vf|
- vf.vmx["memsize"] = "2048"
- end
- mininet.vm.provider :libvirt do |lv|
- lv.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 |control|
- control.vm.box = "trusty64"
- control.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box"
- control.vm.provider "vmware_fusion" do |v, override|
- override.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/vmware/opscode_ubuntu-14.04_chef-provisionerless.box"
- end
control.vm.hostname = "devstack-control"
control.vm.network "private_network", ip: "#{control_ip}"
control.vm.network "forwarded_port", guest: 8080, host: 8081
config.vm.define "devstack-compute-#{n+1}" do |compute|
compute_ip = compute_ips[n]
compute_index = n+1
- compute.vm.box = "trusty64"
- compute.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box"
- compute.vm.provider "vmware_fusion" do |v, override|
- override.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/vmware/opscode_ubuntu-14.04_chef-provisionerless.box"
- end
compute.vm.hostname = "devstack-compute-#{compute_index}"
compute.vm.network "private_network", ip: "#{compute_ip}"
compute.vm.provider :virtualbox do |vb|
+++ /dev/null
-# README
-#
-# ovsdb-build
-# Author: Dave Tucker <dave.j.tucker@hp.com>
-#
-#
-
-The script in this commit simplifies the build process of the OVSDB
-project.
-usage: ovsdb-build [-h] [-r] [-b] [-of13] [-v] [-g CHANGE_ID] [-start]
-[-stop]
- [-d DIRECTORY] [-t]
-optional arguments:
- -h, --help show this help message and exit
- -r, --reclone Reclone the Controller/OVSDB repos
- -b, --rebuild Build the Controller Project
- -of13, --openflow13 Enable OpenFlow 1.3 Support
- -v, --verbose Verbose output
- -g CHANGE_ID, --gerrit CHANGE_ID
- Gerrit Change ID
- -start, --start Start the controller
- -stop, --stop Stop the controller
- -d DIRECTORY, --directory DIRECTORY
- directory
- -t, --tmux Create tmux session
-
-On first run it is recommended to run the following:
-
-./ovsdb-build -r -b -start
-
-You can add the `-d` option to specify the directory you want to build
-in:
-
-./ovsdb-build -r -b -d /home/dave/dev/opendaylight -start
-
-This will clone the controller and ovsdb projects, build them, move the
-ovsdb artifacts in to the controller directory and start the controller.
-
-Gerrit Changes can be built and loaded to the controller with a single
-command:
-
-./ovsbd-build -g 5716 -start
-
-The controller is started in the background. To access the OSGi ole
-you can manually `telnet 127.0.0.1 2400` or you can add `-t` to let
-the build script create a tmux session for you.
-
-
-
+++ /dev/null
-#!/usr/bin/env python
-# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Author: Dave Tucker
-
-import argparse
-import os
-from subprocess import call
-from sys import exit
-
-CTRL_GIT = "https://git.opendaylight.org/gerrit/p/controller.git"
-OVSDB_GIT = "https://git.opendaylight.org/gerrit/p/ovsdb.git"
-
-
-def main():
- parser = argparse.ArgumentParser()
- parser.add_argument('-r', '--reclone',
- help='Reclone the Controller/OVSDB repos',
- action='store_true')
- parser.add_argument('-b', '--rebuild',
- help='Build the Controller Project',
- action='store_true')
- parser.add_argument('-of13', '--openflow13',
- help='Enable OpenFlow 1.3 Support',
- action='store_true')
- parser.add_argument('-v', '--verbose',
- help='Verbose output',
- action='store_true')
- parser.add_argument('-g', '--gerrit',
- metavar='CHANGE_ID',
- help='Gerrit Change ID',
- type=int)
- parser.add_argument('-start', '--start',
- help='Start the controller',
- default=True,
- action='store_true')
- parser.add_argument('-stop', '--stop',
- help='Stop the controller',
- action='store_true')
- parser.add_argument('-d', '--directory',
- help='directory',
- type=str)
- parser.add_argument('-t', '--tmux',
- help='Create tmux session',
- action='store_true')
- args = parser.parse_args()
-
- builder = OvsdbBuilder(args.verbose, args.openflow13,
- args.directory)
-
- if args.stop:
- builder.stop_controller()
- exit(0)
-
- if args.reclone:
- print("---> Recloning Controller")
- builder.reclone(builder.ctrl_root, CTRL_GIT)
- print("---> Recloning OVSDB")
- builder.reclone(builder.ovsdb_root, OVSDB_GIT)
-
- if args.rebuild:
- print("---> Building Controller")
- builder.build(builder.ctrl_build)
-
- if args.gerrit:
- print("---> Checking out patch from Gerrit")
- builder.gerrit(args.gerrit)
-
- print("---> Building OVSDB")
- builder.build(builder.ovsdb_root, args.verbose)
- print("---> Copying OVSDB JARs")
- builder.copy_jars()
-
- if args.start:
- print("---> Running Controller")
- builder.run_controller()
-
- if args.tmux:
- builder.tmux()
- print("To attach to the session please run: \n\n"
- " tmux -2 attach-session -t odl\n\n")
-
-
-class OvsdbBuilder(object):
-
- def __init__(self,
- verbose=False,
- of13=False,
- directory=os.path.expanduser('~')):
- self.root_dir = directory
- self.ctrl_root = self.root_dir + "/controller"
- self.ctrl_build = (self.root_dir +
- "/opendaylight/distribution/opendaylight")
- self.ctrl_exec = (self.ctrl_build +
- "/target/distribution.opendaylight-osgipackage" +
- "/opendaylight")
- self.ctrl_plugin = self.ctrl_build + "/plugin"
- self.ovsdb_root = self.root_dir + "/ovsdb"
- self.verbose = verbose
-
- def reclone(self, location, repo):
- try:
- os.chdir(location)
- command = "git checkout master"
- command = "git pull"
- if not self.verbose:
- command += " > /dev/null"
- call(command, shell=True)
- except OSError:
- command = "git clone %s" % repo
- if not self.verbose:
- command += " > /dev/null"
- call(command, shell=True)
-
- def gerrit(self, patch):
- os.chdir(self.ovsdb_root)
- command = "git review -d %i" % patch
- call(command, shell=True)
-
- def build(self, location, verbose):
- os.chdir(location)
- command = "mvn clean install"
- if not verbose:
- command += " > /dev/null"
- call(command, shell=True)
-
- def copy_jars(self):
- os.chdir(self.ovsdb_root)
- command = ("find . -name ovsdb*.jar -exec cp {} %s \;"
- % self.ctrl_plugin)
- call(command, shell=True)
-
- def stop_controller(self):
- os.chdir(self.root_dir)
- command = "sh " + self.ctrl_exec + "/run.sh -stop"
- call(command, shell=True)
-
- def run_controller(self):
- os.chdir(self.root_dir)
- command = "sh " + self.ctrl_exec + "/run.sh -start -debug"
- if (self.of13):
- command += " -of13"
- call(command, shell=True)
-
- def tmux(self):
- tmux = ["tmux new-session -d -s odl",
- "tmux new-window -t odl:1 -n 'OSGi' 'telnet 127.0.0.1 2400'",
- "tmux new-window -t odl:2 -n 'OVSDB Source' 'cd %s'"
- % self.ovsdb_root,
- "tmux new-window -t odl:3 -n 'Ctrl Source' 'cd %s'"
- % self.ctrl_root,
- "tmux select-window -t odl:1",
- ]
- call(" ; ".join(tmux), shell=True)
-
-if __name__ == "__main__":
- main()
-
+++ /dev/null
-Notes for configuring the hardware_vtep schema on OVS:
-
-Pre-requisite:
---------------
-Fedora 20
-
-Configure:
-----------
-sudo yum -y install openvswitch python-openvswitch
-sudo service openvswitch stop
-
-sudo ovsdb-tool create /etc/openvswitch/conf.db /usr/share/openvswitch/vswitch.ovsschema
-sudo ovsdb-tool create /etc/openvswitch/vtep.db /usr/share/openvswitch/vtep.ovsschema
-
-sudo mkdir -p /var/run/openvswitch
-sudo mkdir -p /var/log/openvswitch
-
-sudo ovsdb-server --pidfile --log-file --detach \
---remote=punix:/var/run/openvswitch/db.sock \
---remote=ptcp:6640 \
-/etc/openvswitch/conf.db /etc/openvswitch/vtep.db
-
-sudo ovs-vswitchd --log-file --detach \
---pidfile unix:/var/run/openvswitch/db.sock
-
-sudo ovs-vsctl add-br br0
-sudo ovs-vsctl add-port br0 eth0
-sudo vtep-ctl add-ps br0
-sudo vtep-ctl add-port br0 eth0
-sudo vtep-ctl set Physical_Switch br0 tunnel_ips=192.168.0.3
-
-sudo /usr/share/openvswitch/scripts/ovs-vtep \
---log-file=/var/log/openvswitch/ovs-vtep.log \
---pidfile=/var/run/openvswitch/ovs-vtep.pid --detach br0
-
-sudo vtep-ctl set-manager ptcp:6640
-
-Verify:
--------
-sudo ovsdb-client dump hardware_vtep
-sudo vtep-ctl list-ps
-sudo vtep-ctl list-ports br0
-
-Integration-test:
------------------
-cd ovsdb/integrationtest
-mvn verify -Pintegrationtest -Dovsdbserver.ipaddress=192.168.120.31 -Dovsdbserver.port=6640 clean install
-
-Partial output:
-17:09:58.055 [main] TRACE o.o.o.lib.jsonrpc.JsonRpcEndpoint - {"id":"7649b44e-0982-44cb-9306-6072247bdafc","method":"list_dbs","params":[]}
-17:09:58.099 [nioEventLoopGroup-2-1] TRACE o.o.o.lib.jsonrpc.JsonRpcEndpoint - Response : {"id":"7649b44e-0982-44cb-9306-6072247bdafc","result":["hardware_vtep","Open_vSwitch"],"error":null}
-17:09:58.146 [main] TRACE o.o.o.lib.jsonrpc.JsonRpcEndpoint - {"id":"14f7f818-a2a1-40ba-a7ca-1dc7bdabe095","method":"get_schema","params":["hardware_vtep"]}
+++ /dev/null
-# capturing packets
-export HOST=`ifconfig | awk -F"-" '/^.+-eth0/ {print $1}'`
-echo "this is host ${HOST}"
-
-# to see it in the screen
-## tcpdump -XX -n -e -i ${HOST}-eth0
-
-# capture to a file
-tcpdump -w /vagrant/resources/mininet/${HOST}.pcap -s0 -vvv -e -n -c 100 -i ${HOST}-eth0
-
-
+++ /dev/null
-#!/usr/bin/python
-
-"""Custom L3 topology
-
-4 hosts directly connected to a bridge instance
-
-Refs: https://www.dropbox.com/s/rh6w9nvkuin7tl9/Screenshot%202014-08-14%2017.53.10.png
-https://www.dropbox.com/s/h42ufboknd2i0q1/Screenshot%202014-08-14%2017.52.09.png
-
-host1 -- blue broadcast
-host2, host4 -- green broadcast
-host3 -- external broadcast
-
-Adding the 'topos' dict with a key/value pair to generate our newly defined
-topology enables one to pass in '--topo=mytopo' from the command line.
-"""
-
-from mininet.topo import Topo
-
-class L3TestTopo( Topo ):
-
- """L3 test topology."""
-
- def __init__( self ):
- """Create custom topo."""
-
- # Initialize topology
- Topo.__init__( self )
-
- # Add hosts and switches
- h1 = self.addHost('h1',
- ip="10.10.10.2/24",
- mac="00:00:00:00:00:01",
- defaultRoute="dev h1-eth0 via 10.10.10.1")
-
- h2 = self.addHost('h2',
- ip="10.10.20.2/24",
- mac="00:00:00:00:00:02",
- defaultRoute="dev h2-eth0 via 10.10.20.1")
-
- h3 = self.addHost('h3',
- ip="172.16.1.2/24",
- mac="00:00:00:00:00:03",
- defaultRoute="dev h3-eth0 via 172.16.1.254")
-
- h4 = self.addHost('h4',
- ip="10.10.20.4/24",
- mac="00:00:00:00:00:04",
- defaultRoute="dev h4-eth0 via 10.10.20.1")
-
- s1 = self.addSwitch('s1')
-
- # Add links
- self.addLink( s1, h1 )
- self.addLink( s1, h2 )
- self.addLink( s1, h3 )
- self.addLink( s1, h4 )
-
-topos = {'l3': ( lambda: L3TestTopo() )}
-