[CORD-2463]
Make box used by Vagrant VM's a parameter

Change-Id: I19437de9126146a4e102b6db3288e6ae73b1354a
diff --git a/scenarios/controlpod/Vagrantfile b/scenarios/controlpod/Vagrantfile
index 8af7476..b8e0d1f 100644
--- a/scenarios/controlpod/Vagrantfile
+++ b/scenarios/controlpod/Vagrantfile
@@ -8,7 +8,7 @@
 
 Vagrant.configure("2") do |config|
 
-  config.vm.box = settings["head_vagrant_box"]
+  config.vm.box = settings["vagrant_box"]
 
   # sync these folders with VM
   config.vm.synced_folder "../../../", "/opt/cord/", create: true
diff --git a/scenarios/controlpod/config.yml b/scenarios/controlpod/config.yml
index d904149..bf270ec 100644
--- a/scenarios/controlpod/config.yml
+++ b/scenarios/controlpod/config.yml
@@ -23,7 +23,7 @@
 build_cord_dir: /opt/cord
 
 # Vagrant VM configuration
-head_vagrant_box: "generic/ubuntu1604"
+vagrant_box: "bento/ubuntu-16.04"
 head_vm_mem: 4096
 head_vm_cpu: 8
 head_vm_ip: "192.168.46.100"
diff --git a/scenarios/cord/Vagrantfile b/scenarios/cord/Vagrantfile
index 1ffce2c..85fc03a 100644
--- a/scenarios/cord/Vagrantfile
+++ b/scenarios/cord/Vagrantfile
@@ -13,7 +13,7 @@
 
   config.vm.define "corddev" do |d|
     d.ssh.forward_agent = true
-    d.vm.box = "ubuntu/trusty64"
+    d.vm.box = settings["vagrant_box"]
     d.vm.hostname = "corddev"
     d.vm.network "private_network", ip: "10.100.198.200"
     d.vm.synced_folder $cordpath, settings['build_cord_dir']
@@ -36,7 +36,7 @@
   end
 
   config.vm.define "head1" do |d|
-    d.vm.box = "ubuntu/trusty64"
+    d.vm.box = settings["vagrant_box"]
     d.vm.hostname = "head1"
     d.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: '*'
     d.vm.network "private_network", ip: "10.100.198.201"
diff --git a/scenarios/cord/config.yml b/scenarios/cord/config.yml
index 8d6e561..3ef9c83 100644
--- a/scenarios/cord/config.yml
+++ b/scenarios/cord/config.yml
@@ -75,6 +75,8 @@
   - deploy-openstack
 
 # Vagrant VM configuration
+vagrant_box: "ubuntu/trusty64"
+
 vagrant_vms:
   - corddev
   - head1
diff --git a/scenarios/mock/Vagrantfile b/scenarios/mock/Vagrantfile
index 1b39bf9..4fa4b65 100644
--- a/scenarios/mock/Vagrantfile
+++ b/scenarios/mock/Vagrantfile
@@ -8,7 +8,7 @@
 
 Vagrant.configure("2") do |config|
 
-  config.vm.box = "ubuntu/trusty64"
+  config.vm.box = settings["vagrant_box"]
 
   # sync these folders with VM
   config.vm.synced_folder "../../../", "/opt/cord/", create: true
diff --git a/scenarios/mock/config.yml b/scenarios/mock/config.yml
index 1574390..d80f177 100644
--- a/scenarios/mock/config.yml
+++ b/scenarios/mock/config.yml
@@ -23,6 +23,7 @@
 build_cord_dir: /opt/cord
 
 # Vagrant VM configuration
+vagrant_box: "ubuntu/trusty64"
 head_vm_mem: 2048
 head_vm_cpu: 1
 head_vm_ip: "192.168.46.100"
diff --git a/scenarios/opencloud/Vagrantfile b/scenarios/preppedpod/Vagrantfile
similarity index 97%
rename from scenarios/opencloud/Vagrantfile
rename to scenarios/preppedpod/Vagrantfile
index 626d792..99f97e2 100644
--- a/scenarios/opencloud/Vagrantfile
+++ b/scenarios/preppedpod/Vagrantfile
@@ -8,7 +8,7 @@
 
 Vagrant.configure(2) do |config|
 
-  config.vm.box = "ubuntu/trusty64"
+  config.vm.box = settings["vagrant_box"]
 
   config.vm.define "head1" do |h|
     h.vm.hostname = "head1"
diff --git a/scenarios/opencloud/config.yml b/scenarios/preppedpod/config.yml
similarity index 90%
rename from scenarios/opencloud/config.yml
rename to scenarios/preppedpod/config.yml
index 0de7898..14d06ad 100644
--- a/scenarios/opencloud/config.yml
+++ b/scenarios/preppedpod/config.yml
@@ -13,8 +13,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# opencloud Scenario
-# For a virtual install, physical does not use VMs
+# preppedpod Scenario - install CORD on prepared systems with OS installed
+# Only used with a virtual install, physical does not use VMs
 
 # opencloud profile config
 frontend_only: False
@@ -54,11 +54,11 @@
   - prep-headnode
 
 # Start elasticstack before XOS/ONOS, which log to it
-start_xos_prereqs:
-  - deploy-elasticstack
-
-deploy_onos_prereqs:
-  - deploy-elasticstack
+#start_xos_prereqs:
+#  - deploy-elasticstack
+#
+#deploy_onos_prereqs:
+#  - deploy-elasticstack
 
 # node topology, used to bring up management interfaces
 physical_node_list:
@@ -77,6 +77,8 @@
   - compute1
   - compute2
 
+# Vagrant VM configuration
+vagrant_box: "ubuntu/trusty64"
 head_vm_mem: 16384
 head_vm_cpu: 8
 
diff --git a/scenarios/single/Vagrantfile b/scenarios/single/Vagrantfile
index a1c07cd..b8e0d1f 100644
--- a/scenarios/single/Vagrantfile
+++ b/scenarios/single/Vagrantfile
@@ -8,7 +8,7 @@
 
 Vagrant.configure("2") do |config|
 
-  config.vm.box = "ubuntu/trusty64"
+  config.vm.box = settings["vagrant_box"]
 
   # sync these folders with VM
   config.vm.synced_folder "../../../", "/opt/cord/", create: true
diff --git a/scenarios/single/config.yml b/scenarios/single/config.yml
index b32035e..4bf4450 100644
--- a/scenarios/single/config.yml
+++ b/scenarios/single/config.yml
@@ -25,6 +25,7 @@
 build_cord_dir: /opt/cord
 
 # Vagrant VM configuration
+vagrant_box: "ubuntu/trusty64"
 head_vm_mem: 4096
 head_vm_cpu: 8
 head_vm_ip: "192.168.46.100"
diff --git a/scripts/cord-bootstrap.sh b/scripts/cord-bootstrap.sh
index cbfcfc0..34ac885 100755
--- a/scripts/cord-bootstrap.sh
+++ b/scripts/cord-bootstrap.sh
@@ -125,28 +125,20 @@
   echo "Installing vagrant plugins if needed..."
   vagrant plugin list | grep -q vagrant-libvirt || vagrant plugin install vagrant-libvirt --plugin-version ${VAGRANT_LIBVIRT_VERSION}
   vagrant plugin list | grep -q vagrant-hosts || vagrant plugin install vagrant-hosts
+  vagrant plugin list | grep -q vagrant-mutate || vagrant plugin install vagrant-mutate
 
   echo "Obtaining libvirt image of Ubuntu"
 
   if [[ $XENIAL -eq 1 ]]; then
-    add_xenial
+    UBUNTU_VERSION=${UBUNTU_VERSION:-bento/ubuntu-16.04}
   else
-    add_trusty
+    UBUNTU_VERSION=${UBUNTU_VERSION:-ubuntu/trusty64}
   fi
-}
 
-function add_trusty() {
-  UBUNTU_VERSION=${UBUNTU_VERSION:-ubuntu/trusty64}
-  vagrant plugin list | grep -q vagrant-mutate || vagrant plugin install vagrant-mutate
-  vagrant box list | grep ${UBUNTU_VERSION} | grep virtualbox || vagrant box add ${UBUNTU_VERSION}
+  vagrant box list | grep ${UBUNTU_VERSION} | grep virtualbox || vagrant box add --provider virtualbox ${UBUNTU_VERSION}
   vagrant box list | grep ${UBUNTU_VERSION} | grep libvirt || vagrant mutate ${UBUNTU_VERSION} libvirt --input-provider virtualbox
 }
 
-function add_xenial() {
-  UBUNTU_VERSION=${UBUNTU_VERSION:-generic/ubuntu1604}
-  vagrant box list | grep ${UBUNTU_VERSION} | grep libvirt || vagrant box add --provider libvirt ${UBUNTU_VERSION}
-}
-
 function cloudlab_setup() {
 
   # Don't do anything if not a CloudLab node