blob: 70fce06a4815de35bd7b2bd52da05bd18444bb52 [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
Andy Bavierec9829a2017-02-05 07:58:26 -050011 config.vm.synced_folder '.', '/vagrant', disabled: true
Zsolt Harasztiec7df102016-05-05 13:34:18 -070012
13 config.vm.define "corddev" do |d|
Zsolt Haraszti5b5a42a2016-05-12 22:19:57 -070014 d.ssh.forward_agent = true
Zsolt Harasztiec7df102016-05-05 13:34:18 -070015 d.vm.box = "ubuntu/trusty64"
16 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"
31 d.vm.hostname = "prod"
Andy Bavier51584d42016-12-02 08:39:13 -050032 d.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: '*'
Zsolt Harasztiec7df102016-05-05 13:34:18 -070033 d.vm.network "private_network", ip: "10.100.198.201"
Andy Bavier2505f592016-11-11 15:58:55 -050034 d.vm.network "private_network",
35 ip: "0.0.0.0",
36 auto_config: false,
37 virtualbox__intnet: "cord-mgmt-network",
38 libvirt__network_name: "cord-mgmt-network",
39 libvirt__forward_mode: "none",
40 libvirt__dhcp_enabled: false
41 d.vm.network "private_network",
Andy Bavier0f07bb32017-01-17 10:20:26 -050042 ip: "0.1.0.0",
43 mac: "02420a060101",
44 auto_config: false,
45 virtualbox__intnet: "head-node-leaf-1",
46 libvirt__network_name: "head-node-leaf-1",
47 libvirt__forward_mode: "none",
Andy Bavier2505f592016-11-11 15:58:55 -050048 libvirt__dhcp_enabled: false
David K. Bainbridge6f2cbe72016-08-19 15:48:07 -070049 d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
alshabibb6ae0862016-08-26 10:55:48 -070050 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/prod.yml -c local"
Zsolt Harasztiec7df102016-05-05 13:34:18 -070051 d.vm.provider "virtualbox" do |v|
David K. Bainbridge97b3f2f2016-06-16 18:08:49 -070052 v.memory = 2048
53 end
Andy Bavier2505f592016-11-11 15:58:55 -050054 d.vm.provider :libvirt do |v, override|
Scott Baker6f58e322016-12-09 14:47:07 -080055 v.memory = 24576
Andy Bavier2505f592016-11-11 15:58:55 -050056 v.cpus = 8
57 v.storage :file, :size => '100G', :type => 'qcow2'
Andy Bavier750bc6b2016-12-01 06:53:57 -050058 override.vm.synced_folder "..", "/cord", type: "nfs"
Andy Bavier2505f592016-11-11 15:58:55 -050059 override.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/add-extra-drive.yml -c local"
60 end
David K. Bainbridge97b3f2f2016-06-16 18:08:49 -070061 end
62
David K. Bainbridged506aa62016-06-22 16:06:39 -070063 config.vm.define "switch" do |s|
64 s.vm.box = "ubuntu/trusty64"
65 s.vm.hostname = "fakeswitch"
66 s.vm.network "private_network", ip: "10.100.198.253"
67 s.vm.network "private_network",
68 type: "dhcp",
Andy Bavier2505f592016-11-11 15:58:55 -050069 virtualbox__intnet: "cord-fabric-network",
70 libvirt__network_name: "cord-fabric-network",
David K. Bainbridged506aa62016-06-22 16:06:39 -070071 mac: "cc37ab000001"
72 s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
alshabibb6ae0862016-08-26 10:55:48 -070073 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/fakeswitch.yml -c local"
David K. Bainbridged506aa62016-06-22 16:06:39 -070074 s.vm.provider "virtualbox" do |v|
David K. Bainbridge97b3f2f2016-06-16 18:08:49 -070075 v.memory = 1048
David K. Bainbridged506aa62016-06-22 16:06:39 -070076 v.name = "fakeswitch"
77 end
78 end
79
Andy Bavier0f07bb32017-01-17 10:20:26 -050080 config.vm.define "leaf-1" do |s|
81 s.vm.box = "ubuntu/trusty64"
82 s.vm.hostname = "leaf-1"
83 s.vm.network "private_network",
84 #type: "dhcp",
85 ip: "0.0.0.0",
86 auto_config: false,
87 virtualbox__intnet: "cord-mgmt-network",
88 libvirt__network_name: "cord-mgmt-network",
89 mac: "cc37ab000011"
90 s.vm.network "private_network",
91 ip: "0.1.0.0",
92 auto_config: false,
93 virtualbox__intnet: "head-node-leaf-1",
94 libvirt__network_name: "head-node-leaf-1",
95 libvirt__forward_mode: "none",
96 libvirt__dhcp_enabled: false
97 s.vm.network "private_network",
98 ip: "0.2.0.0",
99 auto_config: false,
100 virtualbox__intnet: "compute-node-1-leaf-1",
101 libvirt__network_name: "compute-node-1-leaf-1",
102 libvirt__forward_mode: "none",
103 libvirt__dhcp_enabled: false
104 s.vm.network "private_network",
105 ip: "0.5.0.0",
106 auto_config: false,
107 virtualbox__intnet: "leaf-1-spine-1",
108 libvirt__network_name: "leaf-1-spine-1",
109 libvirt__forward_mode: "none",
110 libvirt__dhcp_enabled: false
111 s.vm.network "private_network",
112 ip: "0.6.0.0",
113 auto_config: false,
114 virtualbox__intnet: "leaf-1-spine-2",
115 libvirt__network_name: "leaf-1-spine-2",
116 libvirt__forward_mode: "none",
117 libvirt__dhcp_enabled: false
118 s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
119 if (ENV['FABRIC'] == "1")
120 s.vm.provision :shell, path: "scripts/install.sh", args: "-3f"
121 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/leafswitch.yml -c local -e 'fabric=true net_prefix=10.6.1'"
122 else
123 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/leafswitch.yml -c local -e 'net_prefix=10.6.1'"
124 end
Andy Bavierec9829a2017-02-05 07:58:26 -0500125 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500126 v.memory = 512
127 v.cpus = 1
Andy Bavierec9829a2017-02-05 07:58:26 -0500128 override.vm.synced_folder "..", "/cord", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500129 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
Andy Bavierec9829a2017-02-05 07:58:26 -0500181 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500182 v.memory = 512
183 v.cpus = 1
Andy Bavierec9829a2017-02-05 07:58:26 -0500184 override.vm.synced_folder "..", "/cord", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500185 end
186 s.vm.provider "virtualbox" do |v, override|
187 v.memory = 512
188 v.cpus = 1
189 end
190 end
191
192 config.vm.define "spine-1" do |s|
193 s.vm.box = "ubuntu/trusty64"
194 s.vm.hostname = "spine-1"
195 s.vm.network "private_network",
196 #type: "dhcp",
197 ip: "0.0.0.0",
198 auto_config: false,
199 virtualbox__intnet: "cord-mgmt-network",
200 libvirt__network_name: "cord-mgmt-network",
201 mac: "cc37ab000021"
202 s.vm.network "private_network",
203 ip: "0.5.0.0",
204 auto_config: false,
205 virtualbox__intnet: "leaf-1-spine-1",
206 libvirt__network_name: "leaf-1-spine-1",
207 libvirt__forward_mode: "none",
208 libvirt__dhcp_enabled: false
209 s.vm.network "private_network",
210 ip: "0.7.0.0",
211 auto_config: false,
212 virtualbox__intnet: "leaf-2-spine-1",
213 libvirt__network_name: "leaf-2-spine-1",
214 libvirt__forward_mode: "none",
215 libvirt__dhcp_enabled: false
216 s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
217 if (ENV['FABRIC'] == "1")
218 s.vm.provision :shell, path: "scripts/install.sh", args: "-3f"
219 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'fabric=true net_prefix=10.6.1'"
220 else
221 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'net_prefix=10.6.1'"
222 end
Andy Bavierec9829a2017-02-05 07:58:26 -0500223 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500224 v.memory = 512
225 v.cpus = 1
Andy Bavierec9829a2017-02-05 07:58:26 -0500226 override.vm.synced_folder "..", "/cord", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500227 end
228 s.vm.provider "virtualbox" do |v, override|
229 v.memory = 512
230 v.cpus = 1
231 end
232 end
233
234 config.vm.define "spine-2" do |s|
235 s.vm.box = "ubuntu/trusty64"
236 s.vm.hostname = "spine-2"
237 s.vm.network "private_network",
238 #type: "dhcp",
239 ip: "0.0.0.0",
240 auto_config: false,
241 virtualbox__intnet: "cord-mgmt-network",
242 libvirt__network_name: "cord-mgmt-network",
243 mac: "cc37ab000022"
244 s.vm.network "private_network",
245 ip: "0.6.0.0",
246 auto_config: false,
247 virtualbox__intnet: "leaf-1-spine-2",
248 libvirt__network_name: "leaf-1-spine-2",
249 libvirt__forward_mode: "none",
250 libvirt__dhcp_enabled: false
251 s.vm.network "private_network",
252 ip: "0.8.0.0",
253 auto_config: false,
254 virtualbox__intnet: "leaf-2-spine-2",
255 libvirt__network_name: "leaf-2-spine-2",
256 libvirt__forward_mode: "none",
257 libvirt__dhcp_enabled: false
258 s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
259 if (ENV['FABRIC'] == "1")
260 s.vm.provision :shell, path: "scripts/install.sh", args: "-3f"
261 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'fabric=true net_prefix=10.6.1'"
262 else
263 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'net_prefix=10.6.1'"
264 end
Andy Bavierec9829a2017-02-05 07:58:26 -0500265 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500266 v.memory = 512
267 v.cpus = 1
Andy Bavierec9829a2017-02-05 07:58:26 -0500268 override.vm.synced_folder "..", "/cord", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500269 end
270 s.vm.provider "virtualbox" do |v, override|
271 v.memory = 512
272 v.cpus = 1
273 end
274 end
275
alshabibcb8e09b2016-09-06 11:41:29 -0700276 config.vm.define "testbox" do |d|
277 d.vm.box = "fgrehm/trusty64-lxc"
278 d.ssh.forward_agent = true
279 d.vm.hostname = "testbox"
280 d.vm.network "private_network", ip: "10.0.3.100", lxc__bridge_name: 'lxcbr0'
281 d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
282 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/corddev.yml -c local"
283 config.vm.provider :lxc do |lxc|
284 # Same effect as 'customize ["modifyvm", :id, "--memory", "1024"]' for VirtualBox
285 lxc.customize 'cgroup.memory.limit_in_bytes', '2048M'
alshabib270d7662016-09-06 14:09:18 -0700286 lxc.customize 'aa_profile', 'unconfined'
287 lxc.customize 'cgroup.devices.allow', 'b 7:* rwm'
288 lxc.customize 'cgroup.devices.allow', 'c 10:237 rwm'
alshabibcb8e09b2016-09-06 11:41:29 -0700289 end
David K. Bainbridgea0a36e92016-10-13 18:05:33 -0700290 end
alshabibcb8e09b2016-09-06 11:41:29 -0700291
Andy Bavier0f07bb32017-01-17 10:20:26 -0500292 config.vm.define "compute-node-1" do |c|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500293 c.vm.communicator = "none"
294 c.vm.hostname = "compute-node-1"
295 c.vm.network "private_network",
296 adapter: 1,
297 ip: "0.0.0.0",
298 auto_config: false,
299 virtualbox__intnet: "cord-mgmt-network",
300 libvirt__network_name: "cord-mgmt-network"
301 c.vm.network "private_network",
302 adapter: 2, # The fabric interface for each node
303 ip: "0.2.0.0",
304 auto_config: false,
305 virtualbox__intnet: "compute-node-1-leaf-1",
306 libvirt__network_name: "compute-node-1-leaf-1",
307 libvirt__forward_mode: "none",
308 libvirt__dhcp_enabled: false
309 c.vm.provider :libvirt do |v|
310 v.memory = 8192
311 v.cpus = 4
312 v.machine_virtual_size = 100
313 v.storage :file, :size => '100G', :type => 'qcow2'
314 v.boot 'network'
315 v.boot 'hd'
316 v.nested = true
317 end
318 c.vm.provider "virtualbox" do |v, override|
319 override.vm.box = "clink15/pxe"
320 v.memory = 1048
321 v.gui = "true"
322 end
323 end
324
325 config.vm.define "compute-node-2" do |c|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500326 c.vm.communicator = "none"
327 c.vm.hostname = "compute-node-2"
328 c.vm.network "private_network",
329 adapter: 1,
330 ip: "0.0.0.0",
331 auto_config: false,
332 virtualbox__intnet: "cord-mgmt-network",
333 libvirt__network_name: "cord-mgmt-network"
334 c.vm.network "private_network",
335 adapter: 2, # The fabric interface for each node
336 ip: "0.3.0.0",
337 auto_config: false,
338 virtualbox__intnet: "compute-node-2-leaf-2",
339 libvirt__network_name: "compute-node-2-leaf-2",
340 libvirt__forward_mode: "none",
341 libvirt__dhcp_enabled: false
342 c.vm.provider :libvirt do |v|
343 v.memory = 8192
344 v.cpus = 4
345 v.machine_virtual_size = 100
346 v.storage :file, :size => '100G', :type => 'qcow2'
347 v.boot 'network'
348 v.boot 'hd'
349 v.nested = true
350 end
351 c.vm.provider "virtualbox" do |v, override|
352 override.vm.box = "clink15/pxe"
353 v.memory = 1048
354 v.gui = "true"
355 end
356 end
357
358 config.vm.define "compute-node-3" do |c|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500359 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