blob: f00233d632ce6be90bf4d86239a2cb2c4463e0b8 [file] [log] [blame]
Ed Warnickecb9cada2015-12-08 15:45:58 -07001# -*- mode: ruby -*-
2# vi: set ft=ruby :
3
4Vagrant.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 JARDIN1d3be192016-01-14 17:01:08 -080025 # 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 Warnickeb73f2672015-12-14 16:08:45 -070034 # 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 Warnickecb9cada2015-12-08 15:45:58 -070041 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
52end