Enhanced the installer's test mode such that multiple development users
can create independent vagrant VM based clusters on the same bare metal
server. This reduces the number of servers required to do development
and testing of the voltha HA cluster.
Updated the production installer to start a 3 node docker swarm cluster
once installation is completed.
Added an option to the production installer to use a different QEMU/KVM
network to enable testing of the installer using vagrant based VMs on
the same server as the installer. The production installer will use the
default network otherwise.
Further provisioning of the installed environment will be submitted in
subsequent updates as the HA implementation progresses.

Change-Id: I62424e882d4a7f322acb9e26a9ee588c6fa91ca1
diff --git a/install/BuildVoltha.sh b/install/BuildVoltha.sh
index 67a6183..8c3af94 100755
--- a/install/BuildVoltha.sh
+++ b/install/BuildVoltha.sh
@@ -1,18 +1,27 @@
 #!/bin/bash
 
-vmName="voltha_voltha"
+uId=`id -u`
+vmName="voltha_voltha${uId}"
 
 # Voltha directory
 cd ..
 
+# Rename voltha for multi-user support
+sed -i -e '/server_name/s/.*/server_name: "voltha'${uId}'"/' settings.vagrant.yaml
+# Build voltha in test mode
+if [ $# -eq 1 -a "$1" == "test" ]; then
+	sed -i -e '/test_mode/s/.*/test_mode: "true"/' settings.vagrant.yaml
+fi
+
 # Destroy the VM if it's running
-vagrant destroy voltha
+vagrant destroy voltha${uId}
 
 # Bring up the VM.
-vagrant up voltha
+vagrant up voltha${uId}
 
 # Get the VM's ip address
 ipAddr=`virsh domifaddr $vmName | tail -n +3 | awk '{ print $4 }' | sed -e 's~/.*~~'`
 
+
 # Run all the build commands
-ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i .vagrant/machines/voltha/libvirt/private_key vagrant@$ipAddr "cd /cord/incubator/voltha && . env.sh && make fetch && make"
+ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i .vagrant/machines/voltha${uId}/libvirt/private_key vagrant@$ipAddr "cd /cord/incubator/voltha && . env.sh && make fetch && make build"