summaryrefslogtreecommitdiffstats
path: root/vagrant-demo
diff options
context:
space:
mode:
Diffstat (limited to 'vagrant-demo')
-rw-r--r--vagrant-demo/Vagrantfile211
-rw-r--r--vagrant-demo/bootstrap-host.ubuntu1404.sh29
-rwxr-xr-xvagrant-demo/ncmount.sh35
-rwxr-xr-xvagrant-demo/scripts/host1-cfg.sh23
-rwxr-xr-xvagrant-demo/scripts/host2-cfg.sh23
-rwxr-xr-xvagrant-demo/scripts/vbd-reset.sh57
-rwxr-xr-xvagrant-demo/scripts/vpp1-reset.sh95
-rwxr-xr-xvagrant-demo/scripts/vpp2-reset.sh105
8 files changed, 0 insertions, 578 deletions
diff --git a/vagrant-demo/Vagrantfile b/vagrant-demo/Vagrantfile
deleted file mode 100644
index 2892b954d..000000000
--- a/vagrant-demo/Vagrantfile
+++ /dev/null
@@ -1,211 +0,0 @@
-# -*- mode: ruby -*-
-# vi: set ft=ruby :
-
-#
-# Vagrantfile to set up demo VMs and network connections
-#
-# Note: VirtualBox is currently the only provier supported for the demo.
-#
-# [ host1 VM ] <=== Internal Network "host1-vpp1" ===> [ vpp1 VM ]
-# [ vpp1 VM ] <==+ Internal Network "vpp1-vpp2" ===> [ vpp2 VM ]
-# [ jaws VM ] <==+
-# [ vpp1 VM ] <--- Private Network 192.168.10.x -+--> [ vbd VM ]
-# (Mgmt network) |
-# +--> [ vpp2 VM ]
-# [ vpp2 VM ] <=== Internal Network "host2-vpp2" ===> [ host2 VM ]
-#
-Vagrant.configure(2) do |config|
-
- config.ssh.forward_x11 = true
-
- # Add .gnupg dir in so folks can sign patches
- # Note, as gnupg puts socket files in that dir, we have
- # to be cautious and make sure we are dealing with a plain file
- homedir = File.expand_path("~/")
- Dir["#{homedir}/.gnupg/**/*"].each do |fname|
- if File.file?(fname)
- destname = fname.sub(Regexp.escape("#{homedir}/"),'')
- config.vm.provision "file", source: fname, destination: destname
- end
- end
-
- # Copy in the .gitconfig if it exists
- if File.file?(File.expand_path("~/.gitconfig"))
- config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig"
- end
-
- # vagrant-cachier caches apt/yum etc to speed subsequent
- # vagrant up
- # to enable, run
- # vagrant plugin install vagrant-cachier
- #
- if Vagrant.has_plugin?("vagrant-cachier")
- config.cache.scope = :box
- end
-
- # Define vpp1 VM, L3 mgmt interface (eth1) to vbd and vpp2 VMs,
- # L2 interface (GigabitEthernet0/9/0) to host1, and
- # L2 interface (GigabitEthernet0/a/0) to vpp2
- #
- # [ vpp1 VM ] <-- Private Network 192.168.10.x -+-> [ vbd VM ]
- # (Mgmt network) |
- # +-> [ vpp2 VM ]
- # [ host1 VM ] <== Internal Network "host1-vpp1" ==> [ vpp1 VM ]
- # [ vpp1 VM ] <== Internal Network "vpp1-vpp2" ==> [ vpp2 VM ]
- #
- config.vm.define :vpp1 do |vpp1|
- vpp1.vm.box = "puppetlabs/ubuntu-14.04-64-nocm"
- # Mount karaf packages directory if specified
- if ENV.key?('KARAF_PACKAGES')
- vpp1.vm.synced_folder ENV['KARAF_PACKAGES'], "/karaf-packages", disabled: false
- end
- # Mount Maven repository if specified
- if ENV.key?('HONEYCOMB_M2_REPO')
- vpp1.vm.synced_folder ENV['HONEYCOMB_M2_REPO'], "/m2-repository", disabled: false
- end
- # Mount VPP repository if specified
- if ENV.key?('VPP_REPO')
- vpp1.vm.synced_folder ENV['VPP_REPO'], "/vpp", disabled: false
- end
- vpp1.vm.synced_folder "../", "/honeycomb", disabled: false
- vagrant_vpp_agent_addr = "192.168.10.11"
- vpp1.vm.network "private_network", ip: "#{vagrant_vpp_agent_addr}"
- vpp1.vm.provider "virtualbox" do |vb|
- vb.customize ["modifyvm", :id, "--nic3", "intnet"]
- vb.customize ["modifyvm", :id, "--intnet3", "host1-vpp1"]
- vb.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"]
- vb.customize ["modifyvm", :id, "--nic4", "intnet"]
- vb.customize ["modifyvm", :id, "--intnet4", "vpp1-vpp2"]
- vb.customize ["modifyvm", :id, "--nicpromisc4", "allow-all"]
- vb.memory = "4096"
- end
- vpp1.vm.provision 'shell' do | s|
- s.path = "../vagrant/bootstrap.ubuntu1404.sh"
- s.args = ["vpp1", "is_vpp_agent", "#{vagrant_vpp_agent_addr}"]
- end
-end
-
- # Define vpp2 VM, L3 mgmt interface (eth1) to vbd and vpp1 VMs,
- # L2 interface (GigabitEthernet0/9/0) to host1, and
- # L2 interface (GigabitEthernet0/a/0) to vpp1
- #
- # [ vpp1 VM ] <-- Private Network 192.168.10.x -+-> [ vbd VM ]
- # (Mgmt network) |
- # +-> [ vpp2 VM ]
- # [ vpp2 VM ] <== Internal Network "host2-vpp2" ==> [ host2 VM ]
- # [ vpp1 VM ] <== Internal Network "vpp1-vpp2" ==> [ vpp2 VM ]
- #
- config.vm.define :vpp2 do |vpp2|
- # TODO: Run centos on vpp2 VM
- # vpp2.vm.box = "puppetlabs/centos-7.0-64-nocm"
- vpp2.vm.box = "puppetlabs/ubuntu-14.04-64-nocm"
- # Mount karaf packages directory if specified
- if ENV.key?('KARAF_PACKAGES')
- vpp2.vm.synced_folder ENV['KARAF_PACKAGES'], "/karaf-packages", disabled: false
- end
- # Mount Maven repository if specified
- if ENV.key?('HONEYCOMB_M2_REPO')
- vpp2.vm.synced_folder ENV['HONEYCOMB_M2_REPO'], "/m2-repository", disabled: false
- end
- # Mount VPP repository if specified
- if ENV.key?('VPP_REPO')
- vpp2.vm.synced_folder ENV['VPP_REPO'], "/vpp", disabled: false
- end
- vpp2.vm.synced_folder "../", "/honeycomb", disabled: false
- vagrant_vpp_agent_addr = "192.168.10.12"
- vpp2.vm.network "private_network", ip: "#{vagrant_vpp_agent_addr}"
- vpp2.vm.provider "virtualbox" do |vb|
- vb.customize ["modifyvm", :id, "--nic3", "intnet"]
- vb.customize ["modifyvm", :id, "--intnet3", "host2-vpp2"]
- vb.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"]
- vb.customize ["modifyvm", :id, "--nic4", "intnet"]
- vb.customize ["modifyvm", :id, "--intnet4", "vpp1-vpp2"]
- vb.customize ["modifyvm", :id, "--nicpromisc4", "allow-all"]
- vb.memory = "4096"
- end
- vpp2.vm.provision 'shell' do | s|
- s.path = "../vagrant/bootstrap.ubuntu1404.sh"
- s.args = ["vpp2", "is_vpp_agent", "#{vagrant_vpp_agent_addr}"]
- end
- end
-
- # Define vbd VM and L3 mgmt interface (eth1) to vpp1 and vpp2 VMs
- #
- # [ vpp1 VM ] <-- Private Network 192.168.10.x -+-> [ vbd VM ]
- # (Mgmt network) |
- # +-> [ vpp2 VM ]
- #
- config.vm.define :vbd do |vbd|
- vbd.vm.box = "puppetlabs/ubuntu-14.04-64-nocm"
- # Mount karaf packages directory if specified
- if ENV.key?('KARAF_PACKAGES')
- vbd.vm.synced_folder ENV['KARAF_PACKAGES'], "/karaf-packages", disabled: false
- end
- # Mount Maven repository if specified
- if ENV.key?('HONEYCOMB_M2_REPO')
- vbd.vm.synced_folder ENV['HONEYCOMB_M2_REPO'], "/m2-repository", disabled: false
- end
- vbd.vm.synced_folder "../", "/honeycomb", disabled: false
- vbd.vm.network "private_network", ip: "192.168.10.10"
- vbd.vm.provider "virtualbox" do |vb|
- vb.memory = "2048"
- end
- vbd.vm.provision 'shell' do | s|
- s.path = "../vagrant/bootstrap.ubuntu1404.sh"
- s.args = ["vbd", "is_vbd_vm", ""]
- end
- end
-
- # Define host1 VM and L2 interface (eth1) to vpp1 VM
- #
- # [ host1 VM ] <== Internal Network "host1-vpp1" ==> [ vpp1 VM ]
- #
- config.vm.define :host1 do |host1|
- host1.vm.box = "puppetlabs/ubuntu-14.04-64-nocm"
- host1.vm.provider "virtualbox" do |vb|
- vb.customize ["modifyvm", :id, "--nic2", "intnet"]
- vb.customize ["modifyvm", :id, "--intnet2", "host1-vpp1"]
- vb.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
- end
- host1.vm.provision "shell" do |s|
- s.path = "bootstrap-host.ubuntu1404.sh"
- s.args = ["host1", "172.16.15.14/24"]
- end
- end
-
- # Define host2 VM and L2 interface (eth1) to vpp2 VM
- #
- # [ vpp2 VM ] <== Internal Network "host2-vpp2" ==> [ host2 VM ]
- #
- config.vm.define :host2 do |host2|
- host2.vm.box = "puppetlabs/ubuntu-14.04-64-nocm"
- host2.vm.provider "virtualbox" do |vb|
- vb.customize ["modifyvm", :id, "--nic2", "intnet"]
- vb.customize ["modifyvm", :id, "--intnet2", "host2-vpp2"]
- vb.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
- end
- host2.vm.provision "shell" do |s|
- s.path = "bootstrap-host.ubuntu1404.sh"
- s.args = ["host2", "172.16.15.15/24"]
- end
- end
-
- # Define jaws VM (for wireshark) connected to the vpp1 <-> vpp2
- # internal network.
- #
- # [ vpp1 VM ] <==+ Internal Network "vpp1-vpp2" ===> [ vpp2 VM ]
- # [ jaws VM ] <==+
- #
- config.vm.define :jaws do |jaws|
- jaws.vm.box = "puppetlabs/ubuntu-14.04-64-nocm"
- jaws.vm.provider "virtualbox" do |vb|
- vb.customize ["modifyvm", :id, "--nic2", "intnet"]
- vb.customize ["modifyvm", :id, "--intnet2", "vpp1-vpp2"]
- vb.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
- end
- jaws.vm.provision "shell" do |s|
- s.path = "bootstrap-host.ubuntu1404.sh"
- s.args = ["jaws", "172.16.15.15/24"]
- end
- end
-end
diff --git a/vagrant-demo/bootstrap-host.ubuntu1404.sh b/vagrant-demo/bootstrap-host.ubuntu1404.sh
deleted file mode 100644
index b84acbf1e..000000000
--- a/vagrant-demo/bootstrap-host.ubuntu1404.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-# Args
-VAGRANT_VM_NAME="$1"
-echo "Running bootstrap-host.ubuntu1404.sh..."
-echo "VAGRANT_VM_NAME = '$VAGRANT_VM_NAME'"
-
-# Directory and file definitions
-VAGRANT_HOME="/home/vagrant"
-VAGRANT_BASHRC="$VAGRANT_HOME/.bashrc"
-VAGRANT_BASH_ALIASES="$VAGRANT_HOME/.bash_aliases"
-
-# Set prompt to include VM name if provided.
-sudo -H -u vagrant perl -i -pe 's/@\\h/@\\\h\$VM_NAME/g' $VAGRANT_BASHRC
-sudo -H -u vagrant touch $VAGRANT_BASH_ALIASES
-if [ "$VAGRANT_VM_NAME" != "" ] && [ "$(grep -q VM_NAME $VAGRANT_BASH_ALIASES)" = "" ] ; then
- echo -e "\n# Include VM Name in prompt" >> $VAGRANT_BASH_ALIASES
- echo "export VM_NAME=\"($VAGRANT_VM_NAME)\"" >> $VAGRANT_BASH_ALIASES
-fi
-chown vagrant:vagrant $VAGRANT_BASH_ALIASES
-
-# Fix grub-pc on Virtualbox with Ubuntu
-export DEBIAN_FRONTEND=noninteractive
-
-# Add fd.io apt repo in case its needed
-echo "deb http://nexus.fd.io/content/repositories/fd.io.dev/ ./" > /etc/apt/sources.list.d/99fd.io.list
-
-# Standard update + upgrade dance
-apt-get update
-apt-get upgrade -y
-apt-get install -y wireshark
diff --git a/vagrant-demo/ncmount.sh b/vagrant-demo/ncmount.sh
deleted file mode 100755
index 684c38a31..000000000
--- a/vagrant-demo/ncmount.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-
-
-add_vpp() {
- odl_ip=$1
- vpp_host=$2
- vpp_ip=$3
- vpp_port=$4
-
- vpp_username=admin
- vpp_password=admin
-
- put_data='<node xmlns="urn:TBD:params:xml:ns:yang:network-topology">
- <node-id>'$vpp_host'</node-id>
- <host xmlns="urn:opendaylight:netconf-node-topology">'$vpp_ip'</host>
- <port xmlns="urn:opendaylight:netconf-node-topology">'$vpp_port'</port>
- <username xmlns="urn:opendaylight:netconf-node-topology">admin</username>
- <password xmlns="urn:opendaylight:netconf-node-topology">admin</password>
- <tcp-only xmlns="urn:opendaylight:netconf-node-topology">false</tcp-only>
- <keepalive-delay xmlns="urn:opendaylight:netconf-node-topology">0</keepalive-delay>
- </node>
- '
-curl -u admin:admin -X PUT -d "$put_data" -H 'Content-Type: application/xml' http://$odl_ip:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/$vpp_host
-}
-
-if [ -z "$1" ] ||
- [ -z "$2" ] ||
- [ -z "$3" ] ||
- [ -z "$4" ]; then
- echo "usage: ./ncmount.sh <controllerIP_for_mount> <vpp_instance_name> <vpp_IP> <NETCONF_port>
- ie ./ncmount.sh 127.0.0.1 vpp1 192.168.10.12 2830"
- exit 1
-fi
-
-add_vpp $1 $2 $3 $4
diff --git a/vagrant-demo/scripts/host1-cfg.sh b/vagrant-demo/scripts/host1-cfg.sh
deleted file mode 100755
index 14ee1022f..000000000
--- a/vagrant-demo/scripts/host1-cfg.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#! /bin/bash
-#
-# Script to configure host1.
-#
-# Copyright (c) 2016 Cisco Systems, Inc. and/or others. All rights reserved.
-
-if [ "$(id -un)" != "vagrant" ] || [ "$VM_NAME" != "(host1)" ]; then
- echo "ERROR: Must be run inside the vpp1 vagrant VM!"
- exit 1
-fi
-
-HOST1_IP_ADDR="172.16.10.11"
-HOST2_IP_ADDR="172.16.10.12"
-echo
-echo "Configuring eth1 with $HOST1_IP_ADDR"
-sudo ifconfig eth1 $HOST1_IP_ADDR/24 up
-echo
-echo "ifconfig eth1:"
-ifconfig eth1
-echo
-echo "Run the following command to ping host2:"
-echo " ping $HOST2_IP_ADDR"
-echo
diff --git a/vagrant-demo/scripts/host2-cfg.sh b/vagrant-demo/scripts/host2-cfg.sh
deleted file mode 100755
index 92a663ffc..000000000
--- a/vagrant-demo/scripts/host2-cfg.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#! /bin/bash
-#
-# Script to configure host2.
-#
-# Copyright (c) 2016 Cisco Systems, Inc. and/or others. All rights reserved.
-
-if [ "$(id -un)" != "vagrant" ] || [ "$VM_NAME" != "(host2)" ]; then
- echo "ERROR: Must be run inside the vpp1 vagrant VM!"
- exit 1
-fi
-
-HOST1_IP_ADDR="172.16.10.11"
-HOST2_IP_ADDR="172.16.10.12"
-echo
-echo "Configuring eth1 with $HOST2_IP_ADDR"
-sudo ifconfig eth1 $HOST2_IP_ADDR/24 up
-echo
-echo "ifconfig eth1:"
-ifconfig eth1
-echo
-echo "Run the following command to ping host1:"
-echo " ping $HOST1_IP_ADDR"
-echo
diff --git a/vagrant-demo/scripts/vbd-reset.sh b/vagrant-demo/scripts/vbd-reset.sh
deleted file mode 100755
index a56b96f8a..000000000
--- a/vagrant-demo/scripts/vbd-reset.sh
+++ /dev/null
@@ -1,57 +0,0 @@
-#! /bin/bash
-#
-# Script to reset the ODL Virtual Bridge Domain application
-#
-# Copyright (c) 2016 Cisco Systems, Inc. and/or others. All rights reserved.
-
-if [ "$(id -un)" != "vagrant" ] || [ "$VM_NAME" != "(vbd)" ]; then
- echo "ERROR: Must be run inside the vbd vagrant VM!"
- exit 1
-fi
-
-APP_NAME="ODL VBD application"
-KARAF_HOME="$(dirname /opt/honeycomb/vbd-karaf*/bin)"
-BIN_DIR="$KARAF_HOME/bin"
-KARAF_LOG="$KARAF_HOME/data/log/karaf.log"
-CURRENT_DIR="$KARAF_HOME/etc/opendaylight/current"
-DATA_DIR="$KARAF_HOME/data"
-PERSISTENT_STATE="$CURRENT_DIR $DATA_DIR"
-
-echo
-echo "Stopping $APP_NAME"
-sudo $BIN_DIR/stop
-echo -n "Waiting"
-cnt=0
-while [ "$(ps -eaf | grep -v grep | grep karaf)" != "" ] ; do
- echo -n "."
- sleep 2
- let "cnt = cnt + 1"
- if [ "$cnt" -eq "10" ] ; then
- echo
- echo -n "$APP_NAME won't stop! Killing it.."
- sudo kill $(ps -eaf | grep -v grep | grep karaf | awk '{ print $2 }')
- fi
-done
-echo "Done"
-echo
-echo "Deleting $APP_NAME persistent state."
-sudo rm -rf $CURRENT_DIR
-sudo rm -rf $DATA_DIR
-echo
-echo "Starting $APP_NAME"
-sudo $BIN_DIR/start
-sleep 2
-echo -n "Waiting"
-while [ "$(grep xsql $KARAF_LOG | grep Successfully)" = "" ] ; do
- echo -n "."
- sleep 2
-done
-cnt=0
-while [ "$cnt" -lt "5" ] ; do
- echo -n "."
- sleep 2
- let "cnt = cnt + 1"
-done
-echo
-echo "Reset $APP_NAME is complete!"
-
diff --git a/vagrant-demo/scripts/vpp1-reset.sh b/vagrant-demo/scripts/vpp1-reset.sh
deleted file mode 100755
index a407ad137..000000000
--- a/vagrant-demo/scripts/vpp1-reset.sh
+++ /dev/null
@@ -1,95 +0,0 @@
-#! /bin/bash
-#
-# Script to reset the vpp1 Honeycomb agent.
-#
-# Copyright (c) 2016 Cisco Systems, Inc. and/or others. All rights reserved.
-
-if [ "$(id -un)" != "vagrant" ] || [ "$VM_NAME" != "(vpp1)" ]; then
- echo "ERROR: Must be run inside the vpp1 vagrant VM!"
- exit 1
-fi
-
-APP_NAME="VPP1 Honeycomb Agent"
-KARAF_HOME="$(dirname /opt/honeycomb/v3po-karaf*/bin)"
-BIN_DIR="$KARAF_HOME/bin"
-KARAF_LOG="$KARAF_HOME/data/log/karaf.log"
-CURRENT_DIR="$KARAF_HOME/etc/opendaylight/current"
-DATA_DIR="$KARAF_HOME/data"
-VPP2VPP_SRC_IP_ADDR="10.10.10.11"
-VPP2VPP_DST_IP_ADDR="10.10.10.12"
-VNI=1
-VRF_ID=7
-BRIDGE_ID=1
-SHG=1
-
-echo
-echo "Stopping VPP..."
-sudo stop vpp
-echo "Done"
-echo
-echo "Stopping $APP_NAME"
-sudo $BIN_DIR/stop
-echo -n "Waiting"
-cnt=0
-while [ "$(ps -eaf | grep -v grep | grep karaf)" != "" ] ; do
- echo -n "."
- sleep 2
- let "cnt = cnt + 1"
- if [ $cnt -eq 10 ] ; then
- echo
- echo -n "$APP_NAME won't stop! Killing it.."
- sudo kill $(ps -eaf | grep -v grep | grep karaf | awk '{ print $2 }')
- fi
-done
-echo "Done"
-echo
-echo "Deleting $APP_NAME persistent state."
-sudo rm -rf $DATA_DIR
-sudo rm -rf $CURRENT_DIR
-echo
-echo "Starting $APP_NAME"
-sudo $BIN_DIR/start
-echo "Starting VPP"
-sudo start vpp
-echo "Configuring vpp"
-sudo vppctl set int state GigabitEthernet0/9/0 up
-sudo vppctl set int state GigabitEthernet0/a/0 up
-sudo vppctl set int ip table GigabitEthernet0/a/0 7
-sudo vppctl set int ip address GigabitEthernet0/a/0 $VPP2VPP_SRC_IP_ADDR/24
-if [ "$1" = "vxlan" ] ; then
- sudo vppctl set int l2 bridge GigabitEthernet0/9/0 $BRIDGE_ID
- sudo vppctl create vxlan tunnel src $VPP2VPP_SRC_IP_ADDR dst $VPP2VPP_DST_IP_ADDR vni $VNI encap-vrf-id $VRF_ID decap-next l2
- sudo vppctl set int l2 bridge vxlan_tunnel0 $BRIDGE_ID $SHG
-fi
-
-echo
-echo "Waiting for $APP_NAME to initialize..."
-while [ "$(grep VPPOPER $KARAF_LOG)" = "" ] ; do
- echo -n "."
- sleep 2
-done
-cnt=0
-while [ "$cnt" -lt "5" ] ; do
- echo -n "."
- sleep 2
- let "cnt = cnt + 1"
-done
-echo
-echo VPP configuration:
-echo
-echo "show hardware:"
-sudo vppctl show hard
-echo
-echo "show inteface:"
-sudo vppctl show int
-echo
-echo "show ip fib:"
-sudo vppctl show ip fib
-if [ "$1" = "vxlan" ] ; then
- echo
- echo "show bridge $BRIDGE_ID detail:"
- sudo vppctl show bridge $BRIDGE_ID detail
-fi
-echo
-echo "Reset $APP_NAME is complete!"
-
diff --git a/vagrant-demo/scripts/vpp2-reset.sh b/vagrant-demo/scripts/vpp2-reset.sh
deleted file mode 100755
index 49be70dbc..000000000
--- a/vagrant-demo/scripts/vpp2-reset.sh
+++ /dev/null
@@ -1,105 +0,0 @@
-#! /bin/bash
-#
-# Script to reset the vpp1 Honeycomb agent.
-#
-# Copyright (c) 2016 Cisco Systems, Inc. and/or others. All rights reserved.
-
-if [ "$(id -un)" != "vagrant" ] || [ "$VM_NAME" != "(vpp2)" ]; then
- echo "ERROR: Must be run inside the vpp2 vagrant VM!"
- exit 1
-fi
-
-APP_NAME="VPP2 Honeycomb Agent"
-KARAF_HOME="$(dirname /opt/honeycomb/v3po-karaf*/bin)"
-BIN_DIR="$KARAF_HOME/bin"
-KARAF_LOG="$KARAF_HOME/data/log/karaf.log"
-CURRENT_DIR="$KARAF_HOME/etc/opendaylight/current"
-DATA_DIR="$KARAF_HOME/data"
-PERSISTENT_STATE="$CURRENT_DIR $DATA_DIR"
-VPP2VPP_SRC_IP_ADDR="10.10.10.12"
-VPP2VPP_DST_IP_ADDR="10.10.10.11"
-VNI=1
-VRF_ID=7
-BRIDGE_ID=1
-SHG=1
-
-echo
-echo "Stopping VPP..."
-sudo stop vpp
-echo "Done"
-echo
-echo "Stopping $APP_NAME"
-sudo $BIN_DIR/stop
-echo -n "Waiting"
-cnt=0
-while [ "$(ps -eaf | grep -v grep | grep karaf)" != "" ] ; do
- echo -n "."
- sleep 2
- let "cnt = cnt + 1"
- if [ $cnt -eq 10 ] ; then
- echo
- echo -n "$APP_NAME won't stop! Killing it.."
- sudo kill $(ps -eaf | grep -v grep | grep karaf | awk '{ print $2 }')
- fi
-done
-echo "Done"
-echo
-echo "Deleting $APP_NAME persistent state."
-sudo rm -rf $DATA_DIR
-sudo rm -rf $CURRENT_DIR
-echo
-echo "Starting $APP_NAME"
-sudo $BIN_DIR/start
-echo "Starting VPP"
-sudo start vpp
-echo "Configuring vpp"
-sudo vppctl set int state GigabitEthernet0/9/0 up
-sudo vppctl set int state GigabitEthernet0/a/0 up
-sudo vppctl set int ip table GigabitEthernet0/a/0 7
-sudo vppctl set int ip address GigabitEthernet0/a/0 $VPP2VPP_SRC_IP_ADDR/24
-if [ "$1" = "vxlan" ] ; then
- sudo vppctl set int l2 bridge GigabitEthernet0/9/0 $BRIDGE_ID
- sudo vppctl create vxlan tunnel src $VPP2VPP_SRC_IP_ADDR dst $VPP2VPP_DST_IP_ADDR vni $VNI encap-vrf-id $VRF_ID decap-next l2
- sudo vppctl set int l2 bridge vxlan_tunnel0 $BRIDGE_ID $SHG
-fi
-if [ "$1" = "vxlan" ] ; then
- echo
- echo "show bridge $BRIDGE_ID detail:"
- sudo vppctl show bridge $BRIDGE_ID detail
-fi
-echo
-echo "Waiting for $APP_NAME to initialize"
-while [ "$(grep VPPOPER $KARAF_LOG)" = "" ] ; do
- echo -n "."
- sleep 2
-done
-cnt=0
-while [ "$cnt" -lt "5" ] ; do
- echo -n "."
- sleep 2
- let "cnt = cnt + 1"
-done
-while [ $cnt -lt 5 ] ; do
- echo -n "."
- sleep 2
- let "cnt = cnt + 1"
-done
-echo
-echo VPP configuration:
-echo
-echo "show hardware:"
-sudo vppctl show hard
-echo
-echo "show inteface:"
-sudo vppctl show int
-echo
-echo "show ip fib:"
-sudo vppctl show ip fib
-if [ "$1" = "vxlan" ] ; then
- echo
- echo "show bridge $BRIDGE_ID detail:"
- sudo vppctl show bridge $BRIDGE_ID detail
-fi
-echo
-echo "Reset $APP_NAME is complete!"
-