blob: 2f85ea0277f6eb1dafcd536a04d05998f315bf76 [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
azvyagintsev3ff2ef12018-06-01 21:30:45 +030067 boot_sources_delete_all_others: true
Jiri Broulike30a60f2018-04-09 21:15:10 +020068 boot_sources:
azvyagintsev3ff2ef12018-06-01 21:30:45 +030069 resources_mirror:
70 url: http://images.maas.io/ephemeral-v3/
Jiri Broulike30a60f2018-04-09 21:15:10 +020071 keyring_file: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
azvyagintsev3ff2ef12018-06-01 21:30:45 +030072 boot_sources_selections:
73 xenial:
74 url: "http://images.maas.io/ephemeral-v3/" # should be same in boot_sources, or other already defined.
75 os: "ubuntu"
76 release: "xenial"
77 arches: "amd64"
78 subarches: '"*"'
79 labels: '"*"'
Damian Szelugaa8248102017-03-16 08:48:51 +010080 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
Pavel Cizinsky0995e8f2018-05-04 17:10:37 +0200172Update Vlan
173
174NOTE: Vid 0 has default name untagged in MaaS UI
175
176.. code-block:: yaml
177
178 maas:
179 region:
180 fabrics:
181 test-fabric:
182 description: "Test fabric"
183 vlan:
184 0:
185 description: "Your VLAN 0"
186 dhcp: True
187 13:
188 description: "Your VLAN 13"
189 dhcp: False
Ondrej Smola9af2b082016-08-25 17:37:29 +0200190
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100191Create disk schema per machine via maas/client.sls with default lvm schema + default values
192
193NOTE: This should be used mostly for custom root partitioning and RAID configuration. For not-root partitions please use salt-formulas/salt-formula-linux.
194
195.. code-block:: yaml
196
197 maas:
198 region:
199 machines:
200 server1:
201 disk_layout:
202 type: lvm
203 root_size: 20G
204 root_device: vda
205 volume_group: vg1
206 volume_name: root
207 volume_size: 8
208 bootable_device: vda
209
210FLAT layout with custom root size
211
212.. code-block:: yaml
213
214 maas:
215 region:
216 machines:
217 server2:
218 disk_layout:
219 type: flat
220 root_size: 20
221 physical_device: vda
222 bootable_device: vda
223
Petr Michalec16cc5c92018-05-17 09:56:35 +0200224Size specification with `%` char used is not yet supported
225
226
227.. code-block:: yaml
azvyagintsev80f9da72018-06-01 18:01:45 +0300228
Petr Michalec16cc5c92018-05-17 09:56:35 +0200229 maas:
230 region:
231 machines:
232 server3:
233 disk_layout:
234 type: flat
235 bootable_device: sda
236 disk:
237 sda:
238 type: physical
239 partition_schema:
240 part1:
241 size: 100%
242 type: ext4
243 mount: '/'
244
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100245Define more complex layout
246
247.. code-block:: yaml
248
249 maas:
250 region:
251 machines:
252 server3:
253 disk_layout:
azvyagintsevbca1f462018-05-25 19:06:46 +0300254 type: custom
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100255 bootable_device: vda
256 disk:
257 vda:
258 type: physical
259 partition_schema:
260 part1:
261 size: 10G
262 type: ext4
263 mount: '/'
264 part2:
265 size: 2G
266 part3:
267 size: 3G
268 vdc:
269 type: physical
270 partition_schema:
271 part1:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200272 size: 100G
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100273 vdd:
274 type: physical
275 partition_schema:
276 part1:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200277 size: 100G
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100278 raid0:
279 type: raid
280 level: 10
281 devices:
282 - vde
283 - vdf
284 partition_schema:
285 part1:
286 size: 10G
287 part2:
288 size: 2G
289 part3:
290 size: 3G
291 raid1:
292 type: raid
293 level: 1
294 partitions:
295 - vdc-part1
296 - vdd-part1
297 volume_group2:
298 type: lvm
299 devices:
300 - raid1
301 volume:
302 tmp:
303 size: 5G
Ondrej Smola47b56752018-03-06 15:38:27 +0100304 type: ext4
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100305 mount: '/tmp'
306 log:
307 size: 7G
Ondrej Smola47b56752018-03-06 15:38:27 +0100308 type: ext4
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100309 mount: '/var/log'
azvyagintsev7605a662017-11-03 19:05:04 +0200310
Petr Michalec16cc5c92018-05-17 09:56:35 +0200311Raid setup, 4x HDD
312
313.. code-block:: yaml
314
315 maas:
316 region:
317 machines:
318 serverWithRaidExample:
319 disk_layout:
azvyagintsevbca1f462018-05-25 19:06:46 +0300320 type: custom
321 bootable_device: sda
Petr Michalec16cc5c92018-05-17 09:56:35 +0200322 disk:
323 md0:
324 type: raid
325 level: 1
326 devices:
327 - sda
328 - sdb
329 partition_schema:
330 part1:
331 size: 230G
332 type: ext4
333 mount: /
334 md1:
335 type: raid
336 level: 1
337 devices:
338 - sdc
339 - sdd
340 partition_schema:
341 part1:
342 size: 1890G
343 type: ext4
344 mount: /var/lib/libvirt
345
346Raid + LVM setup, 2xSSD + 2xHDD
347
348
349Note: This setup lacks the ability run state twice, as of now when "disk_partition_present" is called, it tries blindly to
350delete the partition and then recreated. That fails as maas rejects remove partition used in RAID/LVM.
351
352
353.. code-block:: yaml
354
355 maas:
356 region:
357 machines:
358 serverWithRaidExample2:
359 disk_layout:
azvyagintsevbca1f462018-05-25 19:06:46 +0300360 type: custom
Petr Michalec16cc5c92018-05-17 09:56:35 +0200361 #bootable_device: vgssd-root
362 disk:
363 sda: &maas_disk_physical_ssd
364 type: physical
365 partition_schema:
366 part1:
367 size: 239G
368 sdb: *maas_disk_physical_ssd
369 sdc: &maas_disk_physical_hdd
370 type: physical
371 partition_schema:
372 part1:
373 size: 1990G
374 sdd: *maas_disk_physical_hdd
375 md0:
376 type: raid
377 level: 1
378 partitions:
379 - sda-part1
380 - sdb-part1
381 md1:
382 type: raid
383 level: 1
384 partitions:
385 - sdc-part1
386 - sdd-part1
387 vgssd:
388 type: lvm
389 devices:
390 - md0
391 volume:
392 root:
393 size: 230G
394 type: ext4
395 mount: '/'
396 vghdd:
397 type: lvm
398 devices:
399 - md1
400 volume:
401 libvirt:
402 size: 1800G
403 type: ext4
404 mount: '/var/lib/libvirt'
405
406
407
408
azvyagintsev80f9da72018-06-01 18:01:45 +0300409Setup image mirror (Maas boot resources,)
Jiri Broulike30a60f2018-04-09 21:15:10 +0200410
411.. code-block:: yaml
412
413 maas:
414 mirror:
415 enabled: true
416 image:
azvyagintsev80f9da72018-06-01 18:01:45 +0300417 sections:
418 bootloaders:
419 keyring: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
420 upstream: http://images.maas.io/ephemeral-v3/daily/
421 local_dir: /var/www/html/maas/images/ephemeral-v3/daily
422 count: 1
423 # i386 need for pxe
424 filters: ['arch~(i386|amd64)', 'os~(grub*|pxelinux)']
Jiri Broulike30a60f2018-04-09 21:15:10 +0200425 xenial:
azvyagintsev80f9da72018-06-01 18:01:45 +0300426 keyring: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
427 upstream: http://images.maas.io/ephemeral-v3/daily/
428 local_dir: /var/www/html/maas/images/ephemeral-v3/daily
429 count: 1
430 filters: ['release~(xenial)', 'arch~(amd64)', 'subarch~(generic|hwe-16.04$|ga-16.04)']
Jiri Broulike30a60f2018-04-09 21:15:10 +0200431 count: 1
432
azvyagintsev80f9da72018-06-01 18:01:45 +0300433Usage of local deb repos
Richard Felklce118a22017-09-13 11:09:12 +0200434
435.. code-block:: yaml
azvyagintsev7605a662017-11-03 19:05:04 +0200436
Richard Felklce118a22017-09-13 11:09:12 +0200437 maas:
438 cluster:
439 enabled: true
440 region:
441 port: 80
442 host: localhost
443 saltstack_repo_key: |
444 -----BEGIN PGP PUBLIC KEY BLOCK-----
445 Version: GnuPG v2
446
447 mQENBFOpvpgBCADkP656H41i8fpplEEB8IeLhugyC2rTEwwSclb8tQNYtUiGdna9
azvyagintsev06b71e72017-11-08 17:11:07 +0200448 .....
Richard Felklce118a22017-09-13 11:09:12 +0200449 fuBmScum8uQTrEF5+Um5zkwC7EXTdH1co/+/V/fpOtxIg4XO4kcugZefVm5ERfVS
450 MA==
451 =dtMN
452 -----END PGP PUBLIC KEY BLOCK-----
453 saltstack_repo_xenial: "http://${_param:local_repo_url}/ubuntu-xenial stable salt"
454 saltstack_repo_trusty: "http://${_param:local_repo_url}/ubuntu-trusty stable salt"
455
Ondrej Smola9af2b082016-08-25 17:37:29 +0200456Single MAAS cluster service [multiple racks]
457
458.. code-block:: yaml
459
460 maas:
461 cluster:
462 enabled: true
Jakub Pavlikf43512b2016-08-30 10:25:42 +0200463 role: master/slave
Ondrej Smola9af2b082016-08-25 17:37:29 +0200464
azvyagintsev7605a662017-11-03 19:05:04 +0200465.. code-block:: yaml
466
467 maas:
468 cluster:
469 enabled: true
470 role: master/slave
471
Martin Polreich0764b762017-11-20 14:08:30 +0100472MAAS region service with backup data
473
474.. code-block:: yaml
azvyagintsev80f9da72018-06-01 18:01:45 +0300475
Martin Polreich0764b762017-11-20 14:08:30 +0100476 maas:
477 region:
478 database:
479 initial_data:
480 source: cfg01.local
481 host: 192.168.0.11
482
Petr Michalec8a0d52e2018-05-30 16:22:56 +0200483Test pillars
484==============
485
486Mind the postgresql and rsyslog `.sls`. Database and syslog service are required for MAAS to properly install and work.
487
488* https://github.com/salt-formulas/salt-formula-rsyslog/tree/master/tests/pillar
489
490
azvyagintsev7605a662017-11-03 19:05:04 +0200491Module function's example:
492==========================
493
494* Wait for status of selected machine's:
495
496.. code-block:: bash
497
498 > cat maas/machines/wait_for_machines_ready.sls
499
500 ...
501
502 wait_for_machines_ready:
503 module.run:
504 - name: maas.wait_for_machine_status
505 - kwargs:
506 machines:
507 - kvm01
508 - kvm02
509 timeout: 1200 # in seconds
510 req_status: "Ready"
511 - require:
512 - cmd: maas_login_admin
513 ...
514
515If 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:
516
517.. code-block:: bash
518
519 > cat maas/machines/wait_for_machines_deployed.sls
520
521 ...
522
523 wait_for_machines_ready:
524 module.run:
525 - name: maas.wait_for_machine_status
526 - kwargs:
527 timeout: 1200 # in seconds
Michael Polenchuke438bd32017-11-09 20:42:42 +0400528 req_status: "Deployed"
azvyagintsev7605a662017-11-03 19:05:04 +0200529 ignore_machines:
530 - kvm01 # in case it's broken or whatever
531 - require:
532 - cmd: maas_login_admin
533 ...
534
azvyagintsev06b71e72017-11-08 17:11:07 +0200535List of available `req_status` defined in global variable:
536
537.. code-block:: python
538
539 STATUS_NAME_DICT = dict([
540 (0, 'New'), (1, 'Commissioning'), (2, 'Failed commissioning'),
541 (3, 'Missing'), (4, 'Ready'), (5, 'Reserved'), (10, 'Allocated'),
542 (9, 'Deploying'), (6, 'Deployed'), (7, 'Retired'), (8, 'Broken'),
543 (11, 'Failed deployment'), (12, 'Releasing'),
544 (13, 'Releasing failed'), (14, 'Disk erasing'),
545 (15, 'Failed disk erasing')])
azvyagintsev7605a662017-11-03 19:05:04 +0200546
547
Ales Komarekef982692016-02-21 14:56:07 +0100548Read more
549=========
550
Roald Nefsc86d84a2017-10-12 21:19:50 +0200551* https://maas.io/
Filip Pytlounc07d2352017-02-02 13:02:03 +0100552
553Documentation and Bugs
554======================
555
556To learn how to install and update salt-formulas, consult the documentation
557available online at:
558
559 http://salt-formulas.readthedocs.io/
560
561In the unfortunate event that bugs are discovered, they should be reported to
562the appropriate issue tracker. Use Github issue tracker for specific salt
563formula:
564
565 https://github.com/salt-formulas/salt-formula-maas/issues
566
567For feature requests, bug reports or blueprints affecting entire ecosystem,
568use Launchpad salt-formulas project:
569
570 https://launchpad.net/salt-formulas
571
572You can also join salt-formulas-users team and subscribe to mailing list:
573
574 https://launchpad.net/~salt-formulas-users
575
576Developers wishing to work on the salt-formulas projects should always base
577their work on master branch and submit pull request against specific formula.
578
579 https://github.com/salt-formulas/salt-formula-maas
580
581Any questions or feedback is always welcome so feel free to join our IRC
582channel:
583
Pavel Cizinsky0995e8f2018-05-04 17:10:37 +0200584 #salt-formulas @ irc.freenode.net