forked from alagalah/gbpsfc-env
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
34 lines (28 loc) · 997 Bytes
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
odl=ENV['ODL']
config.vm.provider "virtualbox" do |vb|
vb.memory = "512"
end
# run our bootstrapping for the system
config.vm.provision 'shell', path: 'bootstrap.sh', :args => odl
num_nodes = (ENV['NUM_NODES'] || 1).to_i
# ip configuration
ip_base = (ENV['SUBNET'] || "192.168.50.")
ips = num_nodes.times.collect { |n| ip_base + "#{n+70}" }
num_nodes.times do |n|
config.vm.define "gbpsfc#{n+1}", autostart: true do |compute|
vm_ip = ips[n]
vm_index = n+1
compute.vm.box = "ubuntu/trusty64"
compute.vm.hostname = "gbpsfc#{vm_index}"
compute.vm.network "private_network", ip: "#{vm_ip}"
compute.vm.provider :virtualbox do |vb|
vb.memory = 512
vb.customize ["modifyvm", :id, "--ioapic", "on"]
vb.cpus = 1
end
end
end
end