blob: 6180179039d61eef8a829679c4f95c6bfa9c904e [file] [log] [blame]
Ales Komarekef982692016-02-21 14:56:07 +01001
2==================
smolaon552ba582016-02-23 20:35:42 +01003Metal as a Service
Ales Komarekef982692016-02-21 14:56:07 +01004==================
5
6Service maas description
7
8Sample pillars
9==============
10
11Single maas service
12
13.. code-block:: yaml
14
15 maas:
16 server:
17 enabled: true
18
Ondrej Smola9af2b082016-08-25 17:37:29 +020019Single MAAS region service [single UI/API]
20
21.. code-block:: yaml
22
Damian Szelugaa8248102017-03-16 08:48:51 +010023 maas:
Damian Szeluga336ff2e2017-03-30 11:19:34 +020024 salt_master_ip: 192.168.0.10
Damian Szelugaa8248102017-03-16 08:48:51 +010025 region:
Jiri Broulik0df14bc2017-08-07 10:01:55 +020026 upstream_proxy:
27 address: 10.0.0.1
28 port: 8080
Ondrej Smola3ffb6312017-09-22 17:13:10 +020029 user: username #OPTIONAL
30 password: password #OPTIONAL
Damian Szelugaa8248102017-03-16 08:48:51 +010031 theme: mirantis
32 bind:
33 host: 192.168.0.10:5240
34 port: 5240
35 admin:
36 username: exampleuser
37 password: examplepassword
38 email: email@example.com
39 database:
40 engine: null
41 host: localhost
42 name: maasdb
43 password: qwqwqw
44 username: maas
45 enabled: true
46 user: mirantis
47 token: "89EgtWkX45ddjMYpuL:SqVjxFG87Dr6kVf4Wp:5WLfbUgmm9XQtJxm3V2LUUy7bpCmqmnk"
48 fabrics:
azvyagintsev06b71e72017-11-08 17:11:07 +020049 test-fabric1:
50 description: "Test fabric"
51 test-fabric2:
52 description: "Test fabric2"
Damian Szelugaa8248102017-03-16 08:48:51 +010053 subnets:
54 subnet1:
azvyagintsev06b71e72017-11-08 17:11:07 +020055 fabric: test-fabric1
Damian Szelugaa8248102017-03-16 08:48:51 +010056 cidr: 2.2.3.0/24
57 gateway_ip: 2.2.3.2
azvyagintsev06b71e72017-11-08 17:11:07 +020058 iprange: # reserved range for DHCP\auto mapping
Damian Szelugaa8248102017-03-16 08:48:51 +010059 start: 2.2.3.20
60 end: 2.2.3.250
61 dhcp_snippets:
62 test-snippet:
63 value: option bootfile-name "tftp://192.168.0.10/snippet";
64 description: Test snippet
65 enabled: true
66 subnet: subnet1
Jiri Broulike30a60f2018-04-09 21:15:10 +020067 boot_sources:
68 maas_mirror:
69 url: http://images.maas.io/ephemeral-v3/daily/
70 keyring_file: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
71 local_mirror:
72 url: http://127.0.0.1/maas/images/ephemeral-v3/daily
73 keyring_file: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
Damian Szelugaa8248102017-03-16 08:48:51 +010074 boot_resources:
75 bootscript1:
76 title: bootscript
77 architecture: amd64/generic
78 filetype: tgz
79 content: /srv/salt/reclass/nodes/path_to_file
80 package_repositories:
81 Saltstack:
82 url: http://repo.saltstack.com/apt/ubuntu/14.04/amd64/2016.3/
83 distributions:
84 - trusty
85 components:
86 - main
Damian Szelugaa8248102017-03-16 08:48:51 +010087 arches: amd64
88 key: "-----BEGIN PGP PUBLIC KEY BLOCK-----
89 Version: GnuPG v2
Pavel Cizinsky5a6e2722016-08-31 15:58:13 +020090
Damian Szelugaa8248102017-03-16 08:48:51 +010091 mQENBFOpvpgBCADkP656H41i8fpplEEB8IeLhugyC2rTEwwSclb8tQNYtUiGdna9
azvyagintsev06b71e72017-11-08 17:11:07 +020092 ......
Damian Szelugaa8248102017-03-16 08:48:51 +010093 fuBmScum8uQTrEF5+Um5zkwC7EXTdH1co/+/V/fpOtxIg4XO4kcugZefVm5ERfVS
94 MA==
95 =dtMN
96 -----END PGP PUBLIC KEY BLOCK-----"
97 enabled: true
98 machines:
azvyagintsev06b71e72017-11-08 17:11:07 +020099 machine1_new_schema:
100 pxe_interface_mac: "11:22:33:44:55:66" # Node will be identified by those mac
101 interfaces:
102 nic01: # could be any, used for iterate only
103 type: eth # NotImplemented
104 name: eth0 # Override default nic name. Interface to rename will be identified by mac
105 mac: "11:22:33:44:55:66"
106 mode: "static"
107 ip: "2.2.3.19" # ip should be out of reserved subnet range, but still in subnet range
108 subnet: "subnet1"
109 gateway: "2.2.3.2" # override default gateway from subnet
110 nic02:
111 type: eth # Not-implemented
112 mac: "11:22:33:44:55:78"
113 subnet: "subnet2"
114 mode: "dhcp"
Damian Szelugaa8248102017-03-16 08:48:51 +0100115 power_parameters:
116 power_type: ipmi
117 power_address: '192.168.10.10'
118 power_user: bmc_user
119 power_password: bmc_password
Ondrej Smola455003c2017-06-01 22:53:39 +0200120 #Optional (for legacy HW)
121 power_driver: LAN
azvyagintsev06b71e72017-11-08 17:11:07 +0200122 distro_series: xenial
123 hwe_kernel: hwe-16.04
124 machine1_old_schema:
125 interface:
126 mac: "11:22:33:44:55:88" # Node will be identified by those mac
127 mode: "static"
128 ip: "2.2.3.15"
129 subnet: "subnet1"
130 gateway: "2.2.3.2"
131 power_parameters:
132 power_type: ipmi
133 power_address: '192.168.10.10'
134 power_user: bmc_user
135 power_password: bmc_password
136 #Optional (for legacy HW)
137 power_driver: LAN
138 # FIXME: that's should be moved into another,livirt example.
Petr Ruzicka5fe96742017-11-10 14:22:24 +0100139 # Used in case of power_type: virsh
140 power_id: my_libvirt_vm_name
Maciej Relewicz37b12a22017-04-25 15:23:16 +0200141 distro_series: xenial
142 hwe_kernel: hwe-16.04
Damian Szelugaa8248102017-03-16 08:48:51 +0100143 devices:
144 machine1-ipmi:
145 interface:
146 ip_address: 192.168.10.10
147 subnet: cidr:192.168.10.0/24
148 mac: '66:55:44:33:22:11'
Damian Szeluga336ff2e2017-03-30 11:19:34 +0200149 commissioning_scripts:
azvyagintsevec61dd62017-11-16 19:12:05 +0200150 00-maas-05-simplify-network-interfaces: /etc/maas/files/commisioning_scripts/00-maas-05-simplify-network-interfaces
Damian Szeluga336ff2e2017-03-30 11:19:34 +0200151 maas_config:
152 domain: mydomain.local
153 http_proxy: http://192.168.0.10:3142
154 commissioning_distro_series: xenial
155 default_distro_series: xenial
156 default_osystem: 'ubuntu'
157 default_storage_layout: lvm
158 disk_erase_with_secure_erase: true
159 dnssec_validation: 'no'
160 enable_third_party_drivers: true
161 maas_name: cfg01
162 network_discovery: 'enabled'
163 active_discovery_interval: '600'
164 ntp_external_only: true
165 ntp_servers: 10.10.11.23 10.10.11.24
166 upstream_dns: 192.168.12.13
167 enable_http_proxy: true
168 default_min_hwe_kernel: ''
169 sshprefs:
azvyagintsev06b71e72017-11-08 17:11:07 +0200170 - 'ssh-rsa ASD.........dfsadf blah@blah'
Ondrej Smola9af2b082016-08-25 17:37:29 +0200171
172
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100173Create disk schema per machine via maas/client.sls with default lvm schema + default values
174
175NOTE: This should be used mostly for custom root partitioning and RAID configuration. For not-root partitions please use salt-formulas/salt-formula-linux.
176
177.. code-block:: yaml
178
179 maas:
180 region:
181 machines:
182 server1:
183 disk_layout:
184 type: lvm
185 root_size: 20G
186 root_device: vda
187 volume_group: vg1
188 volume_name: root
189 volume_size: 8
190 bootable_device: vda
191
192FLAT layout with custom root size
193
194.. code-block:: yaml
195
196 maas:
197 region:
198 machines:
199 server2:
200 disk_layout:
201 type: flat
202 root_size: 20
203 physical_device: vda
204 bootable_device: vda
205
206Define more complex layout
207
208.. code-block:: yaml
209
210 maas:
211 region:
212 machines:
213 server3:
214 disk_layout:
215 type: flat #This is simplies setup
216 bootable_device: vda
217 disk:
218 vda:
219 type: physical
220 partition_schema:
221 part1:
222 size: 10G
223 type: ext4
224 mount: '/'
225 part2:
226 size: 2G
227 part3:
228 size: 3G
229 vdc:
230 type: physical
231 partition_schema:
232 part1:
233 size: 100%
234 vdd:
235 type: physical
236 partition_schema:
237 part1:
238 size: 100%
239 raid0:
240 type: raid
241 level: 10
242 devices:
243 - vde
244 - vdf
245 partition_schema:
246 part1:
247 size: 10G
248 part2:
249 size: 2G
250 part3:
251 size: 3G
252 raid1:
253 type: raid
254 level: 1
255 partitions:
256 - vdc-part1
257 - vdd-part1
258 volume_group2:
259 type: lvm
260 devices:
261 - raid1
262 volume:
263 tmp:
264 size: 5G
Ondrej Smola47b56752018-03-06 15:38:27 +0100265 type: ext4
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100266 mount: '/tmp'
267 log:
268 size: 7G
Ondrej Smola47b56752018-03-06 15:38:27 +0100269 type: ext4
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100270 mount: '/var/log'
azvyagintsev7605a662017-11-03 19:05:04 +0200271
Jiri Broulike30a60f2018-04-09 21:15:10 +0200272Setup image mirror
273
274.. code-block:: yaml
275
276 maas:
277 mirror:
278 enabled: true
279 image:
280 release:
281 xenial:
282 keyring: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
283 upstream: http://images.maas.io/ephemeral-v3/daily/
284 local_dir: /var/www/html/maas/images/ephemeral-v3/daily
285 arch: amd64
286 subarch: 'generic|hwe-t'
287 count: 1
288
Richard Felklce118a22017-09-13 11:09:12 +0200289Usage of local repos
290
291.. code-block:: yaml
azvyagintsev7605a662017-11-03 19:05:04 +0200292
Richard Felklce118a22017-09-13 11:09:12 +0200293 maas:
294 cluster:
295 enabled: true
296 region:
297 port: 80
298 host: localhost
299 saltstack_repo_key: |
300 -----BEGIN PGP PUBLIC KEY BLOCK-----
301 Version: GnuPG v2
302
303 mQENBFOpvpgBCADkP656H41i8fpplEEB8IeLhugyC2rTEwwSclb8tQNYtUiGdna9
azvyagintsev06b71e72017-11-08 17:11:07 +0200304 .....
Richard Felklce118a22017-09-13 11:09:12 +0200305 fuBmScum8uQTrEF5+Um5zkwC7EXTdH1co/+/V/fpOtxIg4XO4kcugZefVm5ERfVS
306 MA==
307 =dtMN
308 -----END PGP PUBLIC KEY BLOCK-----
309 saltstack_repo_xenial: "http://${_param:local_repo_url}/ubuntu-xenial stable salt"
310 saltstack_repo_trusty: "http://${_param:local_repo_url}/ubuntu-trusty stable salt"
311
Ondrej Smola9af2b082016-08-25 17:37:29 +0200312Single MAAS cluster service [multiple racks]
313
314.. code-block:: yaml
315
316 maas:
317 cluster:
318 enabled: true
Jakub Pavlikf43512b2016-08-30 10:25:42 +0200319 role: master/slave
Ondrej Smola9af2b082016-08-25 17:37:29 +0200320
azvyagintsev7605a662017-11-03 19:05:04 +0200321.. code-block:: yaml
322
323 maas:
324 cluster:
325 enabled: true
326 role: master/slave
327
Martin Polreich0764b762017-11-20 14:08:30 +0100328MAAS region service with backup data
329
330.. code-block:: yaml
331 maas:
332 region:
333 database:
334 initial_data:
335 source: cfg01.local
336 host: 192.168.0.11
337
azvyagintsev7605a662017-11-03 19:05:04 +0200338Module function's example:
339==========================
340
341* Wait for status of selected machine's:
342
343.. code-block:: bash
344
345 > cat maas/machines/wait_for_machines_ready.sls
346
347 ...
348
349 wait_for_machines_ready:
350 module.run:
351 - name: maas.wait_for_machine_status
352 - kwargs:
353 machines:
354 - kvm01
355 - kvm02
356 timeout: 1200 # in seconds
357 req_status: "Ready"
358 - require:
359 - cmd: maas_login_admin
360 ...
361
362If module run w/\o any extra paremeters - `wait_for_machines_ready` will wait for defined in salt machines. In those case, will be usefull to skip some machines:
363
364.. code-block:: bash
365
366 > cat maas/machines/wait_for_machines_deployed.sls
367
368 ...
369
370 wait_for_machines_ready:
371 module.run:
372 - name: maas.wait_for_machine_status
373 - kwargs:
374 timeout: 1200 # in seconds
Michael Polenchuke438bd32017-11-09 20:42:42 +0400375 req_status: "Deployed"
azvyagintsev7605a662017-11-03 19:05:04 +0200376 ignore_machines:
377 - kvm01 # in case it's broken or whatever
378 - require:
379 - cmd: maas_login_admin
380 ...
381
azvyagintsev06b71e72017-11-08 17:11:07 +0200382List of available `req_status` defined in global variable:
383
384.. code-block:: python
385
386 STATUS_NAME_DICT = dict([
387 (0, 'New'), (1, 'Commissioning'), (2, 'Failed commissioning'),
388 (3, 'Missing'), (4, 'Ready'), (5, 'Reserved'), (10, 'Allocated'),
389 (9, 'Deploying'), (6, 'Deployed'), (7, 'Retired'), (8, 'Broken'),
390 (11, 'Failed deployment'), (12, 'Releasing'),
391 (13, 'Releasing failed'), (14, 'Disk erasing'),
392 (15, 'Failed disk erasing')])
azvyagintsev7605a662017-11-03 19:05:04 +0200393
394
Ales Komarekef982692016-02-21 14:56:07 +0100395Read more
396=========
397
Roald Nefsc86d84a2017-10-12 21:19:50 +0200398* https://maas.io/
Filip Pytlounc07d2352017-02-02 13:02:03 +0100399
400Documentation and Bugs
401======================
402
403To learn how to install and update salt-formulas, consult the documentation
404available online at:
405
406 http://salt-formulas.readthedocs.io/
407
408In the unfortunate event that bugs are discovered, they should be reported to
409the appropriate issue tracker. Use Github issue tracker for specific salt
410formula:
411
412 https://github.com/salt-formulas/salt-formula-maas/issues
413
414For feature requests, bug reports or blueprints affecting entire ecosystem,
415use Launchpad salt-formulas project:
416
417 https://launchpad.net/salt-formulas
418
419You can also join salt-formulas-users team and subscribe to mailing list:
420
421 https://launchpad.net/~salt-formulas-users
422
423Developers wishing to work on the salt-formulas projects should always base
424their work on master branch and submit pull request against specific formula.
425
426 https://github.com/salt-formulas/salt-formula-maas
427
428Any questions or feedback is always welcome so feel free to join our IRC
429channel:
430
Martin Polreich0764b762017-11-20 14:08:30 +0100431 #salt-formulas @ irc.freenode.net