[CORD-2259]
Xenial (16.04) compat

Change-Id: I1cc9fd7b259f3101aaf46047dc1355257fd583a3
diff --git a/Makefile b/Makefile
index 55e00b3..798961f 100644
--- a/Makefile
+++ b/Makefile
@@ -148,7 +148,7 @@
 	$(ANSIBLE_PB) $(PI)/bootstrap-dev-env.yml $(LOGCMD)
 
 vagrant-destroy:
-	$(VAGRANT) destroy -f $(LOGCMD)
+	$(VAGRANT) destroy -f $(LOGCMD) || true
 	rm -f $(M)/vagrant-up $(M)/vagrant-ssh-install $(VAGRANT_SSH_CONF)
 
 virsh-domain-destroy:
diff --git a/scenarios/cord/Vagrantfile b/scenarios/cord/Vagrantfile
index 0eb75e2..1ffce2c 100644
--- a/scenarios/cord/Vagrantfile
+++ b/scenarios/cord/Vagrantfile
@@ -30,8 +30,8 @@
     d.vm.provider :libvirt do |v, override|
       v.memory = settings['dev_vm_mem']
       v.cpus = settings['dev_vm_cpu']
-      override.vm.synced_folder $cordpath, settings['build_cord_dir'], type: "nfs"
-      override.vm.synced_folder settings['host_cord_profile_dir'], settings['build_cord_profile_dir'], type: "nfs"
+      override.vm.synced_folder $cordpath, settings['build_cord_dir'], type: "nfs", nfs_udp: false, nfs_version: 4
+      override.vm.synced_folder settings['host_cord_profile_dir'], settings['build_cord_profile_dir'], type: "nfs", nfs_udp: false, nfs_version: 4
     end
   end
 
@@ -65,7 +65,7 @@
       v.memory = settings['head_vm_mem']
       v.cpus = settings['head_vm_cpu']
       v.storage :file, :size => '100G', :type => 'qcow2'
-      override.vm.synced_folder $cordpath, $ciab_dir, type: "nfs"
+      override.vm.synced_folder $cordpath, $ciab_dir, type: "nfs", nfs_udp: false, nfs_version: 4
       override.vm.provision :ansible do |ansible|
         ansible.playbook = $cordpath + "/build/ansible/add-extra-drive.yml" # Needs testing
       end
diff --git a/scenarios/mock/Vagrantfile b/scenarios/mock/Vagrantfile
index f688ee9..1b39bf9 100644
--- a/scenarios/mock/Vagrantfile
+++ b/scenarios/mock/Vagrantfile
@@ -25,9 +25,12 @@
       vb.memory = settings['head_vm_mem']
       vb.cpus = settings['head_vm_cpu']
     end
-    d.vm.provider :libvirt do |v|
+    d.vm.provider :libvirt do |v, override|
       v.memory = settings['head_vm_mem']
       v.cpus = settings['head_vm_cpu']
+      override.vm.synced_folder "../../../", "/opt/cord/", type: "nfs", nfs_udp: false, nfs_version: 4
+      override.vm.synced_folder "../../../../cord_profile/", "/opt/cord_profile/", type: "nfs", nfs_udp: false, nfs_version: 4
+      override.vm.synced_folder "../../platform-install/credentials/", "/opt/credentials/", type: "nfs", nfs_udp: false, nfs_version: 4
     end
   end
 
diff --git a/scenarios/single/Vagrantfile b/scenarios/single/Vagrantfile
index b8092c8..a1c07cd 100644
--- a/scenarios/single/Vagrantfile
+++ b/scenarios/single/Vagrantfile
@@ -25,9 +25,12 @@
       vb.memory = settings['head_vm_mem']
       vb.cpus = settings['head_vm_cpu']
     end
-    d.vm.provider :libvirt do |v|
+    d.vm.provider :libvirt do |v, override|
       v.memory = settings['head_vm_mem']
       v.cpus = settings['head_vm_cpu']
+      override.vm.synced_folder "../../../", "/opt/cord/", type: "nfs", nfs_udp: false, nfs_version: 4
+      override.vm.synced_folder "../../../../cord_profile/", "/opt/cord_profile/", type: "nfs", nfs_udp: false, nfs_version: 4
+      override.vm.synced_folder "../../platform-install/credentials/", "/opt/credentials/", type: "nfs", nfs_udp: false, nfs_version: 4
     end
   end
 
diff --git a/scripts/cord-bootstrap.sh b/scripts/cord-bootstrap.sh
index 8ea82e4..1e1fc66 100755
--- a/scripts/cord-bootstrap.sh
+++ b/scripts/cord-bootstrap.sh
@@ -31,6 +31,17 @@
 # CORD versioning
 REPO_BRANCH="${REPO_BRANCH:-master}"
 
+# Tool/OS versioning
+UBUNTU_VERSION="ubuntu/trusty64"
+
+HOST_RELEASE=`lsb_release -c -s`
+
+if [ ${HOST_RELEASE} = "trusty" ]; then
+  VAGRANT_LIBVIRT_VERSION="0.0.35"
+else
+  VAGRANT_LIBVIRT_VERSION="0.0.40"
+fi
+
 # Functions
 function run_stage {
     echo "==> "$1": Starting"
@@ -105,8 +116,8 @@
     sudo apt-get -y install qemu-kvm libvirt-bin libvirt-dev nfs-kernel-server
     sudo adduser $USER libvirtd
 
-    VAGRANT_SHA256SUM="faff6befacc7eed3978b4b71f0dbb9c135c01d8a4d13236bda2f9ed53482d2c4"  # version 1.9.3
-    curl -o /tmp/vagrant.deb https://releases.hashicorp.com/vagrant/1.9.3/vagrant_1.9.3_x86_64.deb
+    VAGRANT_SHA256SUM="2f9498a83b3d650fcfcfe0ec7971070fcd3803fad6470cf7da871caf2564d84f"  # version 2.0.1
+    curl -o /tmp/vagrant.deb https://releases.hashicorp.com/vagrant/2.0.1/vagrant_2.0.1_x86_64.deb
     echo "$VAGRANT_SHA256SUM  /tmp/vagrant.deb" | sha256sum -c -
     sudo dpkg -i /tmp/vagrant.deb
   fi
@@ -114,13 +125,13 @@
   run_stage cloudlab_setup
 
   echo "Installing vagrant plugins if needed..."
-  vagrant plugin list | grep -q vagrant-libvirt || vagrant plugin install vagrant-libvirt --plugin-version 0.0.35
+  vagrant plugin list | grep -q vagrant-libvirt || vagrant plugin install vagrant-libvirt --plugin-version ${VAGRANT_LIBVIRT_VERSION}
   vagrant plugin list | grep -q vagrant-mutate || vagrant plugin install vagrant-mutate
   vagrant plugin list | grep -q vagrant-hosts || vagrant plugin install vagrant-hosts
 
-  if ! vagrant box list | grep -q ubuntu/trusty64.*libvirt
+  if ! vagrant box list | grep -q ${UBUNTU_VERSION}.*libvirt
   then
-    add_box ubuntu/trusty64
+    add_box ${UBUNTU_VERSION}
   fi
 }