Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 1 | # -*- mode: ruby -*- |
| 2 | # vi: set ft=ruby : |
| 3 | |
| 4 | Vagrant.configure(2) do |config| |
| 5 | |
| 6 | # Pick the right distro and bootstrap, default is ubuntu1404 |
| 7 | distro = ENV['VPP_VAGRANT_DISTRO'] |
| 8 | if distro == 'centos7' |
| 9 | config.vm.box = "puppetlabs/centos-7.0-64-nocm" |
| 10 | config.vm.provision 'shell', path: 'bootstrap.centos7.sh' |
| 11 | else |
| 12 | config.vm.box = "puppetlabs/ubuntu-14.04-64-nocm" |
| 13 | config.vm.provision 'shell', path: 'bootstrap.ubuntu1404.sh' |
| 14 | end |
| 15 | |
| 16 | # vagrant-cachier caches apt/yum etc to speed subsequent |
| 17 | # vagrant up |
| 18 | # to enable, run |
| 19 | # vagrant plugin install vagrant-cachier |
| 20 | # |
| 21 | if Vagrant.has_plugin?("vagrant-cachier") |
| 22 | config.cache.scope = :box |
| 23 | end |
| 24 | |
Vincent JARDIN | 1d3be19 | 2016-01-14 17:01:08 -0800 | [diff] [blame] | 25 | # Define some physical ports for your VMs to be used by DPDK |
| 26 | nics = 0 |
| 27 | if ENV.key?('VPP_VAGRANT_NICS') |
| 28 | nics = ENV['VPP_VAGRANT_NICS'].to_i(10) |
| 29 | end |
| 30 | for i in 1..nics |
| 31 | config.vm.network "private_network", type: "dhcp" |
| 32 | end |
| 33 | |
Ed Warnicke | b73f267 | 2015-12-14 16:08:45 -0700 | [diff] [blame] | 34 | # use http proxy if avaiable |
| 35 | if ENV['http_proxy'] && Vagrant.has_plugin?("vagrant-proxyconf") |
| 36 | config.proxy.http = "$http_proxy" |
| 37 | config.proxy.https = "$https_proxy" |
| 38 | config.proxy.no_proxy = "localhost,127.0.0.1" |
| 39 | end |
| 40 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 41 | config.vm.synced_folder "../../", "/vpp", disabled: false |
| 42 | config.vm.provider "virtualbox" do |vb| |
| 43 | vb.memory = "4096" |
| 44 | end |
| 45 | config.vm.provider "vmware_fusion" do |fusion,override| |
| 46 | fusion.vmx["memsize"] = "4096" |
| 47 | end |
| 48 | config.vm.provider "vmware_workstation" do |vws,override| |
| 49 | vws.vmx["memsize"] = "8192" |
| 50 | vws.vmx["numvcpus"] = "4" |
| 51 | end |
| 52 | end |