blob: 5a7429ef121de036d623acf01a3bf9a37af1123c [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 Cizinsky8dd85b52018-06-18 21:40:13 +0200172Multiple ip ranges for one particular subnet.
173
174.. code-block:: yaml
175
176 maas:
177 region:
178 subnets:
179 Subnet1:
180 cidr: 10.10.0.0/16
181 fabric: fabric-5
182 gateway_ip: 10.10.0.1
183 iprange:
184 start: 10.10.191.241
185 end: 10.10.255.244
186 type: reserved
187 Subnet2:
188 cidr: 130.10.0.0/16
189 fabric: fabric-6
190 gateway_ip: 130.10.0.1
191 multiple: True
192 iprange:
193 range1:
194 start: 130.10.0.10
195 end: 130.10.0.15
196 type: dynamic
197 comment: 'Coment 1'
198 range2:
199 start: 130.10.0.16
200 end: 130.10.0.20
201 type: reserved
202 comment: 'Comment 2'
203
204
Pavel Cizinsky0995e8f2018-05-04 17:10:37 +0200205Update Vlan
206
207NOTE: Vid 0 has default name untagged in MaaS UI
208
209.. code-block:: yaml
210
211 maas:
212 region:
213 fabrics:
214 test-fabric:
215 description: "Test fabric"
216 vlan:
217 0:
218 description: "Your VLAN 0"
219 dhcp: True
220 13:
221 description: "Your VLAN 13"
222 dhcp: False
Ondrej Smola9af2b082016-08-25 17:37:29 +0200223
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100224Create disk schema per machine via maas/client.sls with default lvm schema + default values
225
226NOTE: This should be used mostly for custom root partitioning and RAID configuration. For not-root partitions please use salt-formulas/salt-formula-linux.
227
228.. code-block:: yaml
229
230 maas:
231 region:
232 machines:
233 server1:
234 disk_layout:
235 type: lvm
236 root_size: 20G
237 root_device: vda
238 volume_group: vg1
239 volume_name: root
240 volume_size: 8
241 bootable_device: vda
242
243FLAT layout with custom root size
244
245.. code-block:: yaml
246
247 maas:
248 region:
249 machines:
250 server2:
251 disk_layout:
252 type: flat
253 root_size: 20
254 physical_device: vda
255 bootable_device: vda
256
Petr Michalec16cc5c92018-05-17 09:56:35 +0200257Size specification with `%` char used is not yet supported
258
259
260.. code-block:: yaml
azvyagintsev80f9da72018-06-01 18:01:45 +0300261
Petr Michalec16cc5c92018-05-17 09:56:35 +0200262 maas:
263 region:
264 machines:
265 server3:
266 disk_layout:
267 type: flat
268 bootable_device: sda
269 disk:
270 sda:
271 type: physical
272 partition_schema:
273 part1:
274 size: 100%
275 type: ext4
276 mount: '/'
277
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100278Define more complex layout
279
280.. code-block:: yaml
281
282 maas:
283 region:
284 machines:
285 server3:
286 disk_layout:
azvyagintsevbca1f462018-05-25 19:06:46 +0300287 type: custom
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100288 bootable_device: vda
289 disk:
290 vda:
291 type: physical
292 partition_schema:
293 part1:
294 size: 10G
295 type: ext4
296 mount: '/'
297 part2:
298 size: 2G
299 part3:
300 size: 3G
301 vdc:
302 type: physical
303 partition_schema:
304 part1:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200305 size: 100G
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100306 vdd:
307 type: physical
308 partition_schema:
309 part1:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200310 size: 100G
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100311 raid0:
312 type: raid
313 level: 10
314 devices:
315 - vde
316 - vdf
317 partition_schema:
318 part1:
319 size: 10G
320 part2:
321 size: 2G
322 part3:
323 size: 3G
324 raid1:
325 type: raid
326 level: 1
327 partitions:
328 - vdc-part1
329 - vdd-part1
330 volume_group2:
331 type: lvm
332 devices:
333 - raid1
334 volume:
335 tmp:
336 size: 5G
Ondrej Smola47b56752018-03-06 15:38:27 +0100337 type: ext4
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100338 mount: '/tmp'
339 log:
340 size: 7G
Ondrej Smola47b56752018-03-06 15:38:27 +0100341 type: ext4
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100342 mount: '/var/log'
azvyagintsev7605a662017-11-03 19:05:04 +0200343
Petr Michalec16cc5c92018-05-17 09:56:35 +0200344Raid setup, 4x HDD
345
346.. code-block:: yaml
347
348 maas:
349 region:
350 machines:
351 serverWithRaidExample:
352 disk_layout:
azvyagintsevbca1f462018-05-25 19:06:46 +0300353 type: custom
354 bootable_device: sda
Petr Michalec16cc5c92018-05-17 09:56:35 +0200355 disk:
356 md0:
357 type: raid
358 level: 1
359 devices:
360 - sda
361 - sdb
362 partition_schema:
363 part1:
364 size: 230G
365 type: ext4
366 mount: /
367 md1:
368 type: raid
369 level: 1
370 devices:
371 - sdc
372 - sdd
373 partition_schema:
374 part1:
375 size: 1890G
376 type: ext4
377 mount: /var/lib/libvirt
378
379Raid + LVM setup, 2xSSD + 2xHDD
380
381
382Note: This setup lacks the ability run state twice, as of now when "disk_partition_present" is called, it tries blindly to
383delete the partition and then recreated. That fails as maas rejects remove partition used in RAID/LVM.
384
385
386.. code-block:: yaml
387
388 maas:
389 region:
390 machines:
391 serverWithRaidExample2:
392 disk_layout:
azvyagintsevbca1f462018-05-25 19:06:46 +0300393 type: custom
Petr Michalec16cc5c92018-05-17 09:56:35 +0200394 #bootable_device: vgssd-root
395 disk:
396 sda: &maas_disk_physical_ssd
397 type: physical
398 partition_schema:
399 part1:
400 size: 239G
401 sdb: *maas_disk_physical_ssd
402 sdc: &maas_disk_physical_hdd
403 type: physical
404 partition_schema:
405 part1:
406 size: 1990G
407 sdd: *maas_disk_physical_hdd
408 md0:
409 type: raid
410 level: 1
411 partitions:
412 - sda-part1
413 - sdb-part1
414 md1:
415 type: raid
416 level: 1
417 partitions:
418 - sdc-part1
419 - sdd-part1
420 vgssd:
421 type: lvm
422 devices:
423 - md0
424 volume:
425 root:
426 size: 230G
427 type: ext4
428 mount: '/'
429 vghdd:
430 type: lvm
431 devices:
432 - md1
433 volume:
434 libvirt:
435 size: 1800G
436 type: ext4
437 mount: '/var/lib/libvirt'
438
439
440
441
azvyagintsev80f9da72018-06-01 18:01:45 +0300442Setup image mirror (Maas boot resources,)
Jiri Broulike30a60f2018-04-09 21:15:10 +0200443
444.. code-block:: yaml
445
446 maas:
447 mirror:
448 enabled: true
449 image:
azvyagintsev80f9da72018-06-01 18:01:45 +0300450 sections:
451 bootloaders:
452 keyring: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
453 upstream: http://images.maas.io/ephemeral-v3/daily/
454 local_dir: /var/www/html/maas/images/ephemeral-v3/daily
455 count: 1
456 # i386 need for pxe
457 filters: ['arch~(i386|amd64)', 'os~(grub*|pxelinux)']
Jiri Broulike30a60f2018-04-09 21:15:10 +0200458 xenial:
azvyagintsev80f9da72018-06-01 18:01:45 +0300459 keyring: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
460 upstream: http://images.maas.io/ephemeral-v3/daily/
461 local_dir: /var/www/html/maas/images/ephemeral-v3/daily
462 count: 1
463 filters: ['release~(xenial)', 'arch~(amd64)', 'subarch~(generic|hwe-16.04$|ga-16.04)']
Jiri Broulike30a60f2018-04-09 21:15:10 +0200464 count: 1
465
azvyagintsev80f9da72018-06-01 18:01:45 +0300466Usage of local deb repos
Richard Felklce118a22017-09-13 11:09:12 +0200467
468.. code-block:: yaml
azvyagintsev7605a662017-11-03 19:05:04 +0200469
Richard Felklce118a22017-09-13 11:09:12 +0200470 maas:
471 cluster:
472 enabled: true
473 region:
474 port: 80
475 host: localhost
476 saltstack_repo_key: |
477 -----BEGIN PGP PUBLIC KEY BLOCK-----
478 Version: GnuPG v2
479
480 mQENBFOpvpgBCADkP656H41i8fpplEEB8IeLhugyC2rTEwwSclb8tQNYtUiGdna9
azvyagintsev06b71e72017-11-08 17:11:07 +0200481 .....
Richard Felklce118a22017-09-13 11:09:12 +0200482 fuBmScum8uQTrEF5+Um5zkwC7EXTdH1co/+/V/fpOtxIg4XO4kcugZefVm5ERfVS
483 MA==
484 =dtMN
485 -----END PGP PUBLIC KEY BLOCK-----
486 saltstack_repo_xenial: "http://${_param:local_repo_url}/ubuntu-xenial stable salt"
487 saltstack_repo_trusty: "http://${_param:local_repo_url}/ubuntu-trusty stable salt"
488
Ondrej Smola9af2b082016-08-25 17:37:29 +0200489Single MAAS cluster service [multiple racks]
490
491.. code-block:: yaml
492
493 maas:
494 cluster:
495 enabled: true
Jakub Pavlikf43512b2016-08-30 10:25:42 +0200496 role: master/slave
Ondrej Smola9af2b082016-08-25 17:37:29 +0200497
azvyagintsev7605a662017-11-03 19:05:04 +0200498.. code-block:: yaml
499
500 maas:
501 cluster:
502 enabled: true
503 role: master/slave
504
Martin Polreich0764b762017-11-20 14:08:30 +0100505MAAS region service with backup data
506
507.. code-block:: yaml
azvyagintsev80f9da72018-06-01 18:01:45 +0300508
Martin Polreich0764b762017-11-20 14:08:30 +0100509 maas:
510 region:
511 database:
512 initial_data:
513 source: cfg01.local
514 host: 192.168.0.11
515
Petr Michalec8a0d52e2018-05-30 16:22:56 +0200516Test pillars
517==============
518
519Mind the postgresql and rsyslog `.sls`. Database and syslog service are required for MAAS to properly install and work.
520
521* https://github.com/salt-formulas/salt-formula-rsyslog/tree/master/tests/pillar
522
523
azvyagintsev7605a662017-11-03 19:05:04 +0200524Module function's example:
525==========================
526
527* Wait for status of selected machine's:
528
529.. code-block:: bash
530
531 > cat maas/machines/wait_for_machines_ready.sls
532
533 ...
534
535 wait_for_machines_ready:
536 module.run:
537 - name: maas.wait_for_machine_status
538 - kwargs:
539 machines:
540 - kvm01
541 - kvm02
542 timeout: 1200 # in seconds
543 req_status: "Ready"
544 - require:
545 - cmd: maas_login_admin
546 ...
547
548If 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:
549
550.. code-block:: bash
551
552 > cat maas/machines/wait_for_machines_deployed.sls
553
554 ...
555
556 wait_for_machines_ready:
557 module.run:
558 - name: maas.wait_for_machine_status
559 - kwargs:
560 timeout: 1200 # in seconds
Michael Polenchuke438bd32017-11-09 20:42:42 +0400561 req_status: "Deployed"
azvyagintsev7605a662017-11-03 19:05:04 +0200562 ignore_machines:
563 - kvm01 # in case it's broken or whatever
564 - require:
565 - cmd: maas_login_admin
566 ...
567
azvyagintsev06b71e72017-11-08 17:11:07 +0200568List of available `req_status` defined in global variable:
569
570.. code-block:: python
571
572 STATUS_NAME_DICT = dict([
573 (0, 'New'), (1, 'Commissioning'), (2, 'Failed commissioning'),
574 (3, 'Missing'), (4, 'Ready'), (5, 'Reserved'), (10, 'Allocated'),
575 (9, 'Deploying'), (6, 'Deployed'), (7, 'Retired'), (8, 'Broken'),
576 (11, 'Failed deployment'), (12, 'Releasing'),
577 (13, 'Releasing failed'), (14, 'Disk erasing'),
578 (15, 'Failed disk erasing')])
azvyagintsev7605a662017-11-03 19:05:04 +0200579
580
Ales Komarekef982692016-02-21 14:56:07 +0100581Read more
582=========
583
Roald Nefsc86d84a2017-10-12 21:19:50 +0200584* https://maas.io/
Filip Pytlounc07d2352017-02-02 13:02:03 +0100585
586Documentation and Bugs
587======================
588
589To learn how to install and update salt-formulas, consult the documentation
590available online at:
591
592 http://salt-formulas.readthedocs.io/
593
594In the unfortunate event that bugs are discovered, they should be reported to
595the appropriate issue tracker. Use Github issue tracker for specific salt
596formula:
597
598 https://github.com/salt-formulas/salt-formula-maas/issues
599
600For feature requests, bug reports or blueprints affecting entire ecosystem,
601use Launchpad salt-formulas project:
602
603 https://launchpad.net/salt-formulas
604
605You can also join salt-formulas-users team and subscribe to mailing list:
606
607 https://launchpad.net/~salt-formulas-users
608
609Developers wishing to work on the salt-formulas projects should always base
610their work on master branch and submit pull request against specific formula.
611
612 https://github.com/salt-formulas/salt-formula-maas
613
614Any questions or feedback is always welcome so feel free to join our IRC
615channel:
616
Pavel Cizinsky0995e8f2018-05-04 17:10:37 +0200617 #salt-formulas @ irc.freenode.net