File tree Expand file tree Collapse file tree 3 files changed +31
-5
lines changed
Expand file tree Collapse file tree 3 files changed +31
-5
lines changed Original file line number Diff line number Diff line change 11* .log
22.vagrant
3+ * .ova
Original file line number Diff line number Diff line change 1+ # Scripts to build the tutorial VM
2+
3+ ## Requirements
4+
5+ - [ Vagrant] ( https://www.vagrantup.com/ ) (tested v2.2.5)
6+ - [ VirtualBox] ( https://www.virtualbox.org/wiki/Downloads ) (tested with v5.2.32)
7+
8+ ## Steps to build
9+
10+ If you want to provision and use the VM locally on your machine:
11+
12+ cd util/vm
13+ vagrant up
14+
15+ Otherwise, if you want to export the VM in ` .ova ` format for distribution to
16+ tutorial attendees:
17+
18+ cd util/vm
19+ ./build-vm.sh
20+
21+ This script will:
22+
23+ 1 . provision the VM using Vagrant;
24+ 2 . reduce VM disk size;
25+ 3 . generate a file named ` ngsdn-tutorial.ova ` .
26+
27+ Use credentials ` sdn ` /` rocks ` to log in the Ubuntu system.
Original file line number Diff line number Diff line change 22
33set -xe
44
5- DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null 2>&1 && pwd ) "
6-
75function wait_vm_shutdown {
86 set +x
97 while vboxmanage showvminfo $1 | grep -c " running (since" ; do
10- echo " Waiting for VM to shutdown..."
11- sleep 1
8+ echo " Waiting for VM to shutdown..."
9+ sleep 1
1210 done
1311 sleep 2
1412 set -x
@@ -18,7 +16,7 @@ function wait_vm_shutdown {
1816vagrant up
1917
2018VB_UUID=$( cat .vagrant/machines/default/virtualbox/id)
21- VBoxManage snapshot ${VB_UUID} take " pre-cleanup"
19+ VBoxManage snapshot " ${VB_UUID} " take " pre-cleanup"
2220
2321# Cleanup
2422vagrant ssh -c ' bash /vagrant/cleanup.sh'
You can’t perform that action at this time.
0 commit comments