4 Vagrant.configure(2) do |config|
6 # Pick the right distro and bootstrap, default is ubuntu1404
7 distro = ( ENV['VPP_VAGRANT_DISTRO'] || "ubuntu1404")
9 config.vm.box = "puppetlabs/centos-7.2-64-nocm"
10 config.ssh.insert_key = false
12 config.vm.box = "puppetlabs/ubuntu-14.04-64-nocm"
14 config.vm.box_check_update = false
16 config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"update.sh")
17 config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"clone.sh")
18 config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"build.sh"), :args => "/home/vagrant/git/vpp vagrant"
19 config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"install.sh"), :args => "/home/vagrant/git/vpp"
20 config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"clearinterfaces.sh")
21 config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"run.sh")
23 # Add .gnupg dir in so folks can sign patches
24 # Note, as gnupg puts socket files in that dir, we have
25 # to be cautious and make sure we are dealing with a plain file
26 homedir = File.expand_path("~/")
27 Dir["#{homedir}/.gnupg/**/*"].each do |fname|
29 destname = fname.sub(Regexp.escape("#{homedir}/"),'')
30 config.vm.provision "file", source: fname, destination: destname
34 # Copy in the .gitconfig if it exists
35 if File.file?(File.expand_path("~/.gitconfig"))
36 config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig"
39 # vagrant-cachier caches apt/yum etc to speed subsequent
42 # vagrant plugin install vagrant-cachier
44 if Vagrant.has_plugin?("vagrant-cachier")
45 config.cache.scope = :box
48 # Define some physical ports for your VMs to be used by DPDK
49 nics = (ENV['VPP_VAGRANT_NICS'] || "2").to_i(10)
51 config.vm.network "private_network", type: "dhcp"
54 # use http proxy if avaiable
55 if ENV['http_proxy'] && Vagrant.has_plugin?("vagrant-proxyconf")
56 config.proxy.http = ENV['http_proxy']
57 config.proxy.https = ENV['https_proxy']
58 config.proxy.no_proxy = "localhost,127.0.0.1"
61 vmcpu=(ENV['VPP_VAGRANT_VMCPU'] || 2)
62 vmram=(ENV['VPP_VAGRANT_VMRAM'] || 4096)
64 config.ssh.forward_agent = true
66 config.vm.synced_folder "../../", "/vpp", disabled: false
68 config.vm.provider "virtualbox" do |vb|
69 vb.customize ["modifyvm", :id, "--ioapic", "on"]
70 vb.memory = "#{vmram}"
73 #support for the SSE4.x instruction is required in some versions of VB.
74 vb.customize ["setextradata", :id, "VBoxInternal/CPUM/SSE4.1", "1"]
75 vb.customize ["setextradata", :id, "VBoxInternal/CPUM/SSE4.2", "1"]
77 config.vm.provider "vmware_fusion" do |fusion,override|
78 fusion.vmx["memsize"] = "#{vmram}"
79 fusion.vmx["numvcpus"] = "#{vmcpu}"
81 config.vm.provider "libvirt" do |lv|
82 lv.memory = "#{vmram}"
85 config.vm.provider "vmware_workstation" do |vws,override|
86 vws.vmx["memsize"] = "#{vmram}"
87 vws.vmx["numvcpus"] = "#{vmcpu}"