blob: 1ce337e62c6ee65f9e25f754ef47fcda14289b8e [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
Sapan Bhatia01ddea62017-02-10 11:28:48 -080013 config.vm.define "elastic" do |d|
14 d.ssh.forward_agent = true
15 d.vm.box = "ubuntu/trusty64"
16 d.vm.synced_folder '.', '/vagrant', disabled: true
17
18 d.vm.network :forwarded_port, guest: 5601, host: 5601, host_ip: '*'
19 d.vm.network :forwarded_port, guest: 80, host: 9080, host_ip: '*'
20 d.vm.network :forwarded_port, guest: 9200, host: 9200, host_ip: '*'
21 d.vm.network :forwarded_port, guest: 5617, host: 5617, host_ip: '*', protocol: "udp"
22
23 d.vm.hostname = "elastic"
24 d.vm.network "private_network", ip: "10.100.198.222"
25 d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
26 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/elastic.yml -c local"
27 d.vm.provider "virtualbox" do |v|
28 v.memory = 4096
29 end
30 d.vm.provider :libvirt do |v, override|
31 v.memory = 4096
32 override.vm.synced_folder "..", "/cord", type: "nfs"
33 end
34 end
35
Zsolt Harasztiec7df102016-05-05 13:34:18 -070036 config.vm.define "corddev" do |d|
Zsolt Haraszti5b5a42a2016-05-12 22:19:57 -070037 d.ssh.forward_agent = true
Zsolt Harasztiec7df102016-05-05 13:34:18 -070038 d.vm.box = "ubuntu/trusty64"
39 d.vm.hostname = "corddev"
40 d.vm.network "private_network", ip: "10.100.198.200"
David K. Bainbridge0bdec192016-10-13 18:10:10 -070041 d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
42 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/corddev.yml -c local"
Zsolt Harasztiec7df102016-05-05 13:34:18 -070043 d.vm.provider "virtualbox" do |v|
44 v.memory = 2048
45 end
Andy Bavier5c2e4fa2016-10-31 13:50:52 -040046 d.vm.provider :libvirt do |v, override|
Andy Bavier8ce395f2016-10-14 12:51:30 -040047 v.memory = 2048
Andy Bavier5c2e4fa2016-10-31 13:50:52 -040048 override.vm.synced_folder "..", "/cord", type: "nfs"
Andy Bavier99c11d32016-09-14 17:21:20 -040049 end
Zsolt Harasztiec7df102016-05-05 13:34:18 -070050 end
51
52 config.vm.define "prod" do |d|
53 d.vm.box = "ubuntu/trusty64"
54 d.vm.hostname = "prod"
Andy Bavier51584d42016-12-02 08:39:13 -050055 d.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: '*'
Zsolt Harasztiec7df102016-05-05 13:34:18 -070056 d.vm.network "private_network", ip: "10.100.198.201"
Andy Bavier2505f592016-11-11 15:58:55 -050057 d.vm.network "private_network",
58 ip: "0.0.0.0",
59 auto_config: false,
60 virtualbox__intnet: "cord-mgmt-network",
61 libvirt__network_name: "cord-mgmt-network",
62 libvirt__forward_mode: "none",
63 libvirt__dhcp_enabled: false
64 d.vm.network "private_network",
Andy Bavier0f07bb32017-01-17 10:20:26 -050065 ip: "0.1.0.0",
66 mac: "02420a060101",
67 auto_config: false,
68 virtualbox__intnet: "head-node-leaf-1",
69 libvirt__network_name: "head-node-leaf-1",
70 libvirt__forward_mode: "none",
Andy Bavier2505f592016-11-11 15:58:55 -050071 libvirt__dhcp_enabled: false
David K. Bainbridge6f2cbe72016-08-19 15:48:07 -070072 d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
alshabibb6ae0862016-08-26 10:55:48 -070073 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/prod.yml -c local"
Zsolt Harasztiec7df102016-05-05 13:34:18 -070074 d.vm.provider "virtualbox" do |v|
David K. Bainbridge97b3f2f2016-06-16 18:08:49 -070075 v.memory = 2048
76 end
Andy Bavier2505f592016-11-11 15:58:55 -050077 d.vm.provider :libvirt do |v, override|
Scott Baker6f58e322016-12-09 14:47:07 -080078 v.memory = 24576
Andy Bavier2505f592016-11-11 15:58:55 -050079 v.cpus = 8
80 v.storage :file, :size => '100G', :type => 'qcow2'
Andy Bavier750bc6b2016-12-01 06:53:57 -050081 override.vm.synced_folder "..", "/cord", type: "nfs"
Andy Bavier2505f592016-11-11 15:58:55 -050082 override.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/add-extra-drive.yml -c local"
83 end
David K. Bainbridge97b3f2f2016-06-16 18:08:49 -070084 end
85
David K. Bainbridged506aa62016-06-22 16:06:39 -070086 config.vm.define "switch" do |s|
87 s.vm.box = "ubuntu/trusty64"
88 s.vm.hostname = "fakeswitch"
89 s.vm.network "private_network", ip: "10.100.198.253"
90 s.vm.network "private_network",
91 type: "dhcp",
Andy Bavier2505f592016-11-11 15:58:55 -050092 virtualbox__intnet: "cord-fabric-network",
93 libvirt__network_name: "cord-fabric-network",
David K. Bainbridged506aa62016-06-22 16:06:39 -070094 mac: "cc37ab000001"
95 s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
alshabibb6ae0862016-08-26 10:55:48 -070096 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/fakeswitch.yml -c local"
David K. Bainbridged506aa62016-06-22 16:06:39 -070097 s.vm.provider "virtualbox" do |v|
David K. Bainbridge97b3f2f2016-06-16 18:08:49 -070098 v.memory = 1048
David K. Bainbridged506aa62016-06-22 16:06:39 -070099 v.name = "fakeswitch"
100 end
101 end
102
Andy Bavier0f07bb32017-01-17 10:20:26 -0500103 config.vm.define "leaf-1" do |s|
104 s.vm.box = "ubuntu/trusty64"
105 s.vm.hostname = "leaf-1"
106 s.vm.network "private_network",
107 #type: "dhcp",
108 ip: "0.0.0.0",
109 auto_config: false,
110 virtualbox__intnet: "cord-mgmt-network",
111 libvirt__network_name: "cord-mgmt-network",
112 mac: "cc37ab000011"
113 s.vm.network "private_network",
114 ip: "0.1.0.0",
115 auto_config: false,
116 virtualbox__intnet: "head-node-leaf-1",
117 libvirt__network_name: "head-node-leaf-1",
118 libvirt__forward_mode: "none",
119 libvirt__dhcp_enabled: false
120 s.vm.network "private_network",
121 ip: "0.2.0.0",
122 auto_config: false,
123 virtualbox__intnet: "compute-node-1-leaf-1",
124 libvirt__network_name: "compute-node-1-leaf-1",
125 libvirt__forward_mode: "none",
126 libvirt__dhcp_enabled: false
127 s.vm.network "private_network",
128 ip: "0.5.0.0",
129 auto_config: false,
130 virtualbox__intnet: "leaf-1-spine-1",
131 libvirt__network_name: "leaf-1-spine-1",
132 libvirt__forward_mode: "none",
133 libvirt__dhcp_enabled: false
134 s.vm.network "private_network",
135 ip: "0.6.0.0",
136 auto_config: false,
137 virtualbox__intnet: "leaf-1-spine-2",
138 libvirt__network_name: "leaf-1-spine-2",
139 libvirt__forward_mode: "none",
140 libvirt__dhcp_enabled: false
141 s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
142 if (ENV['FABRIC'] == "1")
143 s.vm.provision :shell, path: "scripts/install.sh", args: "-3f"
144 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/leafswitch.yml -c local -e 'fabric=true net_prefix=10.6.1'"
145 else
146 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/leafswitch.yml -c local -e 'net_prefix=10.6.1'"
147 end
Andy Bavierec9829a2017-02-05 07:58:26 -0500148 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500149 v.memory = 512
150 v.cpus = 1
Andy Bavierec9829a2017-02-05 07:58:26 -0500151 override.vm.synced_folder "..", "/cord", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500152 end
153 s.vm.provider "virtualbox" do |v, override|
154 v.memory = 512
155 v.cpus = 1
156 end
157 end
158
159 config.vm.define "leaf-2" do |s|
160 s.vm.box = "ubuntu/trusty64"
161 s.vm.hostname = "leaf-2"
162 s.vm.network "private_network",
163 #type: "dhcp",
164 ip: "0.0.0.0",
165 auto_config: false,
166 virtualbox__intnet: "cord-mgmt-network",
167 libvirt__network_name: "cord-mgmt-network",
168 mac: "cc37ab000012"
169 s.vm.network "private_network",
170 ip: "0.3.0.0",
171 auto_config: false,
172 virtualbox__intnet: "compute-node-2-leaf-2",
173 libvirt__network_name: "compute-node-2-leaf-2",
174 libvirt__forward_mode: "none",
175 libvirt__dhcp_enabled: false
176 s.vm.network "private_network",
177 ip: "0.4.0.0",
178 auto_config: false,
179 virtualbox__intnet: "compute-node-3-leaf-2",
180 libvirt__network_name: "compute-node-3-leaf-2",
181 libvirt__forward_mode: "none",
182 libvirt__dhcp_enabled: false
183 s.vm.network "private_network",
184 ip: "0.7.0.0",
185 auto_config: false,
186 virtualbox__intnet: "leaf-2-spine-1",
187 libvirt__network_name: "leaf-2-spine-1",
188 libvirt__forward_mode: "none",
189 libvirt__dhcp_enabled: false
190 s.vm.network "private_network",
191 ip: "0.8.0.0",
192 auto_config: false,
193 virtualbox__intnet: "leaf-2-spine-2",
194 libvirt__network_name: "leaf-2-spine-2",
195 libvirt__forward_mode: "none",
196 libvirt__dhcp_enabled: false
197 s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
198 if (ENV['FABRIC'] == "1")
199 s.vm.provision :shell, path: "scripts/install.sh", args: "-3f"
200 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/leafswitch.yml -c local -e 'fabric=true net_prefix=10.6.1'"
201 else
202 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/leafswitch.yml -c local -e 'net_prefix=10.6.1'"
203 end
Andy Bavierec9829a2017-02-05 07:58:26 -0500204 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500205 v.memory = 512
206 v.cpus = 1
Andy Bavierec9829a2017-02-05 07:58:26 -0500207 override.vm.synced_folder "..", "/cord", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500208 end
209 s.vm.provider "virtualbox" do |v, override|
210 v.memory = 512
211 v.cpus = 1
212 end
213 end
214
215 config.vm.define "spine-1" do |s|
216 s.vm.box = "ubuntu/trusty64"
217 s.vm.hostname = "spine-1"
218 s.vm.network "private_network",
219 #type: "dhcp",
220 ip: "0.0.0.0",
221 auto_config: false,
222 virtualbox__intnet: "cord-mgmt-network",
223 libvirt__network_name: "cord-mgmt-network",
224 mac: "cc37ab000021"
225 s.vm.network "private_network",
226 ip: "0.5.0.0",
227 auto_config: false,
228 virtualbox__intnet: "leaf-1-spine-1",
229 libvirt__network_name: "leaf-1-spine-1",
230 libvirt__forward_mode: "none",
231 libvirt__dhcp_enabled: false
232 s.vm.network "private_network",
233 ip: "0.7.0.0",
234 auto_config: false,
235 virtualbox__intnet: "leaf-2-spine-1",
236 libvirt__network_name: "leaf-2-spine-1",
237 libvirt__forward_mode: "none",
238 libvirt__dhcp_enabled: false
239 s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
240 if (ENV['FABRIC'] == "1")
241 s.vm.provision :shell, path: "scripts/install.sh", args: "-3f"
242 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'fabric=true net_prefix=10.6.1'"
243 else
244 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'net_prefix=10.6.1'"
245 end
Andy Bavierec9829a2017-02-05 07:58:26 -0500246 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500247 v.memory = 512
248 v.cpus = 1
Andy Bavierec9829a2017-02-05 07:58:26 -0500249 override.vm.synced_folder "..", "/cord", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500250 end
251 s.vm.provider "virtualbox" do |v, override|
252 v.memory = 512
253 v.cpus = 1
254 end
255 end
256
257 config.vm.define "spine-2" do |s|
258 s.vm.box = "ubuntu/trusty64"
259 s.vm.hostname = "spine-2"
260 s.vm.network "private_network",
261 #type: "dhcp",
262 ip: "0.0.0.0",
263 auto_config: false,
264 virtualbox__intnet: "cord-mgmt-network",
265 libvirt__network_name: "cord-mgmt-network",
266 mac: "cc37ab000022"
267 s.vm.network "private_network",
268 ip: "0.6.0.0",
269 auto_config: false,
270 virtualbox__intnet: "leaf-1-spine-2",
271 libvirt__network_name: "leaf-1-spine-2",
272 libvirt__forward_mode: "none",
273 libvirt__dhcp_enabled: false
274 s.vm.network "private_network",
275 ip: "0.8.0.0",
276 auto_config: false,
277 virtualbox__intnet: "leaf-2-spine-2",
278 libvirt__network_name: "leaf-2-spine-2",
279 libvirt__forward_mode: "none",
280 libvirt__dhcp_enabled: false
281 s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
282 if (ENV['FABRIC'] == "1")
283 s.vm.provision :shell, path: "scripts/install.sh", args: "-3f"
284 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'fabric=true net_prefix=10.6.1'"
285 else
286 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'net_prefix=10.6.1'"
287 end
Andy Bavierec9829a2017-02-05 07:58:26 -0500288 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500289 v.memory = 512
290 v.cpus = 1
Andy Bavierec9829a2017-02-05 07:58:26 -0500291 override.vm.synced_folder "..", "/cord", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500292 end
293 s.vm.provider "virtualbox" do |v, override|
294 v.memory = 512
295 v.cpus = 1
296 end
297 end
298
alshabibcb8e09b2016-09-06 11:41:29 -0700299 config.vm.define "testbox" do |d|
300 d.vm.box = "fgrehm/trusty64-lxc"
301 d.ssh.forward_agent = true
302 d.vm.hostname = "testbox"
303 d.vm.network "private_network", ip: "10.0.3.100", lxc__bridge_name: 'lxcbr0'
304 d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
305 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/corddev.yml -c local"
306 config.vm.provider :lxc do |lxc|
307 # Same effect as 'customize ["modifyvm", :id, "--memory", "1024"]' for VirtualBox
308 lxc.customize 'cgroup.memory.limit_in_bytes', '2048M'
alshabib270d7662016-09-06 14:09:18 -0700309 lxc.customize 'aa_profile', 'unconfined'
310 lxc.customize 'cgroup.devices.allow', 'b 7:* rwm'
311 lxc.customize 'cgroup.devices.allow', 'c 10:237 rwm'
alshabibcb8e09b2016-09-06 11:41:29 -0700312 end
David K. Bainbridgea0a36e92016-10-13 18:05:33 -0700313 end
alshabibcb8e09b2016-09-06 11:41:29 -0700314
Andy Bavier0f07bb32017-01-17 10:20:26 -0500315 config.vm.define "compute-node-1" do |c|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500316 c.vm.communicator = "none"
317 c.vm.hostname = "compute-node-1"
318 c.vm.network "private_network",
319 adapter: 1,
320 ip: "0.0.0.0",
321 auto_config: false,
322 virtualbox__intnet: "cord-mgmt-network",
323 libvirt__network_name: "cord-mgmt-network"
324 c.vm.network "private_network",
325 adapter: 2, # The fabric interface for each node
326 ip: "0.2.0.0",
327 auto_config: false,
328 virtualbox__intnet: "compute-node-1-leaf-1",
329 libvirt__network_name: "compute-node-1-leaf-1",
330 libvirt__forward_mode: "none",
331 libvirt__dhcp_enabled: false
332 c.vm.provider :libvirt do |v|
333 v.memory = 8192
334 v.cpus = 4
335 v.machine_virtual_size = 100
336 v.storage :file, :size => '100G', :type => 'qcow2'
337 v.boot 'network'
338 v.boot 'hd'
339 v.nested = true
340 end
341 c.vm.provider "virtualbox" do |v, override|
342 override.vm.box = "clink15/pxe"
343 v.memory = 1048
344 v.gui = "true"
345 end
346 end
347
348 config.vm.define "compute-node-2" do |c|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500349 c.vm.communicator = "none"
350 c.vm.hostname = "compute-node-2"
351 c.vm.network "private_network",
352 adapter: 1,
353 ip: "0.0.0.0",
354 auto_config: false,
355 virtualbox__intnet: "cord-mgmt-network",
356 libvirt__network_name: "cord-mgmt-network"
357 c.vm.network "private_network",
358 adapter: 2, # The fabric interface for each node
359 ip: "0.3.0.0",
360 auto_config: false,
361 virtualbox__intnet: "compute-node-2-leaf-2",
362 libvirt__network_name: "compute-node-2-leaf-2",
363 libvirt__forward_mode: "none",
364 libvirt__dhcp_enabled: false
365 c.vm.provider :libvirt do |v|
366 v.memory = 8192
367 v.cpus = 4
368 v.machine_virtual_size = 100
369 v.storage :file, :size => '100G', :type => 'qcow2'
370 v.boot 'network'
371 v.boot 'hd'
372 v.nested = true
373 end
374 c.vm.provider "virtualbox" do |v, override|
375 override.vm.box = "clink15/pxe"
376 v.memory = 1048
377 v.gui = "true"
378 end
379 end
380
381 config.vm.define "compute-node-3" do |c|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500382 c.vm.communicator = "none"
383 c.vm.hostname = "compute-node-3"
384 c.vm.network "private_network",
385 adapter: 1,
386 ip: "0.0.0.0",
387 auto_config: false,
388 virtualbox__intnet: "cord-mgmt-network",
389 libvirt__network_name: "cord-mgmt-network"
390 c.vm.network "private_network",
391 adapter: 2, # The fabric interface for each node
392 ip: "0.4.0.0",
393 auto_config: false,
394 virtualbox__intnet: "compute-node-3-leaf-2",
395 libvirt__network_name: "compute-node-3-leaf-2",
396 libvirt__forward_mode: "none",
397 libvirt__dhcp_enabled: false
398 c.vm.provider :libvirt do |v|
399 v.memory = 8192
400 v.cpus = 4
401 v.machine_virtual_size = 100
402 v.storage :file, :size => '100G', :type => 'qcow2'
403 v.boot 'network'
404 v.boot 'hd'
405 v.nested = true
406 end
407 c.vm.provider "virtualbox" do |v, override|
408 override.vm.box = "clink15/pxe"
409 v.memory = 1048
410 v.gui = "true"
Andy Bavier99c11d32016-09-14 17:21:20 -0400411 end
412 end
413
Zsolt Harasztiec7df102016-05-05 13:34:18 -0700414 if Vagrant.has_plugin?("vagrant-cachier")
415 config.cache.scope = :box
416 end
417
418end