blob: b9ec1390ad19bb15e92c12704088c371a73a8e67 [file] [log] [blame]
Zsolt Harasztiec7df102016-05-05 13:34:18 -07001# -*- mode: ruby -*-
2# vi: set ft=ruby :
3
Zack Williams03a20ec2017-04-12 17:39:36 -07004$cordpath = ".."
Zack Williamsa1f55082017-02-28 22:41:36 -07005
Zsolt Harasztiec7df102016-05-05 13:34:18 -07006Vagrant.configure(2) do |config|
7
8 if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
Zack Williamsa1f55082017-02-28 22:41:36 -07009 config.vm.synced_folder $cordpath, "/cord", mount_options: ["dmode=700,fmode=600"]
Zsolt Harasztiec7df102016-05-05 13:34:18 -070010 else
Zack Williamsa1f55082017-02-28 22:41:36 -070011 config.vm.synced_folder $cordpath, "/cord"
Zsolt Harasztiec7df102016-05-05 13:34:18 -070012 end
Andy Bavierec9829a2017-02-05 07:58:26 -050013 config.vm.synced_folder '.', '/vagrant', disabled: true
Zsolt Harasztiec7df102016-05-05 13:34:18 -070014
15 config.vm.define "corddev" do |d|
Zsolt Haraszti5b5a42a2016-05-12 22:19:57 -070016 d.ssh.forward_agent = true
Zsolt Harasztiec7df102016-05-05 13:34:18 -070017 d.vm.box = "ubuntu/trusty64"
18 d.vm.hostname = "corddev"
19 d.vm.network "private_network", ip: "10.100.198.200"
Zack Williamsa1f55082017-02-28 22:41:36 -070020 d.vm.provision :shell, path: $cordpath + "/build/scripts/bootstrap_ansible.sh"
David K. Bainbridge0bdec192016-10-13 18:10:10 -070021 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/corddev.yml -c local"
Zsolt Harasztiec7df102016-05-05 13:34:18 -070022 d.vm.provider "virtualbox" do |v|
23 v.memory = 2048
24 end
Andy Bavier5c2e4fa2016-10-31 13:50:52 -040025 d.vm.provider :libvirt do |v, override|
Andy Bavier8ce395f2016-10-14 12:51:30 -040026 v.memory = 2048
Zack Williamsa1f55082017-02-28 22:41:36 -070027 override.vm.synced_folder $cordpath, "/cord", type: "nfs"
Andy Bavier99c11d32016-09-14 17:21:20 -040028 end
Zsolt Harasztiec7df102016-05-05 13:34:18 -070029 end
30
31 config.vm.define "prod" do |d|
32 d.vm.box = "ubuntu/trusty64"
33 d.vm.hostname = "prod"
Andy Bavier51584d42016-12-02 08:39:13 -050034 d.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: '*'
Zsolt Harasztiec7df102016-05-05 13:34:18 -070035 d.vm.network "private_network", ip: "10.100.198.201"
Andy Bavier2505f592016-11-11 15:58:55 -050036 d.vm.network "private_network",
37 ip: "0.0.0.0",
38 auto_config: false,
39 virtualbox__intnet: "cord-mgmt-network",
40 libvirt__network_name: "cord-mgmt-network",
41 libvirt__forward_mode: "none",
42 libvirt__dhcp_enabled: false
43 d.vm.network "private_network",
Andy Bavier0f07bb32017-01-17 10:20:26 -050044 ip: "0.1.0.0",
45 mac: "02420a060101",
46 auto_config: false,
47 virtualbox__intnet: "head-node-leaf-1",
48 libvirt__network_name: "head-node-leaf-1",
49 libvirt__forward_mode: "none",
Andy Bavier2505f592016-11-11 15:58:55 -050050 libvirt__dhcp_enabled: false
Zack Williamsa1f55082017-02-28 22:41:36 -070051 d.vm.provision :shell, path: $cordpath + "/build/scripts/bootstrap_ansible.sh"
alshabibb6ae0862016-08-26 10:55:48 -070052 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/prod.yml -c local"
Zack Williams49af5e62017-03-24 18:02:56 -070053 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 -070054 d.vm.provider "virtualbox" do |v|
David K. Bainbridge97b3f2f2016-06-16 18:08:49 -070055 v.memory = 2048
56 end
Andy Bavier2505f592016-11-11 15:58:55 -050057 d.vm.provider :libvirt do |v, override|
Scott Baker6f58e322016-12-09 14:47:07 -080058 v.memory = 24576
Andy Bavier2505f592016-11-11 15:58:55 -050059 v.cpus = 8
60 v.storage :file, :size => '100G', :type => 'qcow2'
Zack Williamsa1f55082017-02-28 22:41:36 -070061 override.vm.synced_folder $cordpath, "/cord", type: "nfs"
Andy Bavier2505f592016-11-11 15:58:55 -050062 override.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/add-extra-drive.yml -c local"
63 end
David K. Bainbridge97b3f2f2016-06-16 18:08:49 -070064 end
65
David K. Bainbridged506aa62016-06-22 16:06:39 -070066 config.vm.define "switch" do |s|
67 s.vm.box = "ubuntu/trusty64"
68 s.vm.hostname = "fakeswitch"
69 s.vm.network "private_network", ip: "10.100.198.253"
70 s.vm.network "private_network",
71 type: "dhcp",
Andy Bavier2505f592016-11-11 15:58:55 -050072 virtualbox__intnet: "cord-fabric-network",
73 libvirt__network_name: "cord-fabric-network",
David K. Bainbridged506aa62016-06-22 16:06:39 -070074 mac: "cc37ab000001"
Zack Williamsa1f55082017-02-28 22:41:36 -070075 s.vm.provision :shell, path: $cordpath + "/build/scripts/bootstrap_ansible.sh"
alshabibb6ae0862016-08-26 10:55:48 -070076 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/fakeswitch.yml -c local"
David K. Bainbridged506aa62016-06-22 16:06:39 -070077 s.vm.provider "virtualbox" do |v|
David K. Bainbridge97b3f2f2016-06-16 18:08:49 -070078 v.memory = 1048
David K. Bainbridged506aa62016-06-22 16:06:39 -070079 v.name = "fakeswitch"
80 end
81 end
82
Andy Bavier0f07bb32017-01-17 10:20:26 -050083 config.vm.define "leaf-1" do |s|
84 s.vm.box = "ubuntu/trusty64"
85 s.vm.hostname = "leaf-1"
86 s.vm.network "private_network",
87 #type: "dhcp",
88 ip: "0.0.0.0",
89 auto_config: false,
90 virtualbox__intnet: "cord-mgmt-network",
91 libvirt__network_name: "cord-mgmt-network",
92 mac: "cc37ab000011"
93 s.vm.network "private_network",
94 ip: "0.1.0.0",
95 auto_config: false,
96 virtualbox__intnet: "head-node-leaf-1",
97 libvirt__network_name: "head-node-leaf-1",
98 libvirt__forward_mode: "none",
99 libvirt__dhcp_enabled: false
100 s.vm.network "private_network",
101 ip: "0.2.0.0",
102 auto_config: false,
103 virtualbox__intnet: "compute-node-1-leaf-1",
104 libvirt__network_name: "compute-node-1-leaf-1",
105 libvirt__forward_mode: "none",
106 libvirt__dhcp_enabled: false
107 s.vm.network "private_network",
108 ip: "0.5.0.0",
109 auto_config: false,
110 virtualbox__intnet: "leaf-1-spine-1",
111 libvirt__network_name: "leaf-1-spine-1",
112 libvirt__forward_mode: "none",
113 libvirt__dhcp_enabled: false
114 s.vm.network "private_network",
115 ip: "0.6.0.0",
116 auto_config: false,
117 virtualbox__intnet: "leaf-1-spine-2",
118 libvirt__network_name: "leaf-1-spine-2",
119 libvirt__forward_mode: "none",
120 libvirt__dhcp_enabled: false
Zack Williamsa1f55082017-02-28 22:41:36 -0700121 s.vm.provision :shell, path: $cordpath + "/build/scripts/bootstrap_ansible.sh"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500122 if (ENV['FABRIC'] == "1")
Zack Williamsa1f55082017-02-28 22:41:36 -0700123 s.vm.provision :shell, path: $cordpath + "/build/scripts/install.sh", args: "-3f"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500124 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/leafswitch.yml -c local -e 'fabric=true net_prefix=10.6.1'"
125 else
126 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/leafswitch.yml -c local -e 'net_prefix=10.6.1'"
127 end
Andy Bavierec9829a2017-02-05 07:58:26 -0500128 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500129 v.memory = 512
130 v.cpus = 1
Zack Williamsa1f55082017-02-28 22:41:36 -0700131 override.vm.synced_folder $cordpath, "/cord", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500132 end
133 s.vm.provider "virtualbox" do |v, override|
134 v.memory = 512
135 v.cpus = 1
136 end
137 end
138
139 config.vm.define "leaf-2" do |s|
140 s.vm.box = "ubuntu/trusty64"
141 s.vm.hostname = "leaf-2"
142 s.vm.network "private_network",
143 #type: "dhcp",
144 ip: "0.0.0.0",
145 auto_config: false,
146 virtualbox__intnet: "cord-mgmt-network",
147 libvirt__network_name: "cord-mgmt-network",
148 mac: "cc37ab000012"
149 s.vm.network "private_network",
150 ip: "0.3.0.0",
151 auto_config: false,
152 virtualbox__intnet: "compute-node-2-leaf-2",
153 libvirt__network_name: "compute-node-2-leaf-2",
154 libvirt__forward_mode: "none",
155 libvirt__dhcp_enabled: false
156 s.vm.network "private_network",
157 ip: "0.4.0.0",
158 auto_config: false,
159 virtualbox__intnet: "compute-node-3-leaf-2",
160 libvirt__network_name: "compute-node-3-leaf-2",
161 libvirt__forward_mode: "none",
162 libvirt__dhcp_enabled: false
163 s.vm.network "private_network",
164 ip: "0.7.0.0",
165 auto_config: false,
166 virtualbox__intnet: "leaf-2-spine-1",
167 libvirt__network_name: "leaf-2-spine-1",
168 libvirt__forward_mode: "none",
169 libvirt__dhcp_enabled: false
170 s.vm.network "private_network",
171 ip: "0.8.0.0",
172 auto_config: false,
173 virtualbox__intnet: "leaf-2-spine-2",
174 libvirt__network_name: "leaf-2-spine-2",
175 libvirt__forward_mode: "none",
176 libvirt__dhcp_enabled: false
Zack Williamsa1f55082017-02-28 22:41:36 -0700177 s.vm.provision :shell, path: $cordpath + "/build/scripts/bootstrap_ansible.sh"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500178 if (ENV['FABRIC'] == "1")
Zack Williamsa1f55082017-02-28 22:41:36 -0700179 s.vm.provision :shell, path: $cordpath + "/build/scripts/install.sh", args: "-3f"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500180 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/leafswitch.yml -c local -e 'fabric=true net_prefix=10.6.1'"
181 else
182 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/leafswitch.yml -c local -e 'net_prefix=10.6.1'"
183 end
Andy Bavierec9829a2017-02-05 07:58:26 -0500184 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500185 v.memory = 512
186 v.cpus = 1
Zack Williamsa1f55082017-02-28 22:41:36 -0700187 override.vm.synced_folder $cordpath, "/cord", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500188 end
189 s.vm.provider "virtualbox" do |v, override|
190 v.memory = 512
191 v.cpus = 1
192 end
193 end
194
195 config.vm.define "spine-1" do |s|
196 s.vm.box = "ubuntu/trusty64"
197 s.vm.hostname = "spine-1"
198 s.vm.network "private_network",
199 #type: "dhcp",
200 ip: "0.0.0.0",
201 auto_config: false,
202 virtualbox__intnet: "cord-mgmt-network",
203 libvirt__network_name: "cord-mgmt-network",
204 mac: "cc37ab000021"
205 s.vm.network "private_network",
206 ip: "0.5.0.0",
207 auto_config: false,
208 virtualbox__intnet: "leaf-1-spine-1",
209 libvirt__network_name: "leaf-1-spine-1",
210 libvirt__forward_mode: "none",
211 libvirt__dhcp_enabled: false
212 s.vm.network "private_network",
213 ip: "0.7.0.0",
214 auto_config: false,
215 virtualbox__intnet: "leaf-2-spine-1",
216 libvirt__network_name: "leaf-2-spine-1",
217 libvirt__forward_mode: "none",
218 libvirt__dhcp_enabled: false
Zack Williamsa1f55082017-02-28 22:41:36 -0700219 s.vm.provision :shell, path: $cordpath + "/build/scripts/bootstrap_ansible.sh"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500220 if (ENV['FABRIC'] == "1")
Zack Williamsa1f55082017-02-28 22:41:36 -0700221 s.vm.provision :shell, path: $cordpath + "/build/scripts/install.sh", args: "-3f"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500222 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'fabric=true net_prefix=10.6.1'"
223 else
224 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'net_prefix=10.6.1'"
225 end
Andy Bavierec9829a2017-02-05 07:58:26 -0500226 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500227 v.memory = 512
228 v.cpus = 1
Zack Williamsa1f55082017-02-28 22:41:36 -0700229 override.vm.synced_folder $cordpath, "/cord", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500230 end
231 s.vm.provider "virtualbox" do |v, override|
232 v.memory = 512
233 v.cpus = 1
234 end
235 end
236
237 config.vm.define "spine-2" do |s|
238 s.vm.box = "ubuntu/trusty64"
239 s.vm.hostname = "spine-2"
240 s.vm.network "private_network",
241 #type: "dhcp",
242 ip: "0.0.0.0",
243 auto_config: false,
244 virtualbox__intnet: "cord-mgmt-network",
245 libvirt__network_name: "cord-mgmt-network",
246 mac: "cc37ab000022"
247 s.vm.network "private_network",
248 ip: "0.6.0.0",
249 auto_config: false,
250 virtualbox__intnet: "leaf-1-spine-2",
251 libvirt__network_name: "leaf-1-spine-2",
252 libvirt__forward_mode: "none",
253 libvirt__dhcp_enabled: false
254 s.vm.network "private_network",
255 ip: "0.8.0.0",
256 auto_config: false,
257 virtualbox__intnet: "leaf-2-spine-2",
258 libvirt__network_name: "leaf-2-spine-2",
259 libvirt__forward_mode: "none",
260 libvirt__dhcp_enabled: false
Zack Williamsa1f55082017-02-28 22:41:36 -0700261 s.vm.provision :shell, path: $cordpath + "/build/scripts/bootstrap_ansible.sh"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500262 if (ENV['FABRIC'] == "1")
Zack Williamsa1f55082017-02-28 22:41:36 -0700263 s.vm.provision :shell, path: $cordpath + "/build/scripts/install.sh", args: "-3f"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500264 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'fabric=true net_prefix=10.6.1'"
265 else
266 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/spineswitch.yml -c local -e 'net_prefix=10.6.1'"
267 end
Andy Bavierec9829a2017-02-05 07:58:26 -0500268 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500269 v.memory = 512
270 v.cpus = 1
Zack Williamsa1f55082017-02-28 22:41:36 -0700271 override.vm.synced_folder $cordpath, "/cord", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500272 end
273 s.vm.provider "virtualbox" do |v, override|
274 v.memory = 512
275 v.cpus = 1
276 end
277 end
278
alshabibcb8e09b2016-09-06 11:41:29 -0700279 config.vm.define "testbox" do |d|
280 d.vm.box = "fgrehm/trusty64-lxc"
281 d.ssh.forward_agent = true
282 d.vm.hostname = "testbox"
283 d.vm.network "private_network", ip: "10.0.3.100", lxc__bridge_name: 'lxcbr0'
Zack Williamsa1f55082017-02-28 22:41:36 -0700284 d.vm.provision :shell, path: $cordpath + "/build/scripts/bootstrap_ansible.sh"
alshabibcb8e09b2016-09-06 11:41:29 -0700285 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/corddev.yml -c local"
286 config.vm.provider :lxc do |lxc|
287 # Same effect as 'customize ["modifyvm", :id, "--memory", "1024"]' for VirtualBox
288 lxc.customize 'cgroup.memory.limit_in_bytes', '2048M'
alshabib270d7662016-09-06 14:09:18 -0700289 lxc.customize 'aa_profile', 'unconfined'
290 lxc.customize 'cgroup.devices.allow', 'b 7:* rwm'
291 lxc.customize 'cgroup.devices.allow', 'c 10:237 rwm'
alshabibcb8e09b2016-09-06 11:41:29 -0700292 end
David K. Bainbridgea0a36e92016-10-13 18:05:33 -0700293 end
alshabibcb8e09b2016-09-06 11:41:29 -0700294
Andy Bavier0f07bb32017-01-17 10:20:26 -0500295 config.vm.define "compute-node-1" do |c|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500296 c.vm.communicator = "none"
297 c.vm.hostname = "compute-node-1"
298 c.vm.network "private_network",
299 adapter: 1,
300 ip: "0.0.0.0",
301 auto_config: false,
302 virtualbox__intnet: "cord-mgmt-network",
303 libvirt__network_name: "cord-mgmt-network"
304 c.vm.network "private_network",
305 adapter: 2, # The fabric interface for each node
306 ip: "0.2.0.0",
307 auto_config: false,
308 virtualbox__intnet: "compute-node-1-leaf-1",
309 libvirt__network_name: "compute-node-1-leaf-1",
310 libvirt__forward_mode: "none",
311 libvirt__dhcp_enabled: false
312 c.vm.provider :libvirt do |v|
313 v.memory = 8192
314 v.cpus = 4
315 v.machine_virtual_size = 100
316 v.storage :file, :size => '100G', :type => 'qcow2'
317 v.boot 'network'
318 v.boot 'hd'
319 v.nested = true
320 end
321 c.vm.provider "virtualbox" do |v, override|
322 override.vm.box = "clink15/pxe"
323 v.memory = 1048
324 v.gui = "true"
325 end
326 end
327
328 config.vm.define "compute-node-2" do |c|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500329 c.vm.communicator = "none"
330 c.vm.hostname = "compute-node-2"
331 c.vm.network "private_network",
332 adapter: 1,
333 ip: "0.0.0.0",
334 auto_config: false,
335 virtualbox__intnet: "cord-mgmt-network",
336 libvirt__network_name: "cord-mgmt-network"
337 c.vm.network "private_network",
338 adapter: 2, # The fabric interface for each node
339 ip: "0.3.0.0",
340 auto_config: false,
341 virtualbox__intnet: "compute-node-2-leaf-2",
342 libvirt__network_name: "compute-node-2-leaf-2",
343 libvirt__forward_mode: "none",
344 libvirt__dhcp_enabled: false
345 c.vm.provider :libvirt do |v|
346 v.memory = 8192
347 v.cpus = 4
348 v.machine_virtual_size = 100
349 v.storage :file, :size => '100G', :type => 'qcow2'
350 v.boot 'network'
351 v.boot 'hd'
352 v.nested = true
353 end
354 c.vm.provider "virtualbox" do |v, override|
355 override.vm.box = "clink15/pxe"
356 v.memory = 1048
357 v.gui = "true"
358 end
359 end
360
361 config.vm.define "compute-node-3" do |c|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500362 c.vm.communicator = "none"
363 c.vm.hostname = "compute-node-3"
364 c.vm.network "private_network",
365 adapter: 1,
366 ip: "0.0.0.0",
367 auto_config: false,
368 virtualbox__intnet: "cord-mgmt-network",
369 libvirt__network_name: "cord-mgmt-network"
370 c.vm.network "private_network",
371 adapter: 2, # The fabric interface for each node
372 ip: "0.4.0.0",
373 auto_config: false,
374 virtualbox__intnet: "compute-node-3-leaf-2",
375 libvirt__network_name: "compute-node-3-leaf-2",
376 libvirt__forward_mode: "none",
377 libvirt__dhcp_enabled: false
378 c.vm.provider :libvirt do |v|
379 v.memory = 8192
380 v.cpus = 4
381 v.machine_virtual_size = 100
382 v.storage :file, :size => '100G', :type => 'qcow2'
383 v.boot 'network'
384 v.boot 'hd'
385 v.nested = true
386 end
387 c.vm.provider "virtualbox" do |v, override|
388 override.vm.box = "clink15/pxe"
389 v.memory = 1048
390 v.gui = "true"
Andy Bavier99c11d32016-09-14 17:21:20 -0400391 end
392 end
393
Zsolt Harasztiec7df102016-05-05 13:34:18 -0700394 if Vagrant.has_plugin?("vagrant-cachier")
395 config.cache.scope = :box
396 end
397
398end