blob: e466959736152ac84b35da33ec48339624897e36 [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
Jiri Broulike30a60f2018-04-09 21:15:10 +020067 boot_sources:
68 maas_mirror:
69 url: http://images.maas.io/ephemeral-v3/daily/
70 keyring_file: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
71 local_mirror:
72 url: http://127.0.0.1/maas/images/ephemeral-v3/daily
73 keyring_file: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
Damian Szelugaa8248102017-03-16 08:48:51 +010074 boot_resources:
75 bootscript1:
76 title: bootscript
77 architecture: amd64/generic
78 filetype: tgz
79 content: /srv/salt/reclass/nodes/path_to_file
80 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
228 maas:
229 region:
230 machines:
231 server3:
232 disk_layout:
233 type: flat
234 bootable_device: sda
235 disk:
236 sda:
237 type: physical
238 partition_schema:
239 part1:
240 size: 100%
241 type: ext4
242 mount: '/'
243
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100244Define more complex layout
245
246.. code-block:: yaml
247
248 maas:
249 region:
250 machines:
251 server3:
252 disk_layout:
253 type: flat #This is simplies setup
254 bootable_device: vda
255 disk:
256 vda:
257 type: physical
258 partition_schema:
259 part1:
260 size: 10G
261 type: ext4
262 mount: '/'
263 part2:
264 size: 2G
265 part3:
266 size: 3G
267 vdc:
268 type: physical
269 partition_schema:
270 part1:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200271 size: 100G
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100272 vdd:
273 type: physical
274 partition_schema:
275 part1:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200276 size: 100G
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100277 raid0:
278 type: raid
279 level: 10
280 devices:
281 - vde
282 - vdf
283 partition_schema:
284 part1:
285 size: 10G
286 part2:
287 size: 2G
288 part3:
289 size: 3G
290 raid1:
291 type: raid
292 level: 1
293 partitions:
294 - vdc-part1
295 - vdd-part1
296 volume_group2:
297 type: lvm
298 devices:
299 - raid1
300 volume:
301 tmp:
302 size: 5G
Ondrej Smola47b56752018-03-06 15:38:27 +0100303 type: ext4
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100304 mount: '/tmp'
305 log:
306 size: 7G
Ondrej Smola47b56752018-03-06 15:38:27 +0100307 type: ext4
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100308 mount: '/var/log'
azvyagintsev7605a662017-11-03 19:05:04 +0200309
Petr Michalec16cc5c92018-05-17 09:56:35 +0200310Raid setup, 4x HDD
311
312.. code-block:: yaml
313
314 maas:
315 region:
316 machines:
317 serverWithRaidExample:
318 disk_layout:
319 #type: flat
320 #bootable_device: sda
321 disk:
322 md0:
323 type: raid
324 level: 1
325 devices:
326 - sda
327 - sdb
328 partition_schema:
329 part1:
330 size: 230G
331 type: ext4
332 mount: /
333 md1:
334 type: raid
335 level: 1
336 devices:
337 - sdc
338 - sdd
339 partition_schema:
340 part1:
341 size: 1890G
342 type: ext4
343 mount: /var/lib/libvirt
344
345Raid + LVM setup, 2xSSD + 2xHDD
346
347
348Note: This setup lacks the ability run state twice, as of now when "disk_partition_present" is called, it tries blindly to
349delete the partition and then recreated. That fails as maas rejects remove partition used in RAID/LVM.
350
351
352.. code-block:: yaml
353
354 maas:
355 region:
356 machines:
357 serverWithRaidExample2:
358 disk_layout:
359 #type: flat
360 #bootable_device: vgssd-root
361 disk:
362 sda: &maas_disk_physical_ssd
363 type: physical
364 partition_schema:
365 part1:
366 size: 239G
367 sdb: *maas_disk_physical_ssd
368 sdc: &maas_disk_physical_hdd
369 type: physical
370 partition_schema:
371 part1:
372 size: 1990G
373 sdd: *maas_disk_physical_hdd
374 md0:
375 type: raid
376 level: 1
377 partitions:
378 - sda-part1
379 - sdb-part1
380 md1:
381 type: raid
382 level: 1
383 partitions:
384 - sdc-part1
385 - sdd-part1
386 vgssd:
387 type: lvm
388 devices:
389 - md0
390 volume:
391 root:
392 size: 230G
393 type: ext4
394 mount: '/'
395 vghdd:
396 type: lvm
397 devices:
398 - md1
399 volume:
400 libvirt:
401 size: 1800G
402 type: ext4
403 mount: '/var/lib/libvirt'
404
405
406
407
Jiri Broulike30a60f2018-04-09 21:15:10 +0200408Setup image mirror
409
410.. code-block:: yaml
411
412 maas:
413 mirror:
414 enabled: true
415 image:
416 release:
417 xenial:
418 keyring: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
419 upstream: http://images.maas.io/ephemeral-v3/daily/
420 local_dir: /var/www/html/maas/images/ephemeral-v3/daily
421 arch: amd64
422 subarch: 'generic|hwe-t'
423 count: 1
424
Richard Felklce118a22017-09-13 11:09:12 +0200425Usage of local repos
426
427.. code-block:: yaml
azvyagintsev7605a662017-11-03 19:05:04 +0200428
Richard Felklce118a22017-09-13 11:09:12 +0200429 maas:
430 cluster:
431 enabled: true
432 region:
433 port: 80
434 host: localhost
435 saltstack_repo_key: |
436 -----BEGIN PGP PUBLIC KEY BLOCK-----
437 Version: GnuPG v2
438
439 mQENBFOpvpgBCADkP656H41i8fpplEEB8IeLhugyC2rTEwwSclb8tQNYtUiGdna9
azvyagintsev06b71e72017-11-08 17:11:07 +0200440 .....
Richard Felklce118a22017-09-13 11:09:12 +0200441 fuBmScum8uQTrEF5+Um5zkwC7EXTdH1co/+/V/fpOtxIg4XO4kcugZefVm5ERfVS
442 MA==
443 =dtMN
444 -----END PGP PUBLIC KEY BLOCK-----
445 saltstack_repo_xenial: "http://${_param:local_repo_url}/ubuntu-xenial stable salt"
446 saltstack_repo_trusty: "http://${_param:local_repo_url}/ubuntu-trusty stable salt"
447
Ondrej Smola9af2b082016-08-25 17:37:29 +0200448Single MAAS cluster service [multiple racks]
449
450.. code-block:: yaml
451
452 maas:
453 cluster:
454 enabled: true
Jakub Pavlikf43512b2016-08-30 10:25:42 +0200455 role: master/slave
Ondrej Smola9af2b082016-08-25 17:37:29 +0200456
azvyagintsev7605a662017-11-03 19:05:04 +0200457.. code-block:: yaml
458
459 maas:
460 cluster:
461 enabled: true
462 role: master/slave
463
Martin Polreich0764b762017-11-20 14:08:30 +0100464MAAS region service with backup data
465
466.. code-block:: yaml
467 maas:
468 region:
469 database:
470 initial_data:
471 source: cfg01.local
472 host: 192.168.0.11
473
azvyagintsev7605a662017-11-03 19:05:04 +0200474Module function's example:
475==========================
476
477* Wait for status of selected machine's:
478
479.. code-block:: bash
480
481 > cat maas/machines/wait_for_machines_ready.sls
482
483 ...
484
485 wait_for_machines_ready:
486 module.run:
487 - name: maas.wait_for_machine_status
488 - kwargs:
489 machines:
490 - kvm01
491 - kvm02
492 timeout: 1200 # in seconds
493 req_status: "Ready"
494 - require:
495 - cmd: maas_login_admin
496 ...
497
498If 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:
499
500.. code-block:: bash
501
502 > cat maas/machines/wait_for_machines_deployed.sls
503
504 ...
505
506 wait_for_machines_ready:
507 module.run:
508 - name: maas.wait_for_machine_status
509 - kwargs:
510 timeout: 1200 # in seconds
Michael Polenchuke438bd32017-11-09 20:42:42 +0400511 req_status: "Deployed"
azvyagintsev7605a662017-11-03 19:05:04 +0200512 ignore_machines:
513 - kvm01 # in case it's broken or whatever
514 - require:
515 - cmd: maas_login_admin
516 ...
517
azvyagintsev06b71e72017-11-08 17:11:07 +0200518List of available `req_status` defined in global variable:
519
520.. code-block:: python
521
522 STATUS_NAME_DICT = dict([
523 (0, 'New'), (1, 'Commissioning'), (2, 'Failed commissioning'),
524 (3, 'Missing'), (4, 'Ready'), (5, 'Reserved'), (10, 'Allocated'),
525 (9, 'Deploying'), (6, 'Deployed'), (7, 'Retired'), (8, 'Broken'),
526 (11, 'Failed deployment'), (12, 'Releasing'),
527 (13, 'Releasing failed'), (14, 'Disk erasing'),
528 (15, 'Failed disk erasing')])
azvyagintsev7605a662017-11-03 19:05:04 +0200529
530
Ales Komarekef982692016-02-21 14:56:07 +0100531Read more
532=========
533
Roald Nefsc86d84a2017-10-12 21:19:50 +0200534* https://maas.io/
Filip Pytlounc07d2352017-02-02 13:02:03 +0100535
536Documentation and Bugs
537======================
538
539To learn how to install and update salt-formulas, consult the documentation
540available online at:
541
542 http://salt-formulas.readthedocs.io/
543
544In the unfortunate event that bugs are discovered, they should be reported to
545the appropriate issue tracker. Use Github issue tracker for specific salt
546formula:
547
548 https://github.com/salt-formulas/salt-formula-maas/issues
549
550For feature requests, bug reports or blueprints affecting entire ecosystem,
551use Launchpad salt-formulas project:
552
553 https://launchpad.net/salt-formulas
554
555You can also join salt-formulas-users team and subscribe to mailing list:
556
557 https://launchpad.net/~salt-formulas-users
558
559Developers wishing to work on the salt-formulas projects should always base
560their work on master branch and submit pull request against specific formula.
561
562 https://github.com/salt-formulas/salt-formula-maas
563
564Any questions or feedback is always welcome so feel free to join our IRC
565channel:
566
Pavel Cizinsky0995e8f2018-05-04 17:10:37 +0200567 #salt-formulas @ irc.freenode.net