blob: d7401ad90dd6987840cc3d090a33563a1e53080e [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"
Zack Williams49af5e62017-03-24 18:02:56 -070051 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 cd /cord/build/platform-install; ansible-playbook -i inventory/head-localhost deploy-elasticstack-playbook.yml"
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
Andy Bavierec9829a2017-02-05 07:58:26 -0500126 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500127 v.memory = 512
128 v.cpus = 1
Andy Bavierec9829a2017-02-05 07:58:26 -0500129 override.vm.synced_folder "..", "/cord", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500130 end
131 s.vm.provider "virtualbox" do |v, override|
132 v.memory = 512
133 v.cpus = 1
134 end
135 end
136
137 config.vm.define "leaf-2" do |s|
138 s.vm.box = "ubuntu/trusty64"
139 s.vm.hostname = "leaf-2"
140 s.vm.network "private_network",
141 #type: "dhcp",
142 ip: "0.0.0.0",
143 auto_config: false,
144 virtualbox__intnet: "cord-mgmt-network",
145 libvirt__network_name: "cord-mgmt-network",
146 mac: "cc37ab000012"
147 s.vm.network "private_network",
148 ip: "0.3.0.0",
149 auto_config: false,
150 virtualbox__intnet: "compute-node-2-leaf-2",
151 libvirt__network_name: "compute-node-2-leaf-2",
152 libvirt__forward_mode: "none",
153 libvirt__dhcp_enabled: false
154 s.vm.network "private_network",
155 ip: "0.4.0.0",
156 auto_config: false,
157 virtualbox__intnet: "compute-node-3-leaf-2",
158 libvirt__network_name: "compute-node-3-leaf-2",
159 libvirt__forward_mode: "none",
160 libvirt__dhcp_enabled: false
161 s.vm.network "private_network",
162 ip: "0.7.0.0",
163 auto_config: false,
164 virtualbox__intnet: "leaf-2-spine-1",
165 libvirt__network_name: "leaf-2-spine-1",
166 libvirt__forward_mode: "none",
167 libvirt__dhcp_enabled: false
168 s.vm.network "private_network",
169 ip: "0.8.0.0",
170 auto_config: false,
171 virtualbox__intnet: "leaf-2-spine-2",
172 libvirt__network_name: "leaf-2-spine-2",
173 libvirt__forward_mode: "none",
174 libvirt__dhcp_enabled: false
175 s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
176 if (ENV['FABRIC'] == "1")
177 s.vm.provision :shell, path: "scripts/install.sh", args: "-3f"
178 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/leafswitch.yml -c local -e 'fabric=true net_prefix=10.6.1'"
179 else
180 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/leafswitch.yml -c local -e 'net_prefix=10.6.1'"
181 end
Andy Bavierec9829a2017-02-05 07:58:26 -0500182 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500183 v.memory = 512
184 v.cpus = 1
Andy Bavierec9829a2017-02-05 07:58:26 -0500185 override.vm.synced_folder "..", "/cord", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500186 end
187 s.vm.provider "virtualbox" do |v, override|
188 v.memory = 512
189 v.cpus = 1
190 end
191 end
192
193 config.vm.define "spine-1" do |s|
194 s.vm.box = "ubuntu/trusty64"
195 s.vm.hostname = "spine-1"
196 s.vm.network "private_network",
197 #type: "dhcp",
198 ip: "0.0.0.0",
199 auto_config: false,
200 virtualbox__intnet: "cord-mgmt-network",
201 libvirt__network_name: "cord-mgmt-network",
202 mac: "cc37ab000021"
203 s.vm.network "private_network",
204 ip: "0.5.0.0",
205 auto_config: false,
206 virtualbox__intnet: "leaf-1-spine-1",
207 libvirt__network_name: "leaf-1-spine-1",
208 libvirt__forward_mode: "none",
209 libvirt__dhcp_enabled: false
210 s.vm.network "private_network",
211 ip: "0.7.0.0",
212 auto_config: false,
213 virtualbox__intnet: "leaf-2-spine-1",
214 libvirt__network_name: "leaf-2-spine-1",
215 libvirt__forward_mode: "none",
216 libvirt__dhcp_enabled: false
217 s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
218 if (ENV['FABRIC'] == "1")
219 s.vm.provision :shell, path: "scripts/install.sh", args: "-3f"
220 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'fabric=true net_prefix=10.6.1'"
221 else
222 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'net_prefix=10.6.1'"
223 end
Andy Bavierec9829a2017-02-05 07:58:26 -0500224 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500225 v.memory = 512
226 v.cpus = 1
Andy Bavierec9829a2017-02-05 07:58:26 -0500227 override.vm.synced_folder "..", "/cord", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500228 end
229 s.vm.provider "virtualbox" do |v, override|
230 v.memory = 512
231 v.cpus = 1
232 end
233 end
234
235 config.vm.define "spine-2" do |s|
236 s.vm.box = "ubuntu/trusty64"
237 s.vm.hostname = "spine-2"
238 s.vm.network "private_network",
239 #type: "dhcp",
240 ip: "0.0.0.0",
241 auto_config: false,
242 virtualbox__intnet: "cord-mgmt-network",
243 libvirt__network_name: "cord-mgmt-network",
244 mac: "cc37ab000022"
245 s.vm.network "private_network",
246 ip: "0.6.0.0",
247 auto_config: false,
248 virtualbox__intnet: "leaf-1-spine-2",
249 libvirt__network_name: "leaf-1-spine-2",
250 libvirt__forward_mode: "none",
251 libvirt__dhcp_enabled: false
252 s.vm.network "private_network",
253 ip: "0.8.0.0",
254 auto_config: false,
255 virtualbox__intnet: "leaf-2-spine-2",
256 libvirt__network_name: "leaf-2-spine-2",
257 libvirt__forward_mode: "none",
258 libvirt__dhcp_enabled: false
259 s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
260 if (ENV['FABRIC'] == "1")
261 s.vm.provision :shell, path: "scripts/install.sh", args: "-3f"
262 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'fabric=true net_prefix=10.6.1'"
263 else
264 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'net_prefix=10.6.1'"
265 end
Andy Bavierec9829a2017-02-05 07:58:26 -0500266 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500267 v.memory = 512
268 v.cpus = 1
Andy Bavierec9829a2017-02-05 07:58:26 -0500269 override.vm.synced_folder "..", "/cord", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500270 end
271 s.vm.provider "virtualbox" do |v, override|
272 v.memory = 512
273 v.cpus = 1
274 end
275 end
276
alshabibcb8e09b2016-09-06 11:41:29 -0700277 config.vm.define "testbox" do |d|
278 d.vm.box = "fgrehm/trusty64-lxc"
279 d.ssh.forward_agent = true
280 d.vm.hostname = "testbox"
281 d.vm.network "private_network", ip: "10.0.3.100", lxc__bridge_name: 'lxcbr0'
282 d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
283 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/corddev.yml -c local"
284 config.vm.provider :lxc do |lxc|
285 # Same effect as 'customize ["modifyvm", :id, "--memory", "1024"]' for VirtualBox
286 lxc.customize 'cgroup.memory.limit_in_bytes', '2048M'
alshabib270d7662016-09-06 14:09:18 -0700287 lxc.customize 'aa_profile', 'unconfined'
288 lxc.customize 'cgroup.devices.allow', 'b 7:* rwm'
289 lxc.customize 'cgroup.devices.allow', 'c 10:237 rwm'
alshabibcb8e09b2016-09-06 11:41:29 -0700290 end
David K. Bainbridgea0a36e92016-10-13 18:05:33 -0700291 end
alshabibcb8e09b2016-09-06 11:41:29 -0700292
Andy Bavier0f07bb32017-01-17 10:20:26 -0500293 config.vm.define "compute-node-1" do |c|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500294 c.vm.communicator = "none"
295 c.vm.hostname = "compute-node-1"
296 c.vm.network "private_network",
297 adapter: 1,
298 ip: "0.0.0.0",
299 auto_config: false,
300 virtualbox__intnet: "cord-mgmt-network",
301 libvirt__network_name: "cord-mgmt-network"
302 c.vm.network "private_network",
303 adapter: 2, # The fabric interface for each node
304 ip: "0.2.0.0",
305 auto_config: false,
306 virtualbox__intnet: "compute-node-1-leaf-1",
307 libvirt__network_name: "compute-node-1-leaf-1",
308 libvirt__forward_mode: "none",
309 libvirt__dhcp_enabled: false
310 c.vm.provider :libvirt do |v|
311 v.memory = 8192
312 v.cpus = 4
313 v.machine_virtual_size = 100
314 v.storage :file, :size => '100G', :type => 'qcow2'
315 v.boot 'network'
316 v.boot 'hd'
317 v.nested = true
318 end
319 c.vm.provider "virtualbox" do |v, override|
320 override.vm.box = "clink15/pxe"
321 v.memory = 1048
322 v.gui = "true"
323 end
324 end
325
326 config.vm.define "compute-node-2" do |c|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500327 c.vm.communicator = "none"
328 c.vm.hostname = "compute-node-2"
329 c.vm.network "private_network",
330 adapter: 1,
331 ip: "0.0.0.0",
332 auto_config: false,
333 virtualbox__intnet: "cord-mgmt-network",
334 libvirt__network_name: "cord-mgmt-network"
335 c.vm.network "private_network",
336 adapter: 2, # The fabric interface for each node
337 ip: "0.3.0.0",
338 auto_config: false,
339 virtualbox__intnet: "compute-node-2-leaf-2",
340 libvirt__network_name: "compute-node-2-leaf-2",
341 libvirt__forward_mode: "none",
342 libvirt__dhcp_enabled: false
343 c.vm.provider :libvirt do |v|
344 v.memory = 8192
345 v.cpus = 4
346 v.machine_virtual_size = 100
347 v.storage :file, :size => '100G', :type => 'qcow2'
348 v.boot 'network'
349 v.boot 'hd'
350 v.nested = true
351 end
352 c.vm.provider "virtualbox" do |v, override|
353 override.vm.box = "clink15/pxe"
354 v.memory = 1048
355 v.gui = "true"
356 end
357 end
358
359 config.vm.define "compute-node-3" do |c|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500360 c.vm.communicator = "none"
361 c.vm.hostname = "compute-node-3"
362 c.vm.network "private_network",
363 adapter: 1,
364 ip: "0.0.0.0",
365 auto_config: false,
366 virtualbox__intnet: "cord-mgmt-network",
367 libvirt__network_name: "cord-mgmt-network"
368 c.vm.network "private_network",
369 adapter: 2, # The fabric interface for each node
370 ip: "0.4.0.0",
371 auto_config: false,
372 virtualbox__intnet: "compute-node-3-leaf-2",
373 libvirt__network_name: "compute-node-3-leaf-2",
374 libvirt__forward_mode: "none",
375 libvirt__dhcp_enabled: false
376 c.vm.provider :libvirt do |v|
377 v.memory = 8192
378 v.cpus = 4
379 v.machine_virtual_size = 100
380 v.storage :file, :size => '100G', :type => 'qcow2'
381 v.boot 'network'
382 v.boot 'hd'
383 v.nested = true
384 end
385 c.vm.provider "virtualbox" do |v, override|
386 override.vm.box = "clink15/pxe"
387 v.memory = 1048
388 v.gui = "true"
Andy Bavier99c11d32016-09-14 17:21:20 -0400389 end
390 end
391
Zsolt Harasztiec7df102016-05-05 13:34:18 -0700392 if Vagrant.has_plugin?("vagrant-cachier")
393 config.cache.scope = :box
394 end
395
396end