blob: 4cc62bdce0537e6df62532482af8d894a6492b05 [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:
azvyagintsevf3515c82018-06-26 18:59:05 +030049 fabric1:
50 name: 'tf2'
azvyagintsev06b71e72017-11-08 17:11:07 +020051 description: "Test fabric"
azvyagintsevf3515c82018-06-26 18:59:05 +030052 fabric2:
53 name: 'tf2'
azvyagintsev06b71e72017-11-08 17:11:07 +020054 description: "Test fabric2"
azvyagintsevf3515c82018-06-26 18:59:05 +030055 deploy_network:
56 name: 'deploy_network'
57 description: Fabric for deploy_network
58 vlans:
59 0:
60 name: 'vlan 0'
61 description: Deploy VLAN
62 dhcp: true
azvyagintsev6913e5e2018-07-05 11:42:53 +030063 # FIXME: after refactoring domain module, it should be
64 # fixed exactly for FQDN, not only 'hostname'
azvyagintsevf3515c82018-06-26 18:59:05 +030065 primary_rack: "${linux:network:hostname}"
66
Damian Szelugaa8248102017-03-16 08:48:51 +010067 subnets:
68 subnet1:
azvyagintsevf3515c82018-06-26 18:59:05 +030069 fabric: ${maas:region:fabrics:deploy_network:name}
Damian Szelugaa8248102017-03-16 08:48:51 +010070 cidr: 2.2.3.0/24
71 gateway_ip: 2.2.3.2
azvyagintsevf3515c82018-06-26 18:59:05 +030072 vlan: 150
73 ipranges:
74 1:
75 end: "2.2.3.40"
76 start: "2.2.3.20"
77 type: dynamic
78 2:
79 end: "2.2.3.250"
80 start: "2.2.3.45"
81 type: static
Damian Szelugaa8248102017-03-16 08:48:51 +010082 dhcp_snippets:
83 test-snippet:
84 value: option bootfile-name "tftp://192.168.0.10/snippet";
85 description: Test snippet
86 enabled: true
87 subnet: subnet1
azvyagintsev3ff2ef12018-06-01 21:30:45 +030088 boot_sources_delete_all_others: true
Jiri Broulike30a60f2018-04-09 21:15:10 +020089 boot_sources:
azvyagintsev3ff2ef12018-06-01 21:30:45 +030090 resources_mirror:
91 url: http://images.maas.io/ephemeral-v3/
Jiri Broulike30a60f2018-04-09 21:15:10 +020092 keyring_file: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
azvyagintsev3ff2ef12018-06-01 21:30:45 +030093 boot_sources_selections:
94 xenial:
95 url: "http://images.maas.io/ephemeral-v3/" # should be same in boot_sources, or other already defined.
96 os: "ubuntu"
97 release: "xenial"
98 arches: "amd64"
99 subarches: '"*"'
100 labels: '"*"'
Damian Szelugaa8248102017-03-16 08:48:51 +0100101 package_repositories:
102 Saltstack:
103 url: http://repo.saltstack.com/apt/ubuntu/14.04/amd64/2016.3/
104 distributions:
105 - trusty
106 components:
107 - main
Damian Szelugaa8248102017-03-16 08:48:51 +0100108 arches: amd64
109 key: "-----BEGIN PGP PUBLIC KEY BLOCK-----
110 Version: GnuPG v2
Pavel Cizinsky5a6e2722016-08-31 15:58:13 +0200111
Damian Szelugaa8248102017-03-16 08:48:51 +0100112 mQENBFOpvpgBCADkP656H41i8fpplEEB8IeLhugyC2rTEwwSclb8tQNYtUiGdna9
azvyagintsev06b71e72017-11-08 17:11:07 +0200113 ......
Damian Szelugaa8248102017-03-16 08:48:51 +0100114 fuBmScum8uQTrEF5+Um5zkwC7EXTdH1co/+/V/fpOtxIg4XO4kcugZefVm5ERfVS
115 MA==
116 =dtMN
117 -----END PGP PUBLIC KEY BLOCK-----"
118 enabled: true
119 machines:
azvyagintsev06b71e72017-11-08 17:11:07 +0200120 machine1_new_schema:
121 pxe_interface_mac: "11:22:33:44:55:66" # Node will be identified by those mac
122 interfaces:
123 nic01: # could be any, used for iterate only
124 type: eth # NotImplemented
125 name: eth0 # Override default nic name. Interface to rename will be identified by mac
126 mac: "11:22:33:44:55:66"
127 mode: "static"
128 ip: "2.2.3.19" # ip should be out of reserved subnet range, but still in subnet range
129 subnet: "subnet1"
130 gateway: "2.2.3.2" # override default gateway from subnet
131 nic02:
132 type: eth # Not-implemented
133 mac: "11:22:33:44:55:78"
134 subnet: "subnet2"
135 mode: "dhcp"
Damian Szelugaa8248102017-03-16 08:48:51 +0100136 power_parameters:
137 power_type: ipmi
138 power_address: '192.168.10.10'
139 power_user: bmc_user
140 power_password: bmc_password
Ondrej Smola455003c2017-06-01 22:53:39 +0200141 #Optional (for legacy HW)
142 power_driver: LAN
azvyagintsev06b71e72017-11-08 17:11:07 +0200143 distro_series: xenial
144 hwe_kernel: hwe-16.04
145 machine1_old_schema:
146 interface:
147 mac: "11:22:33:44:55:88" # Node will be identified by those mac
148 mode: "static"
149 ip: "2.2.3.15"
150 subnet: "subnet1"
151 gateway: "2.2.3.2"
152 power_parameters:
153 power_type: ipmi
154 power_address: '192.168.10.10'
155 power_user: bmc_user
156 power_password: bmc_password
157 #Optional (for legacy HW)
158 power_driver: LAN
159 # FIXME: that's should be moved into another,livirt example.
Petr Ruzicka5fe96742017-11-10 14:22:24 +0100160 # Used in case of power_type: virsh
161 power_id: my_libvirt_vm_name
Maciej Relewicz37b12a22017-04-25 15:23:16 +0200162 distro_series: xenial
163 hwe_kernel: hwe-16.04
Damian Szelugaa8248102017-03-16 08:48:51 +0100164 devices:
165 machine1-ipmi:
166 interface:
167 ip_address: 192.168.10.10
168 subnet: cidr:192.168.10.0/24
169 mac: '66:55:44:33:22:11'
Damian Szeluga336ff2e2017-03-30 11:19:34 +0200170 commissioning_scripts:
azvyagintsevec61dd62017-11-16 19:12:05 +0200171 00-maas-05-simplify-network-interfaces: /etc/maas/files/commisioning_scripts/00-maas-05-simplify-network-interfaces
Damian Szeluga336ff2e2017-03-30 11:19:34 +0200172 maas_config:
azvyagintsev6913e5e2018-07-05 11:42:53 +0300173 # domain: mydomain.local # This function broken
Damian Szeluga336ff2e2017-03-30 11:19:34 +0200174 http_proxy: http://192.168.0.10:3142
175 commissioning_distro_series: xenial
176 default_distro_series: xenial
177 default_osystem: 'ubuntu'
178 default_storage_layout: lvm
179 disk_erase_with_secure_erase: true
180 dnssec_validation: 'no'
181 enable_third_party_drivers: true
182 maas_name: cfg01
183 network_discovery: 'enabled'
184 active_discovery_interval: '600'
185 ntp_external_only: true
186 ntp_servers: 10.10.11.23 10.10.11.24
187 upstream_dns: 192.168.12.13
188 enable_http_proxy: true
189 default_min_hwe_kernel: ''
190 sshprefs:
azvyagintsev06b71e72017-11-08 17:11:07 +0200191 - 'ssh-rsa ASD.........dfsadf blah@blah'
Ondrej Smola9af2b082016-08-25 17:37:29 +0200192
Pavel Cizinsky8dd85b52018-06-18 21:40:13 +0200193
Pavel Cizinsky0995e8f2018-05-04 17:10:37 +0200194Update Vlan
195
196NOTE: Vid 0 has default name untagged in MaaS UI
197
198.. code-block:: yaml
199
200 maas:
201 region:
202 fabrics:
203 test-fabric:
204 description: "Test fabric"
205 vlan:
206 0:
207 description: "Your VLAN 0"
208 dhcp: True
209 13:
210 description: "Your VLAN 13"
211 dhcp: False
Ondrej Smola9af2b082016-08-25 17:37:29 +0200212
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100213Create disk schema per machine via maas/client.sls with default lvm schema + default values
214
215NOTE: This should be used mostly for custom root partitioning and RAID configuration. For not-root partitions please use salt-formulas/salt-formula-linux.
216
217.. code-block:: yaml
218
219 maas:
220 region:
221 machines:
222 server1:
223 disk_layout:
224 type: lvm
225 root_size: 20G
226 root_device: vda
227 volume_group: vg1
228 volume_name: root
229 volume_size: 8
230 bootable_device: vda
231
232FLAT layout with custom root size
233
234.. code-block:: yaml
235
236 maas:
237 region:
238 machines:
239 server2:
240 disk_layout:
241 type: flat
242 root_size: 20
243 physical_device: vda
244 bootable_device: vda
245
Petr Michalec16cc5c92018-05-17 09:56:35 +0200246Size specification with `%` char used is not yet supported
247
248
249.. code-block:: yaml
azvyagintsev80f9da72018-06-01 18:01:45 +0300250
Petr Michalec16cc5c92018-05-17 09:56:35 +0200251 maas:
252 region:
253 machines:
254 server3:
255 disk_layout:
256 type: flat
257 bootable_device: sda
258 disk:
259 sda:
260 type: physical
261 partition_schema:
262 part1:
263 size: 100%
264 type: ext4
265 mount: '/'
266
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100267Define more complex layout
268
269.. code-block:: yaml
270
271 maas:
272 region:
273 machines:
274 server3:
275 disk_layout:
azvyagintsevbca1f462018-05-25 19:06:46 +0300276 type: custom
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100277 bootable_device: vda
278 disk:
279 vda:
280 type: physical
281 partition_schema:
282 part1:
283 size: 10G
284 type: ext4
285 mount: '/'
286 part2:
287 size: 2G
288 part3:
289 size: 3G
290 vdc:
291 type: physical
292 partition_schema:
293 part1:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200294 size: 100G
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100295 vdd:
296 type: physical
297 partition_schema:
298 part1:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200299 size: 100G
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100300 raid0:
301 type: raid
302 level: 10
303 devices:
304 - vde
305 - vdf
306 partition_schema:
307 part1:
308 size: 10G
309 part2:
310 size: 2G
311 part3:
312 size: 3G
313 raid1:
314 type: raid
315 level: 1
316 partitions:
317 - vdc-part1
318 - vdd-part1
319 volume_group2:
320 type: lvm
321 devices:
322 - raid1
323 volume:
324 tmp:
325 size: 5G
Ondrej Smola47b56752018-03-06 15:38:27 +0100326 type: ext4
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100327 mount: '/tmp'
328 log:
329 size: 7G
Ondrej Smola47b56752018-03-06 15:38:27 +0100330 type: ext4
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100331 mount: '/var/log'
azvyagintsev7605a662017-11-03 19:05:04 +0200332
Petr Michalec16cc5c92018-05-17 09:56:35 +0200333Raid setup, 4x HDD
334
335.. code-block:: yaml
336
337 maas:
338 region:
339 machines:
340 serverWithRaidExample:
341 disk_layout:
azvyagintsevbca1f462018-05-25 19:06:46 +0300342 type: custom
343 bootable_device: sda
Petr Michalec16cc5c92018-05-17 09:56:35 +0200344 disk:
345 md0:
346 type: raid
347 level: 1
348 devices:
349 - sda
350 - sdb
351 partition_schema:
352 part1:
353 size: 230G
354 type: ext4
355 mount: /
356 md1:
357 type: raid
358 level: 1
359 devices:
360 - sdc
361 - sdd
362 partition_schema:
363 part1:
364 size: 1890G
365 type: ext4
366 mount: /var/lib/libvirt
367
368Raid + LVM setup, 2xSSD + 2xHDD
369
370
371Note: This setup lacks the ability run state twice, as of now when "disk_partition_present" is called, it tries blindly to
372delete the partition and then recreated. That fails as maas rejects remove partition used in RAID/LVM.
373
374
375.. code-block:: yaml
376
377 maas:
378 region:
379 machines:
380 serverWithRaidExample2:
381 disk_layout:
azvyagintsevbca1f462018-05-25 19:06:46 +0300382 type: custom
Petr Michalec16cc5c92018-05-17 09:56:35 +0200383 #bootable_device: vgssd-root
384 disk:
385 sda: &maas_disk_physical_ssd
386 type: physical
387 partition_schema:
388 part1:
389 size: 239G
390 sdb: *maas_disk_physical_ssd
391 sdc: &maas_disk_physical_hdd
392 type: physical
393 partition_schema:
394 part1:
395 size: 1990G
396 sdd: *maas_disk_physical_hdd
397 md0:
398 type: raid
399 level: 1
400 partitions:
401 - sda-part1
402 - sdb-part1
403 md1:
404 type: raid
405 level: 1
406 partitions:
407 - sdc-part1
408 - sdd-part1
409 vgssd:
410 type: lvm
411 devices:
412 - md0
413 volume:
414 root:
415 size: 230G
416 type: ext4
417 mount: '/'
418 vghdd:
419 type: lvm
420 devices:
421 - md1
422 volume:
423 libvirt:
424 size: 1800G
425 type: ext4
426 mount: '/var/lib/libvirt'
427
428
429
430
azvyagintsev80f9da72018-06-01 18:01:45 +0300431Setup image mirror (Maas boot resources,)
Jiri Broulike30a60f2018-04-09 21:15:10 +0200432
433.. code-block:: yaml
434
435 maas:
436 mirror:
437 enabled: true
438 image:
azvyagintsev80f9da72018-06-01 18:01:45 +0300439 sections:
440 bootloaders:
441 keyring: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
442 upstream: http://images.maas.io/ephemeral-v3/daily/
443 local_dir: /var/www/html/maas/images/ephemeral-v3/daily
444 count: 1
445 # i386 need for pxe
446 filters: ['arch~(i386|amd64)', 'os~(grub*|pxelinux)']
Jiri Broulike30a60f2018-04-09 21:15:10 +0200447 xenial:
azvyagintsev80f9da72018-06-01 18:01:45 +0300448 keyring: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
449 upstream: http://images.maas.io/ephemeral-v3/daily/
450 local_dir: /var/www/html/maas/images/ephemeral-v3/daily
451 count: 1
452 filters: ['release~(xenial)', 'arch~(amd64)', 'subarch~(generic|hwe-16.04$|ga-16.04)']
Jiri Broulike30a60f2018-04-09 21:15:10 +0200453 count: 1
454
azvyagintsev80f9da72018-06-01 18:01:45 +0300455Usage of local deb repos
Richard Felklce118a22017-09-13 11:09:12 +0200456
457.. code-block:: yaml
azvyagintsev7605a662017-11-03 19:05:04 +0200458
Richard Felklce118a22017-09-13 11:09:12 +0200459 maas:
460 cluster:
461 enabled: true
462 region:
463 port: 80
464 host: localhost
465 saltstack_repo_key: |
466 -----BEGIN PGP PUBLIC KEY BLOCK-----
467 Version: GnuPG v2
468
469 mQENBFOpvpgBCADkP656H41i8fpplEEB8IeLhugyC2rTEwwSclb8tQNYtUiGdna9
azvyagintsev06b71e72017-11-08 17:11:07 +0200470 .....
Richard Felklce118a22017-09-13 11:09:12 +0200471 fuBmScum8uQTrEF5+Um5zkwC7EXTdH1co/+/V/fpOtxIg4XO4kcugZefVm5ERfVS
472 MA==
473 =dtMN
474 -----END PGP PUBLIC KEY BLOCK-----
475 saltstack_repo_xenial: "http://${_param:local_repo_url}/ubuntu-xenial stable salt"
476 saltstack_repo_trusty: "http://${_param:local_repo_url}/ubuntu-trusty stable salt"
477
Ondrej Smola9af2b082016-08-25 17:37:29 +0200478Single MAAS cluster service [multiple racks]
479
480.. code-block:: yaml
481
482 maas:
483 cluster:
484 enabled: true
Jakub Pavlikf43512b2016-08-30 10:25:42 +0200485 role: master/slave
Ondrej Smola9af2b082016-08-25 17:37:29 +0200486
azvyagintsev7605a662017-11-03 19:05:04 +0200487.. code-block:: yaml
488
489 maas:
490 cluster:
491 enabled: true
492 role: master/slave
493
Martin Polreich0764b762017-11-20 14:08:30 +0100494MAAS region service with backup data
495
496.. code-block:: yaml
azvyagintsev80f9da72018-06-01 18:01:45 +0300497
Martin Polreich0764b762017-11-20 14:08:30 +0100498 maas:
499 region:
500 database:
501 initial_data:
502 source: cfg01.local
503 host: 192.168.0.11
504
Petr Michalec8a0d52e2018-05-30 16:22:56 +0200505Test pillars
506==============
507
508Mind the postgresql and rsyslog `.sls`. Database and syslog service are required for MAAS to properly install and work.
509
510* https://github.com/salt-formulas/salt-formula-rsyslog/tree/master/tests/pillar
511
512
azvyagintsev7605a662017-11-03 19:05:04 +0200513Module function's example:
514==========================
515
516* Wait for status of selected machine's:
517
518.. code-block:: bash
519
520 > cat maas/machines/wait_for_machines_ready.sls
521
522 ...
523
524 wait_for_machines_ready:
525 module.run:
526 - name: maas.wait_for_machine_status
527 - kwargs:
528 machines:
529 - kvm01
530 - kvm02
531 timeout: 1200 # in seconds
532 req_status: "Ready"
533 - require:
534 - cmd: maas_login_admin
535 ...
536
537If 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:
538
539.. code-block:: bash
540
541 > cat maas/machines/wait_for_machines_deployed.sls
542
543 ...
544
545 wait_for_machines_ready:
546 module.run:
547 - name: maas.wait_for_machine_status
548 - kwargs:
549 timeout: 1200 # in seconds
Michael Polenchuke438bd32017-11-09 20:42:42 +0400550 req_status: "Deployed"
azvyagintsev7605a662017-11-03 19:05:04 +0200551 ignore_machines:
552 - kvm01 # in case it's broken or whatever
553 - require:
554 - cmd: maas_login_admin
555 ...
556
azvyagintsev06b71e72017-11-08 17:11:07 +0200557List of available `req_status` defined in global variable:
558
559.. code-block:: python
560
561 STATUS_NAME_DICT = dict([
562 (0, 'New'), (1, 'Commissioning'), (2, 'Failed commissioning'),
563 (3, 'Missing'), (4, 'Ready'), (5, 'Reserved'), (10, 'Allocated'),
564 (9, 'Deploying'), (6, 'Deployed'), (7, 'Retired'), (8, 'Broken'),
565 (11, 'Failed deployment'), (12, 'Releasing'),
566 (13, 'Releasing failed'), (14, 'Disk erasing'),
567 (15, 'Failed disk erasing')])
azvyagintsev7605a662017-11-03 19:05:04 +0200568
569
Ales Komarekef982692016-02-21 14:56:07 +0100570Read more
571=========
572
Roald Nefsc86d84a2017-10-12 21:19:50 +0200573* https://maas.io/
Filip Pytlounc07d2352017-02-02 13:02:03 +0100574
575Documentation and Bugs
576======================
577
578To learn how to install and update salt-formulas, consult the documentation
579available online at:
580
581 http://salt-formulas.readthedocs.io/
582
583In the unfortunate event that bugs are discovered, they should be reported to
584the appropriate issue tracker. Use Github issue tracker for specific salt
585formula:
586
587 https://github.com/salt-formulas/salt-formula-maas/issues
588
589For feature requests, bug reports or blueprints affecting entire ecosystem,
590use Launchpad salt-formulas project:
591
592 https://launchpad.net/salt-formulas
593
594You can also join salt-formulas-users team and subscribe to mailing list:
595
596 https://launchpad.net/~salt-formulas-users
597
598Developers wishing to work on the salt-formulas projects should always base
599their work on master branch and submit pull request against specific formula.
600
601 https://github.com/salt-formulas/salt-formula-maas
602
603Any questions or feedback is always welcome so feel free to join our IRC
604channel:
605
Pavel Cizinsky0995e8f2018-05-04 17:10:37 +0200606 #salt-formulas @ irc.freenode.net