Vagrant fails if Vagrantfile is a symlink on Windows 10. 30/8530/2
authorDave Wallace <dwallacelf@gmail.com>
Mon, 25 Sep 2017 20:12:16 +0000 (16:12 -0400)
committerFlorin Coras <florin.coras@gmail.com>
Mon, 25 Sep 2017 22:09:19 +0000 (22:09 +0000)
- Revert Vagrantfile symlink to the default
- Update README and env.sh

Change-Id: Ib1a557b897e0217b162c31118a4c265769dd1760
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
extras/vagrant/README
extras/vagrant/Vagrantfile [changed from symlink to file mode: 0644]
extras/vagrant/Vagrantfile.default [deleted file]
extras/vagrant/env.sh

index 238c90c..4b7c7aa 100644 (file)
@@ -4,21 +4,21 @@ This is a vagrant environment for VPP.
 
 VPP currently works under Linux and has support for:
 
-- Ubuntu 14.04, Ubuntu 16.04 and Centos7.2
+- Ubuntu 16.04 and Centos7.2
 
 The VM builds VPP from source which can be located at /vpp
 
 VM PARTICULARS:
 This vagrant environment creates a VM based on environment variables found in ./env.sh
-To use, edit env.sh then
+To customize the vm for your use case, edit env.sh then
   source ./env.sh
   vagrant up
 
 By default, the VM created is/has:
-- Ubuntu 14.04
+- Ubuntu 16.04
 - 2 vCPUs
 - 4G of RAM
-- 2 NICs (1 x NAT - host access, 1 x VPP DPDK enabled)
+- 3 NICs (1 x NAT - host access, 2 x VPP DPDK enabled)
 
 PROVIDERS:
 
@@ -26,3 +26,18 @@ Supported vagrant providers are:
 
 - Virtualbox, VMware Fusion/Workstation, Libvirt
 
+ALTERNATE CONFIGURATIONS
+
+The following Vagrantfiles provide alternate configurations for specific testing purposes.  To use them,
+
+1. Copy the desired configuration to Vagrantfile
+2. Run "vagrant up"
+3. vagrant ssh <vm name>
+
+When testing is complete
+4. Run "vagrant destroy" to stop the VM's and delete files.
+5. Run "git checkout -- Vagrantfile" to restore the default configuration
+
+Available Vagrantfiles:
+
+Vagrantfile.vcl_test  - Create two vm's for multi-host VppCommLib testing
deleted file mode 120000 (symlink)
index a0bc225254d285318e3dec5aef3fcb61ccc47c6f..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-Vagrantfile.default
\ No newline at end of file
new file mode 100644 (file)
index 0000000000000000000000000000000000000000..8d6d02a637062781024b0defe9a7d3a6c5adf62f
--- /dev/null
@@ -0,0 +1,111 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+Vagrant.configure(2) do |config|
+
+  # Pick the right distro and bootstrap, default is ubuntu1604
+  distro = ( ENV['VPP_VAGRANT_DISTRO'] || "ubuntu1604")
+  if distro == 'centos7'
+    config.vm.box = "puppetlabs/centos-7.2-64-nocm"
+    config.ssh.insert_key = false
+  else
+    config.vm.box = "puppetlabs/ubuntu-16.04-64-nocm"
+  end
+  config.vm.box_check_update = false
+
+  config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"update.sh")
+  config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"build.sh"), :args => "/vpp vagrant"
+
+  post_build = ( ENV['VPP_VAGRANT_POST_BUILD'] )
+  if post_build == "test"
+    config.vm.provision "shell", inline: "echo Testing VPP; cd /vpp; make test"
+  elsif post_build == "install"
+    config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"install.sh"), :args => "/vpp"
+    config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"clearinterfaces.sh")
+    config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"run.sh")
+  end
+
+  # 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 some physical ports for your VMs to be used by DPDK
+  nics = (ENV['VPP_VAGRANT_NICS'] || "2").to_i(10)
+  for i in 1..nics
+    config.vm.network "private_network", type: "dhcp"
+  end
+
+  # use http proxy if avaiable
+  if ENV['http_proxy'] && Vagrant.has_plugin?("vagrant-proxyconf")
+   config.proxy.http     = ENV['http_proxy']
+   config.proxy.https    = ENV['https_proxy']
+   config.proxy.no_proxy = "localhost,127.0.0.1"
+  end
+
+  vmcpu=(ENV['VPP_VAGRANT_VMCPU'] || 2)
+  vmram=(ENV['VPP_VAGRANT_VMRAM'] || 4096)
+
+  config.ssh.forward_agent = true
+  config.ssh.forward_x11 = true
+
+  config.vm.provider "virtualbox" do |vb|
+      vb.customize ["modifyvm", :id, "--ioapic", "on"]
+      vb.memory = "#{vmram}"
+      vb.cpus = "#{vmcpu}"
+
+      # rsync the vpp directory if provision hasn't happened yet
+      unless File.exist? (".vagrant/machines/default/virtualbox/action_provision")
+        config.vm.synced_folder "../../", "/vpp", type: "rsync",
+         rsync__auto: false,
+         rsync__exclude: [
+          "build-root/build*/",
+          "build-root/install*/",
+          "build-root/images*/",
+          "build-root/*.deb",
+          "build-root/*.rpm",
+          "build-root/*.changes",
+          "build-root/python",
+          "build-root/deb/debian/*.dkms",
+          "build-root/deb/debian/*.install",
+          "build-root/deb/debian/changes",
+          "build-root/tools"]
+      end
+
+      #support for the SSE4.x instruction is required in some versions of VB.
+      vb.customize ["setextradata", :id, "VBoxInternal/CPUM/SSE4.1", "1"]
+      vb.customize ["setextradata", :id, "VBoxInternal/CPUM/SSE4.2", "1"]
+  end
+  config.vm.provider "vmware_fusion" do |fusion,override|
+    fusion.vmx["memsize"] = "#{vmram}"
+    fusion.vmx["numvcpus"] = "#{vmcpu}"
+  end
+  config.vm.provider "libvirt" do |lv|
+    lv.memory = "#{vmram}"
+    lv.cpus = "#{vmcpu}"
+  end
+  config.vm.provider "vmware_workstation" do |vws,override|
+    vws.vmx["memsize"] = "#{vmram}"
+    vws.vmx["numvcpus"] = "#{vmcpu}"
+  end
+end
diff --git a/extras/vagrant/Vagrantfile.default b/extras/vagrant/Vagrantfile.default
deleted file mode 100644 (file)
index 8d6d02a..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-# -*- mode: ruby -*-
-# vi: set ft=ruby :
-
-Vagrant.configure(2) do |config|
-
-  # Pick the right distro and bootstrap, default is ubuntu1604
-  distro = ( ENV['VPP_VAGRANT_DISTRO'] || "ubuntu1604")
-  if distro == 'centos7'
-    config.vm.box = "puppetlabs/centos-7.2-64-nocm"
-    config.ssh.insert_key = false
-  else
-    config.vm.box = "puppetlabs/ubuntu-16.04-64-nocm"
-  end
-  config.vm.box_check_update = false
-
-  config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"update.sh")
-  config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"build.sh"), :args => "/vpp vagrant"
-
-  post_build = ( ENV['VPP_VAGRANT_POST_BUILD'] )
-  if post_build == "test"
-    config.vm.provision "shell", inline: "echo Testing VPP; cd /vpp; make test"
-  elsif post_build == "install"
-    config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"install.sh"), :args => "/vpp"
-    config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"clearinterfaces.sh")
-    config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"run.sh")
-  end
-
-  # 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 some physical ports for your VMs to be used by DPDK
-  nics = (ENV['VPP_VAGRANT_NICS'] || "2").to_i(10)
-  for i in 1..nics
-    config.vm.network "private_network", type: "dhcp"
-  end
-
-  # use http proxy if avaiable
-  if ENV['http_proxy'] && Vagrant.has_plugin?("vagrant-proxyconf")
-   config.proxy.http     = ENV['http_proxy']
-   config.proxy.https    = ENV['https_proxy']
-   config.proxy.no_proxy = "localhost,127.0.0.1"
-  end
-
-  vmcpu=(ENV['VPP_VAGRANT_VMCPU'] || 2)
-  vmram=(ENV['VPP_VAGRANT_VMRAM'] || 4096)
-
-  config.ssh.forward_agent = true
-  config.ssh.forward_x11 = true
-
-  config.vm.provider "virtualbox" do |vb|
-      vb.customize ["modifyvm", :id, "--ioapic", "on"]
-      vb.memory = "#{vmram}"
-      vb.cpus = "#{vmcpu}"
-
-      # rsync the vpp directory if provision hasn't happened yet
-      unless File.exist? (".vagrant/machines/default/virtualbox/action_provision")
-        config.vm.synced_folder "../../", "/vpp", type: "rsync",
-         rsync__auto: false,
-         rsync__exclude: [
-          "build-root/build*/",
-          "build-root/install*/",
-          "build-root/images*/",
-          "build-root/*.deb",
-          "build-root/*.rpm",
-          "build-root/*.changes",
-          "build-root/python",
-          "build-root/deb/debian/*.dkms",
-          "build-root/deb/debian/*.install",
-          "build-root/deb/debian/changes",
-          "build-root/tools"]
-      end
-
-      #support for the SSE4.x instruction is required in some versions of VB.
-      vb.customize ["setextradata", :id, "VBoxInternal/CPUM/SSE4.1", "1"]
-      vb.customize ["setextradata", :id, "VBoxInternal/CPUM/SSE4.2", "1"]
-  end
-  config.vm.provider "vmware_fusion" do |fusion,override|
-    fusion.vmx["memsize"] = "#{vmram}"
-    fusion.vmx["numvcpus"] = "#{vmcpu}"
-  end
-  config.vm.provider "libvirt" do |lv|
-    lv.memory = "#{vmram}"
-    lv.cpus = "#{vmcpu}"
-  end
-  config.vm.provider "vmware_workstation" do |vws,override|
-    vws.vmx["memsize"] = "#{vmram}"
-    vws.vmx["numvcpus"] = "#{vmcpu}"
-  end
-end
index f0edfd8..bd329ea 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 
-export VPP_VAGRANT_DISTRO="ubuntu1404"
+export VPP_VAGRANT_DISTRO="ubuntu1604"
 export VPP_VAGRANT_NICS=2
 export VPP_VAGRANT_VMCPU=4
 export VPP_VAGRANT_VMRAM=4096