added demos to the repo
[groupbasedpolicy.git] / demos / gbpsfc-env / Vagrantfile
1
2 # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
3 VAGRANTFILE_API_VERSION = "2"
4
5 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
6   odl=ENV['ODL']
7   config.vm.provider "virtualbox" do |vb|
8     vb.memory = "512"
9   end
10   if Vagrant.has_plugin?("vagrant-cachier")
11     config.cache.scope = :box
12   end
13   # run our bootstrapping for the system
14   config.vm.provision 'shell', path: 'bootstrap.sh', :args => odl
15
16   num_nodes = (ENV['NUM_NODES'] || 1).to_i
17
18   # ip configuration
19   ip_base = (ENV['SUBNET'] || "192.168.50.")
20   ips = num_nodes.times.collect { |n| ip_base + "#{n+70}" }
21
22   num_nodes.times do |n|
23     config.vm.define "gbpsfc#{n+1}", autostart: true do |compute|
24       vm_ip = ips[n]
25       vm_index = n+1
26       compute.vm.box = "ubuntu/trusty64"
27       compute.vm.hostname = "gbpsfc#{vm_index}"
28       compute.vm.network "private_network", ip: "#{vm_ip}"
29       compute.vm.provider :virtualbox do |vb|
30         vb.memory = 512
31         vb.customize ["modifyvm", :id, "--ioapic", "on"]      
32         vb.cpus = 1
33       end
34     end
35   end
36 end