blob: c8556ab9332fd2b00590e61c793f382b2642a6b9 [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
63 primary_rack: "${linux:network:hostname}"
64
Damian Szelugaa8248102017-03-16 08:48:51 +010065 subnets:
66 subnet1:
azvyagintsevf3515c82018-06-26 18:59:05 +030067 fabric: ${maas:region:fabrics:deploy_network:name}
Damian Szelugaa8248102017-03-16 08:48:51 +010068 cidr: 2.2.3.0/24
69 gateway_ip: 2.2.3.2
azvyagintsevf3515c82018-06-26 18:59:05 +030070 vlan: 150
71 ipranges:
72 1:
73 end: "2.2.3.40"
74 start: "2.2.3.20"
75 type: dynamic
76 2:
77 end: "2.2.3.250"
78 start: "2.2.3.45"
79 type: static
Damian Szelugaa8248102017-03-16 08:48:51 +010080 dhcp_snippets:
81 test-snippet:
82 value: option bootfile-name "tftp://192.168.0.10/snippet";
83 description: Test snippet
84 enabled: true
85 subnet: subnet1
azvyagintsev3ff2ef12018-06-01 21:30:45 +030086 boot_sources_delete_all_others: true
Jiri Broulike30a60f2018-04-09 21:15:10 +020087 boot_sources:
azvyagintsev3ff2ef12018-06-01 21:30:45 +030088 resources_mirror:
89 url: http://images.maas.io/ephemeral-v3/
Jiri Broulike30a60f2018-04-09 21:15:10 +020090 keyring_file: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
azvyagintsev3ff2ef12018-06-01 21:30:45 +030091 boot_sources_selections:
92 xenial:
93 url: "http://images.maas.io/ephemeral-v3/" # should be same in boot_sources, or other already defined.
94 os: "ubuntu"
95 release: "xenial"
96 arches: "amd64"
97 subarches: '"*"'
98 labels: '"*"'
Damian Szelugaa8248102017-03-16 08:48:51 +010099 package_repositories:
100 Saltstack:
101 url: http://repo.saltstack.com/apt/ubuntu/14.04/amd64/2016.3/
102 distributions:
103 - trusty
104 components:
105 - main
Damian Szelugaa8248102017-03-16 08:48:51 +0100106 arches: amd64
107 key: "-----BEGIN PGP PUBLIC KEY BLOCK-----
108 Version: GnuPG v2
Pavel Cizinsky5a6e2722016-08-31 15:58:13 +0200109
Damian Szelugaa8248102017-03-16 08:48:51 +0100110 mQENBFOpvpgBCADkP656H41i8fpplEEB8IeLhugyC2rTEwwSclb8tQNYtUiGdna9
azvyagintsev06b71e72017-11-08 17:11:07 +0200111 ......
Damian Szelugaa8248102017-03-16 08:48:51 +0100112 fuBmScum8uQTrEF5+Um5zkwC7EXTdH1co/+/V/fpOtxIg4XO4kcugZefVm5ERfVS
113 MA==
114 =dtMN
115 -----END PGP PUBLIC KEY BLOCK-----"
116 enabled: true
117 machines:
azvyagintsev06b71e72017-11-08 17:11:07 +0200118 machine1_new_schema:
119 pxe_interface_mac: "11:22:33:44:55:66" # Node will be identified by those mac
120 interfaces:
121 nic01: # could be any, used for iterate only
122 type: eth # NotImplemented
123 name: eth0 # Override default nic name. Interface to rename will be identified by mac
124 mac: "11:22:33:44:55:66"
125 mode: "static"
126 ip: "2.2.3.19" # ip should be out of reserved subnet range, but still in subnet range
127 subnet: "subnet1"
128 gateway: "2.2.3.2" # override default gateway from subnet
129 nic02:
130 type: eth # Not-implemented
131 mac: "11:22:33:44:55:78"
132 subnet: "subnet2"
133 mode: "dhcp"
Damian Szelugaa8248102017-03-16 08:48:51 +0100134 power_parameters:
135 power_type: ipmi
136 power_address: '192.168.10.10'
137 power_user: bmc_user
138 power_password: bmc_password
Ondrej Smola455003c2017-06-01 22:53:39 +0200139 #Optional (for legacy HW)
140 power_driver: LAN
azvyagintsev06b71e72017-11-08 17:11:07 +0200141 distro_series: xenial
142 hwe_kernel: hwe-16.04
143 machine1_old_schema:
144 interface:
145 mac: "11:22:33:44:55:88" # Node will be identified by those mac
146 mode: "static"
147 ip: "2.2.3.15"
148 subnet: "subnet1"
149 gateway: "2.2.3.2"
150 power_parameters:
151 power_type: ipmi
152 power_address: '192.168.10.10'
153 power_user: bmc_user
154 power_password: bmc_password
155 #Optional (for legacy HW)
156 power_driver: LAN
157 # FIXME: that's should be moved into another,livirt example.
Petr Ruzicka5fe96742017-11-10 14:22:24 +0100158 # Used in case of power_type: virsh
159 power_id: my_libvirt_vm_name
Maciej Relewicz37b12a22017-04-25 15:23:16 +0200160 distro_series: xenial
161 hwe_kernel: hwe-16.04
Damian Szelugaa8248102017-03-16 08:48:51 +0100162 devices:
163 machine1-ipmi:
164 interface:
165 ip_address: 192.168.10.10
166 subnet: cidr:192.168.10.0/24
167 mac: '66:55:44:33:22:11'
Damian Szeluga336ff2e2017-03-30 11:19:34 +0200168 commissioning_scripts:
azvyagintsevec61dd62017-11-16 19:12:05 +0200169 00-maas-05-simplify-network-interfaces: /etc/maas/files/commisioning_scripts/00-maas-05-simplify-network-interfaces
Damian Szeluga336ff2e2017-03-30 11:19:34 +0200170 maas_config:
171 domain: mydomain.local
172 http_proxy: http://192.168.0.10:3142
173 commissioning_distro_series: xenial
174 default_distro_series: xenial
175 default_osystem: 'ubuntu'
176 default_storage_layout: lvm
177 disk_erase_with_secure_erase: true
178 dnssec_validation: 'no'
179 enable_third_party_drivers: true
180 maas_name: cfg01
181 network_discovery: 'enabled'
182 active_discovery_interval: '600'
183 ntp_external_only: true
184 ntp_servers: 10.10.11.23 10.10.11.24
185 upstream_dns: 192.168.12.13
186 enable_http_proxy: true
187 default_min_hwe_kernel: ''
188 sshprefs:
azvyagintsev06b71e72017-11-08 17:11:07 +0200189 - 'ssh-rsa ASD.........dfsadf blah@blah'
Ondrej Smola9af2b082016-08-25 17:37:29 +0200190
Pavel Cizinsky8dd85b52018-06-18 21:40:13 +0200191
Pavel Cizinsky0995e8f2018-05-04 17:10:37 +0200192Update Vlan
193
194NOTE: Vid 0 has default name untagged in MaaS UI
195
196.. code-block:: yaml
197
198 maas:
199 region:
200 fabrics:
201 test-fabric:
202 description: "Test fabric"
203 vlan:
204 0:
205 description: "Your VLAN 0"
206 dhcp: True
207 13:
208 description: "Your VLAN 13"
209 dhcp: False
Ondrej Smola9af2b082016-08-25 17:37:29 +0200210
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100211Create disk schema per machine via maas/client.sls with default lvm schema + default values
212
213NOTE: This should be used mostly for custom root partitioning and RAID configuration. For not-root partitions please use salt-formulas/salt-formula-linux.
214
215.. code-block:: yaml
216
217 maas:
218 region:
219 machines:
220 server1:
221 disk_layout:
222 type: lvm
223 root_size: 20G
224 root_device: vda
225 volume_group: vg1
226 volume_name: root
227 volume_size: 8
228 bootable_device: vda
229
230FLAT layout with custom root size
231
232.. code-block:: yaml
233
234 maas:
235 region:
236 machines:
237 server2:
238 disk_layout:
239 type: flat
240 root_size: 20
241 physical_device: vda
242 bootable_device: vda
243
Petr Michalec16cc5c92018-05-17 09:56:35 +0200244Size specification with `%` char used is not yet supported
245
246
247.. code-block:: yaml
azvyagintsev80f9da72018-06-01 18:01:45 +0300248
Petr Michalec16cc5c92018-05-17 09:56:35 +0200249 maas:
250 region:
251 machines:
252 server3:
253 disk_layout:
254 type: flat
255 bootable_device: sda
256 disk:
257 sda:
258 type: physical
259 partition_schema:
260 part1:
261 size: 100%
262 type: ext4
263 mount: '/'
264
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100265Define more complex layout
266
267.. code-block:: yaml
268
269 maas:
270 region:
271 machines:
272 server3:
273 disk_layout:
azvyagintsevbca1f462018-05-25 19:06:46 +0300274 type: custom
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100275 bootable_device: vda
276 disk:
277 vda:
278 type: physical
279 partition_schema:
280 part1:
281 size: 10G
282 type: ext4
283 mount: '/'
284 part2:
285 size: 2G
286 part3:
287 size: 3G
288 vdc:
289 type: physical
290 partition_schema:
291 part1:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200292 size: 100G
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100293 vdd:
294 type: physical
295 partition_schema:
296 part1:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200297 size: 100G
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100298 raid0:
299 type: raid
300 level: 10
301 devices:
302 - vde
303 - vdf
304 partition_schema:
305 part1:
306 size: 10G
307 part2:
308 size: 2G
309 part3:
310 size: 3G
311 raid1:
312 type: raid
313 level: 1
314 partitions:
315 - vdc-part1
316 - vdd-part1
317 volume_group2:
318 type: lvm
319 devices:
320 - raid1
321 volume:
322 tmp:
323 size: 5G
Ondrej Smola47b56752018-03-06 15:38:27 +0100324 type: ext4
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100325 mount: '/tmp'
326 log:
327 size: 7G
Ondrej Smola47b56752018-03-06 15:38:27 +0100328 type: ext4
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100329 mount: '/var/log'
azvyagintsev7605a662017-11-03 19:05:04 +0200330
Petr Michalec16cc5c92018-05-17 09:56:35 +0200331Raid setup, 4x HDD
332
333.. code-block:: yaml
334
335 maas:
336 region:
337 machines:
338 serverWithRaidExample:
339 disk_layout:
azvyagintsevbca1f462018-05-25 19:06:46 +0300340 type: custom
341 bootable_device: sda
Petr Michalec16cc5c92018-05-17 09:56:35 +0200342 disk:
343 md0:
344 type: raid
345 level: 1
346 devices:
347 - sda
348 - sdb
349 partition_schema:
350 part1:
351 size: 230G
352 type: ext4
353 mount: /
354 md1:
355 type: raid
356 level: 1
357 devices:
358 - sdc
359 - sdd
360 partition_schema:
361 part1:
362 size: 1890G
363 type: ext4
364 mount: /var/lib/libvirt
365
366Raid + LVM setup, 2xSSD + 2xHDD
367
368
369Note: This setup lacks the ability run state twice, as of now when "disk_partition_present" is called, it tries blindly to
370delete the partition and then recreated. That fails as maas rejects remove partition used in RAID/LVM.
371
372
373.. code-block:: yaml
374
375 maas:
376 region:
377 machines:
378 serverWithRaidExample2:
379 disk_layout:
azvyagintsevbca1f462018-05-25 19:06:46 +0300380 type: custom
Petr Michalec16cc5c92018-05-17 09:56:35 +0200381 #bootable_device: vgssd-root
382 disk:
383 sda: &maas_disk_physical_ssd
384 type: physical
385 partition_schema:
386 part1:
387 size: 239G
388 sdb: *maas_disk_physical_ssd
389 sdc: &maas_disk_physical_hdd
390 type: physical
391 partition_schema:
392 part1:
393 size: 1990G
394 sdd: *maas_disk_physical_hdd
395 md0:
396 type: raid
397 level: 1
398 partitions:
399 - sda-part1
400 - sdb-part1
401 md1:
402 type: raid
403 level: 1
404 partitions:
405 - sdc-part1
406 - sdd-part1
407 vgssd:
408 type: lvm
409 devices:
410 - md0
411 volume:
412 root:
413 size: 230G
414 type: ext4
415 mount: '/'
416 vghdd:
417 type: lvm
418 devices:
419 - md1
420 volume:
421 libvirt:
422 size: 1800G
423 type: ext4
424 mount: '/var/lib/libvirt'
425
426
427
428
azvyagintsev80f9da72018-06-01 18:01:45 +0300429Setup image mirror (Maas boot resources,)
Jiri Broulike30a60f2018-04-09 21:15:10 +0200430
431.. code-block:: yaml
432
433 maas:
434 mirror:
435 enabled: true
436 image:
azvyagintsev80f9da72018-06-01 18:01:45 +0300437 sections:
438 bootloaders:
439 keyring: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
440 upstream: http://images.maas.io/ephemeral-v3/daily/
441 local_dir: /var/www/html/maas/images/ephemeral-v3/daily
442 count: 1
443 # i386 need for pxe
444 filters: ['arch~(i386|amd64)', 'os~(grub*|pxelinux)']
Jiri Broulike30a60f2018-04-09 21:15:10 +0200445 xenial:
azvyagintsev80f9da72018-06-01 18:01:45 +0300446 keyring: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
447 upstream: http://images.maas.io/ephemeral-v3/daily/
448 local_dir: /var/www/html/maas/images/ephemeral-v3/daily
449 count: 1
450 filters: ['release~(xenial)', 'arch~(amd64)', 'subarch~(generic|hwe-16.04$|ga-16.04)']
Jiri Broulike30a60f2018-04-09 21:15:10 +0200451 count: 1
452
azvyagintsev80f9da72018-06-01 18:01:45 +0300453Usage of local deb repos
Richard Felklce118a22017-09-13 11:09:12 +0200454
455.. code-block:: yaml
azvyagintsev7605a662017-11-03 19:05:04 +0200456
Richard Felklce118a22017-09-13 11:09:12 +0200457 maas:
458 cluster:
459 enabled: true
460 region:
461 port: 80
462 host: localhost
463 saltstack_repo_key: |
464 -----BEGIN PGP PUBLIC KEY BLOCK-----
465 Version: GnuPG v2
466
467 mQENBFOpvpgBCADkP656H41i8fpplEEB8IeLhugyC2rTEwwSclb8tQNYtUiGdna9
azvyagintsev06b71e72017-11-08 17:11:07 +0200468 .....
Richard Felklce118a22017-09-13 11:09:12 +0200469 fuBmScum8uQTrEF5+Um5zkwC7EXTdH1co/+/V/fpOtxIg4XO4kcugZefVm5ERfVS
470 MA==
471 =dtMN
472 -----END PGP PUBLIC KEY BLOCK-----
473 saltstack_repo_xenial: "http://${_param:local_repo_url}/ubuntu-xenial stable salt"
474 saltstack_repo_trusty: "http://${_param:local_repo_url}/ubuntu-trusty stable salt"
475
Ondrej Smola9af2b082016-08-25 17:37:29 +0200476Single MAAS cluster service [multiple racks]
477
478.. code-block:: yaml
479
480 maas:
481 cluster:
482 enabled: true
Jakub Pavlikf43512b2016-08-30 10:25:42 +0200483 role: master/slave
Ondrej Smola9af2b082016-08-25 17:37:29 +0200484
azvyagintsev7605a662017-11-03 19:05:04 +0200485.. code-block:: yaml
486
487 maas:
488 cluster:
489 enabled: true
490 role: master/slave
491
Martin Polreich0764b762017-11-20 14:08:30 +0100492MAAS region service with backup data
493
494.. code-block:: yaml
azvyagintsev80f9da72018-06-01 18:01:45 +0300495
Martin Polreich0764b762017-11-20 14:08:30 +0100496 maas:
497 region:
498 database:
499 initial_data:
500 source: cfg01.local
501 host: 192.168.0.11
502
Petr Michalec8a0d52e2018-05-30 16:22:56 +0200503Test pillars
504==============
505
506Mind the postgresql and rsyslog `.sls`. Database and syslog service are required for MAAS to properly install and work.
507
508* https://github.com/salt-formulas/salt-formula-rsyslog/tree/master/tests/pillar
509
510
azvyagintsev7605a662017-11-03 19:05:04 +0200511Module function's example:
512==========================
513
514* Wait for status of selected machine's:
515
516.. code-block:: bash
517
518 > cat maas/machines/wait_for_machines_ready.sls
519
520 ...
521
522 wait_for_machines_ready:
523 module.run:
524 - name: maas.wait_for_machine_status
525 - kwargs:
526 machines:
527 - kvm01
528 - kvm02
529 timeout: 1200 # in seconds
530 req_status: "Ready"
531 - require:
532 - cmd: maas_login_admin
533 ...
534
535If 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:
536
537.. code-block:: bash
538
539 > cat maas/machines/wait_for_machines_deployed.sls
540
541 ...
542
543 wait_for_machines_ready:
544 module.run:
545 - name: maas.wait_for_machine_status
546 - kwargs:
547 timeout: 1200 # in seconds
Michael Polenchuke438bd32017-11-09 20:42:42 +0400548 req_status: "Deployed"
azvyagintsev7605a662017-11-03 19:05:04 +0200549 ignore_machines:
550 - kvm01 # in case it's broken or whatever
551 - require:
552 - cmd: maas_login_admin
553 ...
554
azvyagintsev06b71e72017-11-08 17:11:07 +0200555List of available `req_status` defined in global variable:
556
557.. code-block:: python
558
559 STATUS_NAME_DICT = dict([
560 (0, 'New'), (1, 'Commissioning'), (2, 'Failed commissioning'),
561 (3, 'Missing'), (4, 'Ready'), (5, 'Reserved'), (10, 'Allocated'),
562 (9, 'Deploying'), (6, 'Deployed'), (7, 'Retired'), (8, 'Broken'),
563 (11, 'Failed deployment'), (12, 'Releasing'),
564 (13, 'Releasing failed'), (14, 'Disk erasing'),
565 (15, 'Failed disk erasing')])
azvyagintsev7605a662017-11-03 19:05:04 +0200566
567
Ales Komarekef982692016-02-21 14:56:07 +0100568Read more
569=========
570
Roald Nefsc86d84a2017-10-12 21:19:50 +0200571* https://maas.io/
Filip Pytlounc07d2352017-02-02 13:02:03 +0100572
573Documentation and Bugs
574======================
575
576To learn how to install and update salt-formulas, consult the documentation
577available online at:
578
579 http://salt-formulas.readthedocs.io/
580
581In the unfortunate event that bugs are discovered, they should be reported to
582the appropriate issue tracker. Use Github issue tracker for specific salt
583formula:
584
585 https://github.com/salt-formulas/salt-formula-maas/issues
586
587For feature requests, bug reports or blueprints affecting entire ecosystem,
588use Launchpad salt-formulas project:
589
590 https://launchpad.net/salt-formulas
591
592You can also join salt-formulas-users team and subscribe to mailing list:
593
594 https://launchpad.net/~salt-formulas-users
595
596Developers wishing to work on the salt-formulas projects should always base
597their work on master branch and submit pull request against specific formula.
598
599 https://github.com/salt-formulas/salt-formula-maas
600
601Any questions or feedback is always welcome so feel free to join our IRC
602channel:
603
Pavel Cizinsky0995e8f2018-05-04 17:10:37 +0200604 #salt-formulas @ irc.freenode.net