blob: 26758d9c76512a0d6e3627910eb00281869fe4af [file] [log] [blame]
Zsolt Harasztiec7df102016-05-05 13:34:18 -07001# -*- mode: ruby -*-
2# vi: set ft=ruby :
3
4Vagrant.configure(2) do |config|
5
6 if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
alshabibb6ae0862016-08-26 10:55:48 -07007 config.vm.synced_folder "..", "/cord", mount_options: ["dmode=700,fmode=600"]
Zsolt Harasztiec7df102016-05-05 13:34:18 -07008 else
alshabibb6ae0862016-08-26 10:55:48 -07009 config.vm.synced_folder "..", "/cord"
Zsolt Harasztiec7df102016-05-05 13:34:18 -070010 end
11
12 config.vm.define "corddev" do |d|
Zsolt Haraszti5b5a42a2016-05-12 22:19:57 -070013 d.ssh.forward_agent = true
Zsolt Harasztiec7df102016-05-05 13:34:18 -070014 d.vm.box = "ubuntu/trusty64"
Andy Bavier5c2e4fa2016-10-31 13:50:52 -040015 d.vm.synced_folder '.', '/vagrant', disabled: true
Zsolt Harasztiec7df102016-05-05 13:34:18 -070016 d.vm.hostname = "corddev"
17 d.vm.network "private_network", ip: "10.100.198.200"
David K. Bainbridge0bdec192016-10-13 18:10:10 -070018 d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
19 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/corddev.yml -c local"
Zsolt Harasztiec7df102016-05-05 13:34:18 -070020 d.vm.provider "virtualbox" do |v|
21 v.memory = 2048
22 end
Andy Bavier5c2e4fa2016-10-31 13:50:52 -040023 d.vm.provider :libvirt do |v, override|
Andy Bavier8ce395f2016-10-14 12:51:30 -040024 v.memory = 2048
Andy Bavier5c2e4fa2016-10-31 13:50:52 -040025 override.vm.synced_folder "..", "/cord", type: "nfs"
Andy Bavier99c11d32016-09-14 17:21:20 -040026 end
Zsolt Harasztiec7df102016-05-05 13:34:18 -070027 end
28
29 config.vm.define "prod" do |d|
30 d.vm.box = "ubuntu/trusty64"
Andy Bavier5c2e4fa2016-10-31 13:50:52 -040031 d.vm.synced_folder '.', '/vagrant', disabled: true
Zsolt Harasztiec7df102016-05-05 13:34:18 -070032 d.vm.hostname = "prod"
Andy Bavier51584d42016-12-02 08:39:13 -050033 d.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: '*'
Zsolt Harasztiec7df102016-05-05 13:34:18 -070034 d.vm.network "private_network", ip: "10.100.198.201"
Andy Bavier2505f592016-11-11 15:58:55 -050035 d.vm.network "private_network",
36 ip: "0.0.0.0",
37 auto_config: false,
38 virtualbox__intnet: "cord-mgmt-network",
39 libvirt__network_name: "cord-mgmt-network",
40 libvirt__forward_mode: "none",
41 libvirt__dhcp_enabled: false
42 d.vm.network "private_network",
Andy Bavier0f07bb32017-01-17 10:20:26 -050043 ip: "0.1.0.0",
44 mac: "02420a060101",
45 auto_config: false,
46 virtualbox__intnet: "head-node-leaf-1",
47 libvirt__network_name: "head-node-leaf-1",
48 libvirt__forward_mode: "none",
Andy Bavier2505f592016-11-11 15:58:55 -050049 libvirt__dhcp_enabled: false
David K. Bainbridge6f2cbe72016-08-19 15:48:07 -070050 d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
alshabibb6ae0862016-08-26 10:55:48 -070051 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/prod.yml -c local"
Zsolt Harasztiec7df102016-05-05 13:34:18 -070052 d.vm.provider "virtualbox" do |v|
David K. Bainbridge97b3f2f2016-06-16 18:08:49 -070053 v.memory = 2048
54 end
Andy Bavier2505f592016-11-11 15:58:55 -050055 d.vm.provider :libvirt do |v, override|
Scott Baker6f58e322016-12-09 14:47:07 -080056 v.memory = 24576
Andy Bavier2505f592016-11-11 15:58:55 -050057 v.cpus = 8
58 v.storage :file, :size => '100G', :type => 'qcow2'
Andy Bavier750bc6b2016-12-01 06:53:57 -050059 override.vm.synced_folder "..", "/cord", type: "nfs"
Andy Bavier2505f592016-11-11 15:58:55 -050060 override.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/add-extra-drive.yml -c local"
61 end
David K. Bainbridge97b3f2f2016-06-16 18:08:49 -070062 end
63
David K. Bainbridged506aa62016-06-22 16:06:39 -070064 config.vm.define "switch" do |s|
65 s.vm.box = "ubuntu/trusty64"
66 s.vm.hostname = "fakeswitch"
67 s.vm.network "private_network", ip: "10.100.198.253"
68 s.vm.network "private_network",
69 type: "dhcp",
Andy Bavier2505f592016-11-11 15:58:55 -050070 virtualbox__intnet: "cord-fabric-network",
71 libvirt__network_name: "cord-fabric-network",
David K. Bainbridged506aa62016-06-22 16:06:39 -070072 mac: "cc37ab000001"
73 s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
alshabibb6ae0862016-08-26 10:55:48 -070074 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/fakeswitch.yml -c local"
David K. Bainbridged506aa62016-06-22 16:06:39 -070075 s.vm.provider "virtualbox" do |v|
David K. Bainbridge97b3f2f2016-06-16 18:08:49 -070076 v.memory = 1048
David K. Bainbridged506aa62016-06-22 16:06:39 -070077 v.name = "fakeswitch"
78 end
79 end
80
Andy Bavier0f07bb32017-01-17 10:20:26 -050081 config.vm.define "leaf-1" do |s|
82 s.vm.box = "ubuntu/trusty64"
83 s.vm.hostname = "leaf-1"
84 s.vm.network "private_network",
85 #type: "dhcp",
86 ip: "0.0.0.0",
87 auto_config: false,
88 virtualbox__intnet: "cord-mgmt-network",
89 libvirt__network_name: "cord-mgmt-network",
90 mac: "cc37ab000011"
91 s.vm.network "private_network",
92 ip: "0.1.0.0",
93 auto_config: false,
94 virtualbox__intnet: "head-node-leaf-1",
95 libvirt__network_name: "head-node-leaf-1",
96 libvirt__forward_mode: "none",
97 libvirt__dhcp_enabled: false
98 s.vm.network "private_network",
99 ip: "0.2.0.0",
100 auto_config: false,
101 virtualbox__intnet: "compute-node-1-leaf-1",
102 libvirt__network_name: "compute-node-1-leaf-1",
103 libvirt__forward_mode: "none",
104 libvirt__dhcp_enabled: false
105 s.vm.network "private_network",
106 ip: "0.5.0.0",
107 auto_config: false,
108 virtualbox__intnet: "leaf-1-spine-1",
109 libvirt__network_name: "leaf-1-spine-1",
110 libvirt__forward_mode: "none",
111 libvirt__dhcp_enabled: false
112 s.vm.network "private_network",
113 ip: "0.6.0.0",
114 auto_config: false,
115 virtualbox__intnet: "leaf-1-spine-2",
116 libvirt__network_name: "leaf-1-spine-2",
117 libvirt__forward_mode: "none",
118 libvirt__dhcp_enabled: false
119 s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
120 if (ENV['FABRIC'] == "1")
121 s.vm.provision :shell, path: "scripts/install.sh", args: "-3f"
122 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/leafswitch.yml -c local -e 'fabric=true net_prefix=10.6.1'"
123 else
124 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/leafswitch.yml -c local -e 'net_prefix=10.6.1'"
125 end
126 s.vm.provider :libvirt do |v|
127 v.memory = 512
128 v.cpus = 1
129 end
130 s.vm.provider "virtualbox" do |v, override|
131 v.memory = 512
132 v.cpus = 1
133 end
134 end
135
136 config.vm.define "leaf-2" do |s|
137 s.vm.box = "ubuntu/trusty64"
138 s.vm.hostname = "leaf-2"
139 s.vm.network "private_network",
140 #type: "dhcp",
141 ip: "0.0.0.0",
142 auto_config: false,
143 virtualbox__intnet: "cord-mgmt-network",
144 libvirt__network_name: "cord-mgmt-network",
145 mac: "cc37ab000012"
146 s.vm.network "private_network",
147 ip: "0.3.0.0",
148 auto_config: false,
149 virtualbox__intnet: "compute-node-2-leaf-2",
150 libvirt__network_name: "compute-node-2-leaf-2",
151 libvirt__forward_mode: "none",
152 libvirt__dhcp_enabled: false
153 s.vm.network "private_network",
154 ip: "0.4.0.0",
155 auto_config: false,
156 virtualbox__intnet: "compute-node-3-leaf-2",
157 libvirt__network_name: "compute-node-3-leaf-2",
158 libvirt__forward_mode: "none",
159 libvirt__dhcp_enabled: false
160 s.vm.network "private_network",
161 ip: "0.7.0.0",
162 auto_config: false,
163 virtualbox__intnet: "leaf-2-spine-1",
164 libvirt__network_name: "leaf-2-spine-1",
165 libvirt__forward_mode: "none",
166 libvirt__dhcp_enabled: false
167 s.vm.network "private_network",
168 ip: "0.8.0.0",
169 auto_config: false,
170 virtualbox__intnet: "leaf-2-spine-2",
171 libvirt__network_name: "leaf-2-spine-2",
172 libvirt__forward_mode: "none",
173 libvirt__dhcp_enabled: false
174 s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
175 if (ENV['FABRIC'] == "1")
176 s.vm.provision :shell, path: "scripts/install.sh", args: "-3f"
177 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/leafswitch.yml -c local -e 'fabric=true net_prefix=10.6.1'"
178 else
179 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/leafswitch.yml -c local -e 'net_prefix=10.6.1'"
180 end
181 s.vm.provider :libvirt do |v|
182 v.memory = 512
183 v.cpus = 1
184 end
185 s.vm.provider "virtualbox" do |v, override|
186 v.memory = 512
187 v.cpus = 1
188 end
189 end
190
191 config.vm.define "spine-1" do |s|
192 s.vm.box = "ubuntu/trusty64"
193 s.vm.hostname = "spine-1"
194 s.vm.network "private_network",
195 #type: "dhcp",
196 ip: "0.0.0.0",
197 auto_config: false,
198 virtualbox__intnet: "cord-mgmt-network",
199 libvirt__network_name: "cord-mgmt-network",
200 mac: "cc37ab000021"
201 s.vm.network "private_network",
202 ip: "0.5.0.0",
203 auto_config: false,
204 virtualbox__intnet: "leaf-1-spine-1",
205 libvirt__network_name: "leaf-1-spine-1",
206 libvirt__forward_mode: "none",
207 libvirt__dhcp_enabled: false
208 s.vm.network "private_network",
209 ip: "0.7.0.0",
210 auto_config: false,
211 virtualbox__intnet: "leaf-2-spine-1",
212 libvirt__network_name: "leaf-2-spine-1",
213 libvirt__forward_mode: "none",
214 libvirt__dhcp_enabled: false
215 s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
216 if (ENV['FABRIC'] == "1")
217 s.vm.provision :shell, path: "scripts/install.sh", args: "-3f"
218 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'fabric=true net_prefix=10.6.1'"
219 else
220 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'net_prefix=10.6.1'"
221 end
222 s.vm.provider :libvirt do |v|
223 v.memory = 512
224 v.cpus = 1
225 end
226 s.vm.provider "virtualbox" do |v, override|
227 v.memory = 512
228 v.cpus = 1
229 end
230 end
231
232 config.vm.define "spine-2" do |s|
233 s.vm.box = "ubuntu/trusty64"
234 s.vm.hostname = "spine-2"
235 s.vm.network "private_network",
236 #type: "dhcp",
237 ip: "0.0.0.0",
238 auto_config: false,
239 virtualbox__intnet: "cord-mgmt-network",
240 libvirt__network_name: "cord-mgmt-network",
241 mac: "cc37ab000022"
242 s.vm.network "private_network",
243 ip: "0.6.0.0",
244 auto_config: false,
245 virtualbox__intnet: "leaf-1-spine-2",
246 libvirt__network_name: "leaf-1-spine-2",
247 libvirt__forward_mode: "none",
248 libvirt__dhcp_enabled: false
249 s.vm.network "private_network",
250 ip: "0.8.0.0",
251 auto_config: false,
252 virtualbox__intnet: "leaf-2-spine-2",
253 libvirt__network_name: "leaf-2-spine-2",
254 libvirt__forward_mode: "none",
255 libvirt__dhcp_enabled: false
256 s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
257 if (ENV['FABRIC'] == "1")
258 s.vm.provision :shell, path: "scripts/install.sh", args: "-3f"
259 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'fabric=true net_prefix=10.6.1'"
260 else
261 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'net_prefix=10.6.1'"
262 end
263 s.vm.provider :libvirt do |v|
264 v.memory = 512
265 v.cpus = 1
266 end
267 s.vm.provider "virtualbox" do |v, override|
268 v.memory = 512
269 v.cpus = 1
270 end
271 end
272
alshabibcb8e09b2016-09-06 11:41:29 -0700273 config.vm.define "testbox" do |d|
274 d.vm.box = "fgrehm/trusty64-lxc"
275 d.ssh.forward_agent = true
276 d.vm.hostname = "testbox"
277 d.vm.network "private_network", ip: "10.0.3.100", lxc__bridge_name: 'lxcbr0'
278 d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
279 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/corddev.yml -c local"
280 config.vm.provider :lxc do |lxc|
281 # Same effect as 'customize ["modifyvm", :id, "--memory", "1024"]' for VirtualBox
282 lxc.customize 'cgroup.memory.limit_in_bytes', '2048M'
alshabib270d7662016-09-06 14:09:18 -0700283 lxc.customize 'aa_profile', 'unconfined'
284 lxc.customize 'cgroup.devices.allow', 'b 7:* rwm'
285 lxc.customize 'cgroup.devices.allow', 'c 10:237 rwm'
alshabibcb8e09b2016-09-06 11:41:29 -0700286 end
David K. Bainbridgea0a36e92016-10-13 18:05:33 -0700287 end
alshabibcb8e09b2016-09-06 11:41:29 -0700288
Andy Bavier0f07bb32017-01-17 10:20:26 -0500289 config.vm.define "compute-node-1" do |c|
290 c.vm.synced_folder '.', '/vagrant', disabled: true
291 c.vm.communicator = "none"
292 c.vm.hostname = "compute-node-1"
293 c.vm.network "private_network",
294 adapter: 1,
295 ip: "0.0.0.0",
296 auto_config: false,
297 virtualbox__intnet: "cord-mgmt-network",
298 libvirt__network_name: "cord-mgmt-network"
299 c.vm.network "private_network",
300 adapter: 2, # The fabric interface for each node
301 ip: "0.2.0.0",
302 auto_config: false,
303 virtualbox__intnet: "compute-node-1-leaf-1",
304 libvirt__network_name: "compute-node-1-leaf-1",
305 libvirt__forward_mode: "none",
306 libvirt__dhcp_enabled: false
307 c.vm.provider :libvirt do |v|
308 v.memory = 8192
309 v.cpus = 4
310 v.machine_virtual_size = 100
311 v.storage :file, :size => '100G', :type => 'qcow2'
312 v.boot 'network'
313 v.boot 'hd'
314 v.nested = true
315 end
316 c.vm.provider "virtualbox" do |v, override|
317 override.vm.box = "clink15/pxe"
318 v.memory = 1048
319 v.gui = "true"
320 end
321 end
322
323 config.vm.define "compute-node-2" do |c|
324 c.vm.synced_folder '.', '/vagrant', disabled: true
325 c.vm.communicator = "none"
326 c.vm.hostname = "compute-node-2"
327 c.vm.network "private_network",
328 adapter: 1,
329 ip: "0.0.0.0",
330 auto_config: false,
331 virtualbox__intnet: "cord-mgmt-network",
332 libvirt__network_name: "cord-mgmt-network"
333 c.vm.network "private_network",
334 adapter: 2, # The fabric interface for each node
335 ip: "0.3.0.0",
336 auto_config: false,
337 virtualbox__intnet: "compute-node-2-leaf-2",
338 libvirt__network_name: "compute-node-2-leaf-2",
339 libvirt__forward_mode: "none",
340 libvirt__dhcp_enabled: false
341 c.vm.provider :libvirt do |v|
342 v.memory = 8192
343 v.cpus = 4
344 v.machine_virtual_size = 100
345 v.storage :file, :size => '100G', :type => 'qcow2'
346 v.boot 'network'
347 v.boot 'hd'
348 v.nested = true
349 end
350 c.vm.provider "virtualbox" do |v, override|
351 override.vm.box = "clink15/pxe"
352 v.memory = 1048
353 v.gui = "true"
354 end
355 end
356
357 config.vm.define "compute-node-3" do |c|
358 c.vm.synced_folder '.', '/vagrant', disabled: true
359 c.vm.communicator = "none"
360 c.vm.hostname = "compute-node-3"
361 c.vm.network "private_network",
362 adapter: 1,
363 ip: "0.0.0.0",
364 auto_config: false,
365 virtualbox__intnet: "cord-mgmt-network",
366 libvirt__network_name: "cord-mgmt-network"
367 c.vm.network "private_network",
368 adapter: 2, # The fabric interface for each node
369 ip: "0.4.0.0",
370 auto_config: false,
371 virtualbox__intnet: "compute-node-3-leaf-2",
372 libvirt__network_name: "compute-node-3-leaf-2",
373 libvirt__forward_mode: "none",
374 libvirt__dhcp_enabled: false
375 c.vm.provider :libvirt do |v|
376 v.memory = 8192
377 v.cpus = 4
378 v.machine_virtual_size = 100
379 v.storage :file, :size => '100G', :type => 'qcow2'
380 v.boot 'network'
381 v.boot 'hd'
382 v.nested = true
383 end
384 c.vm.provider "virtualbox" do |v, override|
385 override.vm.box = "clink15/pxe"
386 v.memory = 1048
387 v.gui = "true"
Andy Bavier99c11d32016-09-14 17:21:20 -0400388 end
389 end
390
Zsolt Harasztiec7df102016-05-05 13:34:18 -0700391 if Vagrant.has_plugin?("vagrant-cachier")
392 config.cache.scope = :box
393 end
394
395end