65c3025c28a1118db383121a69326d4a629ef9a9
[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   # run our bootstrapping for the system
11   num_nodes = (ENV['NUM_NODES'] || 1).to_i
12
13   # ip configuration
14   ip_base = (ENV['SUBNET'] || "192.168.50.")
15   ips = num_nodes.times.collect { |n| ip_base + "#{n+70}" }
16
17   ip_base_sflow = "192.168.53."
18   ips_sflow = num_nodes.times.collect { |n| ip_base_sflow + "#{n+70}" }
19
20   num_nodes.times do |n|
21     config.vm.define "gbpsfc#{n+1}", autostart: true do |compute|
22       vm_ip = ips[n]
23       vm_ip_sflow = ips_sflow[n]
24       vm_index = n+1
25       compute.vm.box = "alagalah/gbpsfc-trusty64"
26       compute.vm.box_version = "1.0.1"
27       compute.vm.hostname = "gbpsfc#{vm_index}"
28       compute.vm.network "private_network", ip: "#{vm_ip}"
29       compute.vm.network "private_network", ip: "#{vm_ip_sflow}"
30       compute.vm.provider :virtualbox do |vb|
31         vb.memory = 512
32         vb.customize ["modifyvm", :id, "--ioapic", "on"]      
33         vb.cpus = 1
34       end
35     end
36   end
37 end