blob: d4d47359ce28ae51903bbf1ddaac4ef2d99aa836 [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"
Zack Williamse0dedec2017-02-19 23:22:32 -070022 d.vm.network :forwarded_port, guest: 2514, host: 2514, host_ip: '*'
23 d.vm.network :forwarded_port, guest: 4560, host: 4560, host_ip: '*'
Sapan Bhatia01ddea62017-02-10 11:28:48 -080024
25 d.vm.hostname = "elastic"
26 d.vm.network "private_network", ip: "10.100.198.222"
27 d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
28 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/elastic.yml -c local"
29 d.vm.provider "virtualbox" do |v|
30 v.memory = 4096
31 end
32 d.vm.provider :libvirt do |v, override|
33 v.memory = 4096
34 override.vm.synced_folder "..", "/cord", type: "nfs"
35 end
36 end
37
Zsolt Harasztiec7df102016-05-05 13:34:18 -070038 config.vm.define "corddev" do |d|
Zsolt Haraszti5b5a42a2016-05-12 22:19:57 -070039 d.ssh.forward_agent = true
Zsolt Harasztiec7df102016-05-05 13:34:18 -070040 d.vm.box = "ubuntu/trusty64"
41 d.vm.hostname = "corddev"
42 d.vm.network "private_network", ip: "10.100.198.200"
David K. Bainbridge0bdec192016-10-13 18:10:10 -070043 d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
44 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/corddev.yml -c local"
Zsolt Harasztiec7df102016-05-05 13:34:18 -070045 d.vm.provider "virtualbox" do |v|
46 v.memory = 2048
47 end
Andy Bavier5c2e4fa2016-10-31 13:50:52 -040048 d.vm.provider :libvirt do |v, override|
Andy Bavier8ce395f2016-10-14 12:51:30 -040049 v.memory = 2048
Andy Bavier5c2e4fa2016-10-31 13:50:52 -040050 override.vm.synced_folder "..", "/cord", type: "nfs"
Andy Bavier99c11d32016-09-14 17:21:20 -040051 end
Zsolt Harasztiec7df102016-05-05 13:34:18 -070052 end
53
54 config.vm.define "prod" do |d|
55 d.vm.box = "ubuntu/trusty64"
56 d.vm.hostname = "prod"
Andy Bavier51584d42016-12-02 08:39:13 -050057 d.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: '*'
Zsolt Harasztiec7df102016-05-05 13:34:18 -070058 d.vm.network "private_network", ip: "10.100.198.201"
Andy Bavier2505f592016-11-11 15:58:55 -050059 d.vm.network "private_network",
60 ip: "0.0.0.0",
61 auto_config: false,
62 virtualbox__intnet: "cord-mgmt-network",
63 libvirt__network_name: "cord-mgmt-network",
64 libvirt__forward_mode: "none",
65 libvirt__dhcp_enabled: false
66 d.vm.network "private_network",
Andy Bavier0f07bb32017-01-17 10:20:26 -050067 ip: "0.1.0.0",
68 mac: "02420a060101",
69 auto_config: false,
70 virtualbox__intnet: "head-node-leaf-1",
71 libvirt__network_name: "head-node-leaf-1",
72 libvirt__forward_mode: "none",
Andy Bavier2505f592016-11-11 15:58:55 -050073 libvirt__dhcp_enabled: false
David K. Bainbridge6f2cbe72016-08-19 15:48:07 -070074 d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
alshabibb6ae0862016-08-26 10:55:48 -070075 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/prod.yml -c local"
Zsolt Harasztiec7df102016-05-05 13:34:18 -070076 d.vm.provider "virtualbox" do |v|
David K. Bainbridge97b3f2f2016-06-16 18:08:49 -070077 v.memory = 2048
78 end
Andy Bavier2505f592016-11-11 15:58:55 -050079 d.vm.provider :libvirt do |v, override|
Scott Baker6f58e322016-12-09 14:47:07 -080080 v.memory = 24576
Andy Bavier2505f592016-11-11 15:58:55 -050081 v.cpus = 8
82 v.storage :file, :size => '100G', :type => 'qcow2'
Andy Bavier750bc6b2016-12-01 06:53:57 -050083 override.vm.synced_folder "..", "/cord", type: "nfs"
Andy Bavier2505f592016-11-11 15:58:55 -050084 override.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/add-extra-drive.yml -c local"
85 end
David K. Bainbridge97b3f2f2016-06-16 18:08:49 -070086 end
87
David K. Bainbridged506aa62016-06-22 16:06:39 -070088 config.vm.define "switch" do |s|
89 s.vm.box = "ubuntu/trusty64"
90 s.vm.hostname = "fakeswitch"
91 s.vm.network "private_network", ip: "10.100.198.253"
92 s.vm.network "private_network",
93 type: "dhcp",
Andy Bavier2505f592016-11-11 15:58:55 -050094 virtualbox__intnet: "cord-fabric-network",
95 libvirt__network_name: "cord-fabric-network",
David K. Bainbridged506aa62016-06-22 16:06:39 -070096 mac: "cc37ab000001"
97 s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
alshabibb6ae0862016-08-26 10:55:48 -070098 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/fakeswitch.yml -c local"
David K. Bainbridged506aa62016-06-22 16:06:39 -070099 s.vm.provider "virtualbox" do |v|
David K. Bainbridge97b3f2f2016-06-16 18:08:49 -0700100 v.memory = 1048
David K. Bainbridged506aa62016-06-22 16:06:39 -0700101 v.name = "fakeswitch"
102 end
103 end
104
Andy Bavier0f07bb32017-01-17 10:20:26 -0500105 config.vm.define "leaf-1" do |s|
106 s.vm.box = "ubuntu/trusty64"
107 s.vm.hostname = "leaf-1"
108 s.vm.network "private_network",
109 #type: "dhcp",
110 ip: "0.0.0.0",
111 auto_config: false,
112 virtualbox__intnet: "cord-mgmt-network",
113 libvirt__network_name: "cord-mgmt-network",
114 mac: "cc37ab000011"
115 s.vm.network "private_network",
116 ip: "0.1.0.0",
117 auto_config: false,
118 virtualbox__intnet: "head-node-leaf-1",
119 libvirt__network_name: "head-node-leaf-1",
120 libvirt__forward_mode: "none",
121 libvirt__dhcp_enabled: false
122 s.vm.network "private_network",
123 ip: "0.2.0.0",
124 auto_config: false,
125 virtualbox__intnet: "compute-node-1-leaf-1",
126 libvirt__network_name: "compute-node-1-leaf-1",
127 libvirt__forward_mode: "none",
128 libvirt__dhcp_enabled: false
129 s.vm.network "private_network",
130 ip: "0.5.0.0",
131 auto_config: false,
132 virtualbox__intnet: "leaf-1-spine-1",
133 libvirt__network_name: "leaf-1-spine-1",
134 libvirt__forward_mode: "none",
135 libvirt__dhcp_enabled: false
136 s.vm.network "private_network",
137 ip: "0.6.0.0",
138 auto_config: false,
139 virtualbox__intnet: "leaf-1-spine-2",
140 libvirt__network_name: "leaf-1-spine-2",
141 libvirt__forward_mode: "none",
142 libvirt__dhcp_enabled: false
143 s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
144 if (ENV['FABRIC'] == "1")
145 s.vm.provision :shell, path: "scripts/install.sh", args: "-3f"
146 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/leafswitch.yml -c local -e 'fabric=true net_prefix=10.6.1'"
147 else
148 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/leafswitch.yml -c local -e 'net_prefix=10.6.1'"
149 end
Andy Bavierec9829a2017-02-05 07:58:26 -0500150 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500151 v.memory = 512
152 v.cpus = 1
Andy Bavierec9829a2017-02-05 07:58:26 -0500153 override.vm.synced_folder "..", "/cord", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500154 end
155 s.vm.provider "virtualbox" do |v, override|
156 v.memory = 512
157 v.cpus = 1
158 end
159 end
160
161 config.vm.define "leaf-2" do |s|
162 s.vm.box = "ubuntu/trusty64"
163 s.vm.hostname = "leaf-2"
164 s.vm.network "private_network",
165 #type: "dhcp",
166 ip: "0.0.0.0",
167 auto_config: false,
168 virtualbox__intnet: "cord-mgmt-network",
169 libvirt__network_name: "cord-mgmt-network",
170 mac: "cc37ab000012"
171 s.vm.network "private_network",
172 ip: "0.3.0.0",
173 auto_config: false,
174 virtualbox__intnet: "compute-node-2-leaf-2",
175 libvirt__network_name: "compute-node-2-leaf-2",
176 libvirt__forward_mode: "none",
177 libvirt__dhcp_enabled: false
178 s.vm.network "private_network",
179 ip: "0.4.0.0",
180 auto_config: false,
181 virtualbox__intnet: "compute-node-3-leaf-2",
182 libvirt__network_name: "compute-node-3-leaf-2",
183 libvirt__forward_mode: "none",
184 libvirt__dhcp_enabled: false
185 s.vm.network "private_network",
186 ip: "0.7.0.0",
187 auto_config: false,
188 virtualbox__intnet: "leaf-2-spine-1",
189 libvirt__network_name: "leaf-2-spine-1",
190 libvirt__forward_mode: "none",
191 libvirt__dhcp_enabled: false
192 s.vm.network "private_network",
193 ip: "0.8.0.0",
194 auto_config: false,
195 virtualbox__intnet: "leaf-2-spine-2",
196 libvirt__network_name: "leaf-2-spine-2",
197 libvirt__forward_mode: "none",
198 libvirt__dhcp_enabled: false
199 s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
200 if (ENV['FABRIC'] == "1")
201 s.vm.provision :shell, path: "scripts/install.sh", args: "-3f"
202 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/leafswitch.yml -c local -e 'fabric=true net_prefix=10.6.1'"
203 else
204 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/leafswitch.yml -c local -e 'net_prefix=10.6.1'"
205 end
Andy Bavierec9829a2017-02-05 07:58:26 -0500206 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500207 v.memory = 512
208 v.cpus = 1
Andy Bavierec9829a2017-02-05 07:58:26 -0500209 override.vm.synced_folder "..", "/cord", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500210 end
211 s.vm.provider "virtualbox" do |v, override|
212 v.memory = 512
213 v.cpus = 1
214 end
215 end
216
217 config.vm.define "spine-1" do |s|
218 s.vm.box = "ubuntu/trusty64"
219 s.vm.hostname = "spine-1"
220 s.vm.network "private_network",
221 #type: "dhcp",
222 ip: "0.0.0.0",
223 auto_config: false,
224 virtualbox__intnet: "cord-mgmt-network",
225 libvirt__network_name: "cord-mgmt-network",
226 mac: "cc37ab000021"
227 s.vm.network "private_network",
228 ip: "0.5.0.0",
229 auto_config: false,
230 virtualbox__intnet: "leaf-1-spine-1",
231 libvirt__network_name: "leaf-1-spine-1",
232 libvirt__forward_mode: "none",
233 libvirt__dhcp_enabled: false
234 s.vm.network "private_network",
235 ip: "0.7.0.0",
236 auto_config: false,
237 virtualbox__intnet: "leaf-2-spine-1",
238 libvirt__network_name: "leaf-2-spine-1",
239 libvirt__forward_mode: "none",
240 libvirt__dhcp_enabled: false
241 s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
242 if (ENV['FABRIC'] == "1")
243 s.vm.provision :shell, path: "scripts/install.sh", args: "-3f"
244 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'fabric=true net_prefix=10.6.1'"
245 else
246 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'net_prefix=10.6.1'"
247 end
Andy Bavierec9829a2017-02-05 07:58:26 -0500248 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500249 v.memory = 512
250 v.cpus = 1
Andy Bavierec9829a2017-02-05 07:58:26 -0500251 override.vm.synced_folder "..", "/cord", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500252 end
253 s.vm.provider "virtualbox" do |v, override|
254 v.memory = 512
255 v.cpus = 1
256 end
257 end
258
259 config.vm.define "spine-2" do |s|
260 s.vm.box = "ubuntu/trusty64"
261 s.vm.hostname = "spine-2"
262 s.vm.network "private_network",
263 #type: "dhcp",
264 ip: "0.0.0.0",
265 auto_config: false,
266 virtualbox__intnet: "cord-mgmt-network",
267 libvirt__network_name: "cord-mgmt-network",
268 mac: "cc37ab000022"
269 s.vm.network "private_network",
270 ip: "0.6.0.0",
271 auto_config: false,
272 virtualbox__intnet: "leaf-1-spine-2",
273 libvirt__network_name: "leaf-1-spine-2",
274 libvirt__forward_mode: "none",
275 libvirt__dhcp_enabled: false
276 s.vm.network "private_network",
277 ip: "0.8.0.0",
278 auto_config: false,
279 virtualbox__intnet: "leaf-2-spine-2",
280 libvirt__network_name: "leaf-2-spine-2",
281 libvirt__forward_mode: "none",
282 libvirt__dhcp_enabled: false
283 s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
284 if (ENV['FABRIC'] == "1")
285 s.vm.provision :shell, path: "scripts/install.sh", args: "-3f"
286 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'fabric=true net_prefix=10.6.1'"
287 else
288 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'net_prefix=10.6.1'"
289 end
Andy Bavierec9829a2017-02-05 07:58:26 -0500290 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500291 v.memory = 512
292 v.cpus = 1
Andy Bavierec9829a2017-02-05 07:58:26 -0500293 override.vm.synced_folder "..", "/cord", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500294 end
295 s.vm.provider "virtualbox" do |v, override|
296 v.memory = 512
297 v.cpus = 1
298 end
299 end
300
alshabibcb8e09b2016-09-06 11:41:29 -0700301 config.vm.define "testbox" do |d|
302 d.vm.box = "fgrehm/trusty64-lxc"
303 d.ssh.forward_agent = true
304 d.vm.hostname = "testbox"
305 d.vm.network "private_network", ip: "10.0.3.100", lxc__bridge_name: 'lxcbr0'
306 d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
307 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/corddev.yml -c local"
308 config.vm.provider :lxc do |lxc|
309 # Same effect as 'customize ["modifyvm", :id, "--memory", "1024"]' for VirtualBox
310 lxc.customize 'cgroup.memory.limit_in_bytes', '2048M'
alshabib270d7662016-09-06 14:09:18 -0700311 lxc.customize 'aa_profile', 'unconfined'
312 lxc.customize 'cgroup.devices.allow', 'b 7:* rwm'
313 lxc.customize 'cgroup.devices.allow', 'c 10:237 rwm'
alshabibcb8e09b2016-09-06 11:41:29 -0700314 end
David K. Bainbridgea0a36e92016-10-13 18:05:33 -0700315 end
alshabibcb8e09b2016-09-06 11:41:29 -0700316
Andy Bavier0f07bb32017-01-17 10:20:26 -0500317 config.vm.define "compute-node-1" do |c|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500318 c.vm.communicator = "none"
319 c.vm.hostname = "compute-node-1"
320 c.vm.network "private_network",
321 adapter: 1,
322 ip: "0.0.0.0",
323 auto_config: false,
324 virtualbox__intnet: "cord-mgmt-network",
325 libvirt__network_name: "cord-mgmt-network"
326 c.vm.network "private_network",
327 adapter: 2, # The fabric interface for each node
328 ip: "0.2.0.0",
329 auto_config: false,
330 virtualbox__intnet: "compute-node-1-leaf-1",
331 libvirt__network_name: "compute-node-1-leaf-1",
332 libvirt__forward_mode: "none",
333 libvirt__dhcp_enabled: false
334 c.vm.provider :libvirt do |v|
335 v.memory = 8192
336 v.cpus = 4
337 v.machine_virtual_size = 100
338 v.storage :file, :size => '100G', :type => 'qcow2'
339 v.boot 'network'
340 v.boot 'hd'
341 v.nested = true
342 end
343 c.vm.provider "virtualbox" do |v, override|
344 override.vm.box = "clink15/pxe"
345 v.memory = 1048
346 v.gui = "true"
347 end
348 end
349
350 config.vm.define "compute-node-2" do |c|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500351 c.vm.communicator = "none"
352 c.vm.hostname = "compute-node-2"
353 c.vm.network "private_network",
354 adapter: 1,
355 ip: "0.0.0.0",
356 auto_config: false,
357 virtualbox__intnet: "cord-mgmt-network",
358 libvirt__network_name: "cord-mgmt-network"
359 c.vm.network "private_network",
360 adapter: 2, # The fabric interface for each node
361 ip: "0.3.0.0",
362 auto_config: false,
363 virtualbox__intnet: "compute-node-2-leaf-2",
364 libvirt__network_name: "compute-node-2-leaf-2",
365 libvirt__forward_mode: "none",
366 libvirt__dhcp_enabled: false
367 c.vm.provider :libvirt do |v|
368 v.memory = 8192
369 v.cpus = 4
370 v.machine_virtual_size = 100
371 v.storage :file, :size => '100G', :type => 'qcow2'
372 v.boot 'network'
373 v.boot 'hd'
374 v.nested = true
375 end
376 c.vm.provider "virtualbox" do |v, override|
377 override.vm.box = "clink15/pxe"
378 v.memory = 1048
379 v.gui = "true"
380 end
381 end
382
383 config.vm.define "compute-node-3" do |c|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500384 c.vm.communicator = "none"
385 c.vm.hostname = "compute-node-3"
386 c.vm.network "private_network",
387 adapter: 1,
388 ip: "0.0.0.0",
389 auto_config: false,
390 virtualbox__intnet: "cord-mgmt-network",
391 libvirt__network_name: "cord-mgmt-network"
392 c.vm.network "private_network",
393 adapter: 2, # The fabric interface for each node
394 ip: "0.4.0.0",
395 auto_config: false,
396 virtualbox__intnet: "compute-node-3-leaf-2",
397 libvirt__network_name: "compute-node-3-leaf-2",
398 libvirt__forward_mode: "none",
399 libvirt__dhcp_enabled: false
400 c.vm.provider :libvirt do |v|
401 v.memory = 8192
402 v.cpus = 4
403 v.machine_virtual_size = 100
404 v.storage :file, :size => '100G', :type => 'qcow2'
405 v.boot 'network'
406 v.boot 'hd'
407 v.nested = true
408 end
409 c.vm.provider "virtualbox" do |v, override|
410 override.vm.box = "clink15/pxe"
411 v.memory = 1048
412 v.gui = "true"
Andy Bavier99c11d32016-09-14 17:21:20 -0400413 end
414 end
415
Zsolt Harasztiec7df102016-05-05 13:34:18 -0700416 if Vagrant.has_plugin?("vagrant-cachier")
417 config.cache.scope = :box
418 end
419
420end