-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
180 lines (135 loc) · 4.86 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# Define our Vagrant environment
#
# -*- mode: ruby -*-
# vi: set ft=ruby :
BOX_NAME = "naelyn/ubuntu-trusty64-libvirt"
Vagrant.configure("2") do |config|
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :machine
end
# libvirt provider config
config.vm.provider :libvirt do |libvirt|
libvirt.nested = true
# are these needed?
# libvirt.host = ""
# libvirt.uri = "qemu+unix:///system"
# libvirt.driver = "kvm"
# libvirt.connect_via_ssh = true
# libvirt.username = "root"
end
# create mgmt node (OSAD deployment host)
config.vm.define :mgmt do |mgmt_config|
# set libvirt options
mgmt_config.vm.provider :libvirt do |vm|
vm.memory = 512
end
# configure mgmt vm
mgmt_config.vm.box = BOX_NAME
mgmt_config.vm.hostname = "mgmt"
# (eth1) mgmt network
mgmt_config.vm.network :private_network, :ip => "10.10.0.10"
# (eth2) container network
mgmt_config.vm.network :private_network, :ip => "172.29.236.10"
# (eth3) tunnel network
mgmt_config.vm.network :private_network, :ip => "172.29.240.10"
# (eth4) storage network
mgmt_config.vm.network :private_network, :ip => "172.29.244.10"
end
# create (3) infrastructure nodes
(1..3).each do |i|
config.vm.define "infra#{i}" do |infra_config|
# set libvirt options
infra_config.vm.provider :libvirt do |vm|
vm.memory = 2096
end
# configure infrastructure vms
infra_config.vm.box = BOX_NAME
infra_config.vm.hostname = "infra#{i}"
# (eth1) mgmt network
infra_config.vm.network :private_network, :ip => "10.10.0.2#{i}"
infra_config.vm.network "forwarded_port", guest: 80, host: 8080
# (eth2) container network
infra_config.vm.network :private_network, :ip => "172.29.236.2#{i}"
# (eth3) tunnel network
infra_config.vm.network :private_network, :ip => "172.29.240.2#{i}"
# (eth4) storage network
infra_config.vm.network :private_network, :ip => "172.29.244.2#{i}"
end
end
# create (1) compute node(s)
(1..1).each do |i|
config.vm.define "compute#{i}" do |compute_config|
# set libvirt options
compute_config.vm.provider :libvirt do |vm|
vm.memory = 2096
end
# configure compute vm(s)
compute_config.vm.box = BOX_NAME
compute_config.vm.hostname = "compute#{i}"
# (eth1) mgmt network
compute_config.vm.network :private_network, :ip => "10.10.0.3#{i}"
# (eth2) container network
compute_config.vm.network :private_network, :ip => "172.29.236.3#{i}"
# (eth3) tunnel network
compute_config.vm.network :private_network, :ip => "172.29.240.3#{i}"
# (eth4) storage network
compute_config.vm.network :private_network, :ip => "172.29.244.3#{i}"
end
end
# create (1) block storage node(s)
(1..1).each do |i|
config.vm.define "block#{i}" do |block_config|
# set libvirt options
block_config.vm.provider :libvirt do |vm|
vm.memory = 1024
end
# configure block storage node(s)
block_config.vm.box = BOX_NAME
block_config.vm.hostname = "block#{i}"
# (eth1) mgmt network
block_config.vm.network :private_network, :ip => "10.10.0.4#{i}"
# (eth2) container network
block_config.vm.network :private_network, :ip => "172.29.236.4#{i}"
# (eth3) tunnel network
block_config.vm.network :private_network, :ip => "172.29.240.4#{i}"
# (eth4) storage network
block_config.vm.network :private_network, :ip => "172.29.244.4#{i}"
end
end
# create logging node
config.vm.define "logger" do |logger_config|
# set libvirt options
logger_config.vm.provider :libvirt do |vm|
vm.memory = 512
end
# configure logging node
logger_config.vm.box = BOX_NAME
logger_config.vm.hostname = "logger"
# (eth1) mgmt network
logger_config.vm.network :private_network, :ip => "10.10.0.9"
# (eth2) container network
logger_config.vm.network :private_network, :ip => "172.29.236.9"
# (eth3) tunnel network
logger_config.vm.network :private_network, :ip => "172.29.240.9"
# (eth4) storage network
logger_config.vm.network :private_network, :ip => "172.29.244.9"
end
# create HAproxy node
config.vm.define "proxy" do |proxy_config|
# set libvirt options
proxy_config.vm.provider :libvirt do |vm|
vm.memory = 512
end
# configure HAproxy node
proxy_config.vm.box = BOX_NAME
proxy_config.vm.hostname = "proxy"
# (eth1) mgmt network
proxy_config.vm.network :private_network, :ip => "10.10.0.8"
# (eth2) container network
proxy_config.vm.network :private_network, :ip => "172.29.236.8"
# (eth3) tunnel network
proxy_config.vm.network :private_network, :ip => "172.29.240.8"
# (eth4) storage network
proxy_config.vm.network :private_network, :ip => "172.29.244.8"
end
end