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