blob: 7490b792c48460fb63a0c765d8e67933a866092d [file] [log] [blame]
OlgaGusarenkoa8b77152018-07-30 23:33:35 +03001=====
2Usage
3=====
Ales Komarekef982692016-02-21 14:56:07 +01004
OlgaGusarenkoa8b77152018-07-30 23:33:35 +03005Metal as a Service
Ales Komarekef982692016-02-21 14:56:07 +01006
7Sample pillars
8==============
9
OlgaGusarenkoa8b77152018-07-30 23:33:35 +030010Single maas service:
Ales Komarekef982692016-02-21 14:56:07 +010011
12.. code-block:: yaml
13
14 maas:
15 server:
16 enabled: true
17
OlgaGusarenkoa8b77152018-07-30 23:33:35 +030018Single MAAS region service [single UI/API]:
Ondrej Smola9af2b082016-08-25 17:37:29 +020019
20.. code-block:: yaml
21
Damian Szelugaa8248102017-03-16 08:48:51 +010022 maas:
Damian Szeluga336ff2e2017-03-30 11:19:34 +020023 salt_master_ip: 192.168.0.10
Damian Szelugaa8248102017-03-16 08:48:51 +010024 region:
Jiri Broulik0df14bc2017-08-07 10:01:55 +020025 upstream_proxy:
26 address: 10.0.0.1
27 port: 8080
Ondrej Smola3ffb6312017-09-22 17:13:10 +020028 user: username #OPTIONAL
29 password: password #OPTIONAL
Damian Szelugaa8248102017-03-16 08:48:51 +010030 theme: mirantis
31 bind:
32 host: 192.168.0.10:5240
33 port: 5240
34 admin:
35 username: exampleuser
36 password: examplepassword
37 email: email@example.com
38 database:
39 engine: null
40 host: localhost
41 name: maasdb
42 password: qwqwqw
43 username: maas
44 enabled: true
45 user: mirantis
46 token: "89EgtWkX45ddjMYpuL:SqVjxFG87Dr6kVf4Wp:5WLfbUgmm9XQtJxm3V2LUUy7bpCmqmnk"
47 fabrics:
azvyagintsevf3515c82018-06-26 18:59:05 +030048 fabric1:
49 name: 'tf2'
azvyagintsev06b71e72017-11-08 17:11:07 +020050 description: "Test fabric"
azvyagintsevf3515c82018-06-26 18:59:05 +030051 fabric2:
52 name: 'tf2'
azvyagintsev06b71e72017-11-08 17:11:07 +020053 description: "Test fabric2"
azvyagintsevf3515c82018-06-26 18:59:05 +030054 deploy_network:
55 name: 'deploy_network'
56 description: Fabric for deploy_network
57 vlans:
58 0:
59 name: 'vlan 0'
60 description: Deploy VLAN
Petr Ruzicka80471852018-07-13 14:08:27 +020061 mtu: 1500
azvyagintsevf3515c82018-06-26 18:59:05 +030062 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"
azvyagintsev87e68362018-07-23 09:21:38 +020081 type: reserved
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
azvyagintsev6543ec82018-11-01 23:45:09 +0200140 # power_password: bmc_password # Old format,please use new one
141 power_pass: 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
azvyagintsev6543ec82018-11-01 23:45:09 +0200157 # power_password: bmc_password # Old format,please use new one
158 power_pass: bmc_password
azvyagintsev06b71e72017-11-08 17:11:07 +0200159 #Optional (for legacy HW)
160 power_driver: LAN
Maciej Relewicz37b12a22017-04-25 15:23:16 +0200161 distro_series: xenial
162 hwe_kernel: hwe-16.04
Petr Ruzicka610f2852018-08-22 15:05:52 +0200163 virsh_example:
164 pxe_interface_mac: "52:54:00:00:01:01"
165 interfaces:
166 nic01:
167 type: eth
168 name: eth0
169 mac: "52:54:00:00:01:01"
170 subnet: "${maas:region:subnets:deploy_network:name}"
171 mode: "dhcp"
172 power_parameters:
173 power_type: virsh
174 power_address: "qemu+tcp://my-kvm-node-hostname/system"
175 power_id: "kvm01-pxe01"
Damian Szelugaa8248102017-03-16 08:48:51 +0100176 devices:
177 machine1-ipmi:
178 interface:
179 ip_address: 192.168.10.10
180 subnet: cidr:192.168.10.0/24
181 mac: '66:55:44:33:22:11'
Damian Szeluga336ff2e2017-03-30 11:19:34 +0200182 commissioning_scripts:
azvyagintsevec61dd62017-11-16 19:12:05 +0200183 00-maas-05-simplify-network-interfaces: /etc/maas/files/commisioning_scripts/00-maas-05-simplify-network-interfaces
Damian Szeluga336ff2e2017-03-30 11:19:34 +0200184 maas_config:
azvyagintsev6913e5e2018-07-05 11:42:53 +0300185 # domain: mydomain.local # This function broken
Damian Szeluga336ff2e2017-03-30 11:19:34 +0200186 http_proxy: http://192.168.0.10:3142
187 commissioning_distro_series: xenial
188 default_distro_series: xenial
189 default_osystem: 'ubuntu'
190 default_storage_layout: lvm
191 disk_erase_with_secure_erase: true
192 dnssec_validation: 'no'
193 enable_third_party_drivers: true
194 maas_name: cfg01
195 network_discovery: 'enabled'
196 active_discovery_interval: '600'
197 ntp_external_only: true
198 ntp_servers: 10.10.11.23 10.10.11.24
199 upstream_dns: 192.168.12.13
200 enable_http_proxy: true
201 default_min_hwe_kernel: ''
202 sshprefs:
azvyagintsev06b71e72017-11-08 17:11:07 +0200203 - 'ssh-rsa ASD.........dfsadf blah@blah'
Ondrej Smola9af2b082016-08-25 17:37:29 +0200204
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300205Update VLAN:
Pavel Cizinsky8dd85b52018-06-18 21:40:13 +0200206
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300207.. note:: Vid 0 has default name untagged in the MaaS UI.
Pavel Cizinsky0995e8f2018-05-04 17:10:37 +0200208
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
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300224Create disk schema per machine via ``maas/client.sls`` with
225default lvm schema + default values.
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100226
Maria Zlatkova3e88fd72018-08-08 10:51:29 +0300227.. note:: This should be used mostly for custom root
228 partitioning and RAID configuration. For
229 not-root partitions, use ``salt-formula-linux``.
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100230
231.. code-block:: yaml
232
233 maas:
234 region:
235 machines:
236 server1:
237 disk_layout:
238 type: lvm
239 root_size: 20G
240 root_device: vda
241 volume_group: vg1
242 volume_name: root
243 volume_size: 8
244 bootable_device: vda
245
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300246FLAT layout with custom root size:
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100247
248.. code-block:: yaml
249
250 maas:
251 region:
252 machines:
253 server2:
254 disk_layout:
255 type: flat
256 root_size: 20
257 physical_device: vda
258 bootable_device: vda
259
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300260Size specification with ``%`` char used is not yet supported.
Petr Michalec16cc5c92018-05-17 09:56:35 +0200261
262.. code-block:: yaml
azvyagintsev80f9da72018-06-01 18:01:45 +0300263
Petr Michalec16cc5c92018-05-17 09:56:35 +0200264 maas:
265 region:
266 machines:
267 server3:
268 disk_layout:
269 type: flat
270 bootable_device: sda
271 disk:
272 sda:
273 type: physical
274 partition_schema:
275 part1:
276 size: 100%
277 type: ext4
278 mount: '/'
279
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300280Define more complex layout:
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100281
282.. code-block:: yaml
283
284 maas:
285 region:
286 machines:
287 server3:
288 disk_layout:
azvyagintsevbca1f462018-05-25 19:06:46 +0300289 type: custom
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100290 bootable_device: vda
291 disk:
292 vda:
293 type: physical
294 partition_schema:
295 part1:
296 size: 10G
297 type: ext4
298 mount: '/'
299 part2:
300 size: 2G
Serhii Lystopad6f2fca92020-05-17 19:32:01 +0300301 mount: '/var/tmp'
302 mount_options: defaults,nodev,noexec,nosuid
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100303 part3:
304 size: 3G
305 vdc:
306 type: physical
307 partition_schema:
308 part1:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200309 size: 100G
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100310 vdd:
311 type: physical
312 partition_schema:
313 part1:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200314 size: 100G
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100315 raid0:
316 type: raid
317 level: 10
318 devices:
319 - vde
320 - vdf
321 partition_schema:
322 part1:
323 size: 10G
324 part2:
325 size: 2G
326 part3:
327 size: 3G
328 raid1:
329 type: raid
330 level: 1
331 partitions:
332 - vdc-part1
333 - vdd-part1
334 volume_group2:
335 type: lvm
336 devices:
337 - raid1
338 volume:
339 tmp:
340 size: 5G
Ondrej Smola47b56752018-03-06 15:38:27 +0100341 type: ext4
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100342 mount: '/tmp'
Serhii Lystopad6f2fca92020-05-17 19:32:01 +0300343 mount_options: defaults,nodev,noexec,nosuid
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100344 log:
345 size: 7G
Ondrej Smola47b56752018-03-06 15:38:27 +0100346 type: ext4
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100347 mount: '/var/log'
azvyagintsev7605a662017-11-03 19:05:04 +0200348
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300349Raid setup, 4x HDD:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200350
351.. code-block:: yaml
352
353 maas:
354 region:
355 machines:
356 serverWithRaidExample:
357 disk_layout:
azvyagintsevbca1f462018-05-25 19:06:46 +0300358 type: custom
359 bootable_device: sda
Petr Michalec16cc5c92018-05-17 09:56:35 +0200360 disk:
361 md0:
362 type: raid
363 level: 1
364 devices:
365 - sda
366 - sdb
367 partition_schema:
368 part1:
369 size: 230G
370 type: ext4
371 mount: /
372 md1:
373 type: raid
374 level: 1
375 devices:
376 - sdc
377 - sdd
378 partition_schema:
379 part1:
380 size: 1890G
381 type: ext4
382 mount: /var/lib/libvirt
383
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300384Raid + LVM setup, 2xSSD + 2xHDD:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200385
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300386.. note:: This setup lacks the ability run state twice,
387 as of now when ``disk_partition_present`` is called,
388 it tries blindly to delete the partition and then
389 recreated. That fails as MAAS rejects remove
390 partition used in RAID/LVM.
Petr Michalec16cc5c92018-05-17 09:56:35 +0200391
392.. code-block:: yaml
393
394 maas:
395 region:
396 machines:
397 serverWithRaidExample2:
398 disk_layout:
azvyagintsevbca1f462018-05-25 19:06:46 +0300399 type: custom
Petr Michalec16cc5c92018-05-17 09:56:35 +0200400 #bootable_device: vgssd-root
401 disk:
402 sda: &maas_disk_physical_ssd
403 type: physical
404 partition_schema:
405 part1:
406 size: 239G
407 sdb: *maas_disk_physical_ssd
408 sdc: &maas_disk_physical_hdd
409 type: physical
410 partition_schema:
411 part1:
412 size: 1990G
413 sdd: *maas_disk_physical_hdd
414 md0:
415 type: raid
416 level: 1
417 partitions:
418 - sda-part1
419 - sdb-part1
420 md1:
421 type: raid
422 level: 1
423 partitions:
424 - sdc-part1
425 - sdd-part1
426 vgssd:
427 type: lvm
428 devices:
429 - md0
430 volume:
431 root:
432 size: 230G
433 type: ext4
434 mount: '/'
435 vghdd:
436 type: lvm
437 devices:
438 - md1
439 volume:
440 libvirt:
441 size: 1800G
442 type: ext4
443 mount: '/var/lib/libvirt'
444
azvyagintsevd786e5f2018-11-06 20:57:24 +0200445
446LVM setup using partition
447
448
449.. code-block:: yaml
450
451
452 maas:
453 region:
454 machines:
455 serverWithLvmExample3:
456 disk_layout:
457 type: custom
458 bootable_device: sda
459 disk:
460 sda:
461 type: physical
462 partition_schema:
463 part1:
464 size: 50G
465 part2:
466 mount: /var/lib/libvirt/images/
467 size: 10G
468 type: ext4
469 vg0:
470 partitions:
471 - sda-part1
472 type: lvm
473 volume:
474 root:
475 mount: /
476 size: 40G
477 type: ext4
478
479
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300480Setup image mirror (Maas boot resources):
Jiri Broulike30a60f2018-04-09 21:15:10 +0200481
482.. code-block:: yaml
483
484 maas:
485 mirror:
486 enabled: true
487 image:
azvyagintsev80f9da72018-06-01 18:01:45 +0300488 sections:
489 bootloaders:
490 keyring: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
491 upstream: http://images.maas.io/ephemeral-v3/daily/
492 local_dir: /var/www/html/maas/images/ephemeral-v3/daily
493 count: 1
494 # i386 need for pxe
495 filters: ['arch~(i386|amd64)', 'os~(grub*|pxelinux)']
Jiri Broulike30a60f2018-04-09 21:15:10 +0200496 xenial:
azvyagintsev80f9da72018-06-01 18:01:45 +0300497 keyring: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
498 upstream: http://images.maas.io/ephemeral-v3/daily/
499 local_dir: /var/www/html/maas/images/ephemeral-v3/daily
500 count: 1
501 filters: ['release~(xenial)', 'arch~(amd64)', 'subarch~(generic|hwe-16.04$|ga-16.04)']
Jiri Broulike30a60f2018-04-09 21:15:10 +0200502 count: 1
503
azvyagintseva1afa852018-11-19 20:45:18 +0200504Usage of local deb repos and curtin-based variables.
505
506Dict of variables ``curtin_vars:amd64:xenial: `` format, which will be passed only to:
507``/etc/maas/preseeds/curtin_userdata_amd64_generic_xenial`` accordingly.
508
Richard Felklce118a22017-09-13 11:09:12 +0200509
510.. code-block:: yaml
azvyagintsev7605a662017-11-03 19:05:04 +0200511
Richard Felklce118a22017-09-13 11:09:12 +0200512 maas:
513 cluster:
514 enabled: true
515 region:
516 port: 80
517 host: localhost
518 saltstack_repo_key: |
519 -----BEGIN PGP PUBLIC KEY BLOCK-----
520 Version: GnuPG v2
521
522 mQENBFOpvpgBCADkP656H41i8fpplEEB8IeLhugyC2rTEwwSclb8tQNYtUiGdna9
azvyagintsev06b71e72017-11-08 17:11:07 +0200523 .....
Richard Felklce118a22017-09-13 11:09:12 +0200524 fuBmScum8uQTrEF5+Um5zkwC7EXTdH1co/+/V/fpOtxIg4XO4kcugZefVm5ERfVS
525 MA==
526 =dtMN
527 -----END PGP PUBLIC KEY BLOCK-----
azvyagintseva80fdfb2018-07-16 22:34:45 +0300528 saltstack_repo_xenial: "deb [arch=amd64] http://${_param:local_repo_url}/ubuntu-xenial stable salt"
529 saltstack_repo_trusty: "deb [arch=amd64] http://${_param:local_repo_url}/ubuntu-trusty stable salt"
azvyagintseva1afa852018-11-19 20:45:18 +0200530 curtin_vars:
531 amd64:
532 xenial:
533 # List of packages, to be installed directly in curtin stage.
azvyagintsev05393f62018-11-25 11:15:10 +0200534 extra_pkgs:
535 enabled: true
536 pkgs: [ "linux-headers-generic-hwe-16.04", "linux-image-extra-virtual-hwe-16.04" ]
azvyagintseva1afa852018-11-19 20:45:18 +0200537 # exact kernel pkgs name, to be passed into curtin stage.
azvyagintsev05393f62018-11-25 11:15:10 +0200538 kernel_package:
539 enabled: true
540 value 'linux-image-virtual-hwe-16.04'
Dzmitry Stremkouskicfd12fe2021-05-05 13:19:36 +0300541 # disable cloud-init rootfs resize to prserve disk size configured by MAAS
542 rootfs_resize:
543 disabled: true
Richard Felklce118a22017-09-13 11:09:12 +0200544
Ondrej Smola9af2b082016-08-25 17:37:29 +0200545Single MAAS cluster service [multiple racks]
546
547.. code-block:: yaml
548
549 maas:
550 cluster:
551 enabled: true
Jakub Pavlikf43512b2016-08-30 10:25:42 +0200552 role: master/slave
Ondrej Smola9af2b082016-08-25 17:37:29 +0200553
azvyagintsev7605a662017-11-03 19:05:04 +0200554.. code-block:: yaml
555
556 maas:
557 cluster:
558 enabled: true
559 role: master/slave
560
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300561MAAS region service with backup data:
Martin Polreich0764b762017-11-20 14:08:30 +0100562
563.. code-block:: yaml
azvyagintsev80f9da72018-06-01 18:01:45 +0300564
Martin Polreich0764b762017-11-20 14:08:30 +0100565 maas:
566 region:
567 database:
568 initial_data:
569 source: cfg01.local
570 host: 192.168.0.11
571
azvyagintsev6543ec82018-11-01 23:45:09 +0200572MAAS service power_parameters defintion with OpenStack Nova power_type:
573
574.. code-block:: yaml
575
576 maas:
577 region:
578 machines:
579 cmp1:
580 power_type: nova
581 power_parameters: # old style, deprecated
582 power_nova_id: hostuuid
583 power_os_tenantname: tenant
584 power_os_username: user
585 power_os_password: password
586 power_os_authurl: http://url
587
588
589.. code-block:: yaml
590
591 maas:
592 region:
593 machines:
594 cmp1:
595 power_type: nova
596 power_parameters: # new style
597 nova_id: hostuuid
598 os_tenantname: tenant
599 os_username: user
600 os_password: password
601 os_authurl: http://url
602
Dzmitry Stremkouskid95bd2e2018-12-03 17:35:46 +0100603
604Ext pillar from MAAS address pool:
605==================================
606
607Set up salt master:
608
609.. code-block:: yaml
610
611 salt:
612 master:
613 ext_pillars:
614 1:
615 module: cmd_json
616 params: /usr/share/salt-formulas/env/_modules/maas-IPAM.py --address_pool ${salt:master:pillar:data_dir}/classes/cluster/${_param:cluster_name}/infra/address_pool.yml
617
618.. code-block:: bash
619
620 salt-call state.apply salt.master
621 salt '*' saltutil.refresh_pillar
622
623Update infra/address_pool.yml:
624
625.. code-block:: yaml
626
627 parameters:
628 address_pool:
629 external:
630 dns_server01: 8.8.8.8
631 dns_server02: 8.8.4.4
632 upstream_ntp_server: 193.27.208.100
633 remote_rsyslog_host: 127.0.0.3
634 deploy_network:
635 address: 192.168.0.0
636 netmask: 255.255.255.0
637 gateway: 192.168.0.1
638 prefix: 24
639 vlan: 0
640 # Static reservation which interfere with maas reserve pool
641 reserved:
642 cmp001_deploy_address: 192.168.0.101
643 cmp002_deploy_address: 192.168.0.102
644 infra_config_deploy_address: 192.168.0.253
645 infra_kvm_node01_deploy_address: 192.168.0.241
646 infra_kvm_node02_deploy_address: 192.168.0.242
647 infra_kvm_node03_deploy_address: 192.168.0.243
648 infra_kvm_node04_deploy_address: 192.168.0.244
649 infra_kvm_node05_deploy_address: 192.168.0.245
650 infra_kvm_node06_deploy_address: 192.168.0.246
651 ldap_ip_address: 192.168.0.249
652 pool:
653 # Static reservation out of maas reserved pool
654 aptly_server_deploy_address: 192.168.0.252
655 # Dynamic serialization
656 cicd_control_node01_deploy_address: dummy
657 cicd_control_node02_deploy_address: dummy
658 cicd_control_node03_deploy_address: dummy
659 # Release IP address
660 openstack_share_node02_proxy_address: ""
661 cluster_networks:
662 deploy_network:
663 name: 'deploy_network'
664 cidr: ${address_pool:deploy_network:address}/${address_pool:deploy_network:prefix}
665 fabric: deploy_fabric
666 vlan: ${address_pool:deploy_network:vlan}
667 gateway_ip: ${address_pool:deploy_network:gateway}
668 ipranges:
669 1:
670 start: 192.168.0.30
671 end: 192.168.0.80
672 type: dynamic
673 comment: 'dynamic range'
674 2:
675 start: 192.168.0.1
676 end: 192.168.0.29
677 type: reserved
678 comment: 'infra reserve'
679 control_network:
680 name: 'control_network'
681 cidr: ${address_pool:control_network:address}/${address_pool:control_network:prefix}
682 fabric: control_fabric
683 vlan: ${address_pool:control_network:vlan}
684 gateway_ip: ${address_pool:control_network:address}
685
686
687Update maas.yml:
688
689.. code-block:: yaml
690
691 maas:
692 region:
693 fabrics:
694 deploy_fabric:
695 name: ${cluster_networks:deploy_network:fabric}
696 description: 'Fabric for deploy_network'
697 vlans:
698 0:
699 name: 'lan 0'
700 description: Deploy VLAN
701 dhcp: true
702 primary_rack: "${linux:network:hostname}"
703 control_fabric:
704 name: 'control_fabric'
705 description: 'Fabric for control_network'
706 vlans:
707 0:
708 name: ${cluster_networks:control_network:fabric}
709 description: Control VLAN
710 dhcp: false
711 primary_rack: "${linux:network:hostname}"
712 mesh_fabric:
713 name: ${cluster_networks:mesh_network:fabric}
714 description: 'Fabric for mesh_network'
715 vlans:
716 0:
717 name: 'mesh_network'
718 description: Mesh VLAN
719 dhcp: false
720 primary_rack: "${linux:network:hostname}"
721 subnets:
722 deploy_network: ${cluster_networks:deploy_network}
723 control_network: ${cluster_networks:control_network}
724 mesh_network: ${cluster_networks:mesh_network}
725 proxy_network: ${cluster_networks:proxy_network}
726
727
728Populate maas with networks:
729
730.. code-block:: bash
731
732 salt-call state.apply maas.region
733
734Serialize ip addresses using maas network pools:
735
736.. code-block:: bash
737
738 salt-call maasng.sync_address_pool
739
740Verify pillar override works:
741
742.. code-block:: bash
743
744 salt-call pillar.get address_pool:deploy_network:pool:openstack_share_node02_deploy_address
745
746 # Sample output:
747 # local:
748 # 192.168.0.81
749
750
Petr Michalec8a0d52e2018-05-30 16:22:56 +0200751Test pillars
752==============
753
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300754Mind the PostgreSQL and rsyslog ``.sls``. Database and
755syslog service are required for MAAS to properly install
756and work.
Petr Michalec8a0d52e2018-05-30 16:22:56 +0200757
Pavel Cizinskya5469f12018-12-12 12:02:29 +0100758* https://gerrit.mcp.mirantis.com/salt-formulas/rsyslog/tree/master/tests/pillar
Petr Michalec8a0d52e2018-05-30 16:22:56 +0200759
760
azvyagintsev7605a662017-11-03 19:05:04 +0200761Module function's example:
762==========================
763
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300764Wait for status of selected machine's:
azvyagintsev7605a662017-11-03 19:05:04 +0200765
766.. code-block:: bash
767
768 > cat maas/machines/wait_for_machines_ready.sls
769
770 ...
771
772 wait_for_machines_ready:
773 module.run:
774 - name: maas.wait_for_machine_status
775 - kwargs:
776 machines:
777 - kvm01
778 - kvm02
Alexandru Avadanii4fa108e2018-09-23 03:57:27 +0200779 timeout: {{ region.timeout.ready }}
780 attempts: {{ region.timeout.attempts }}
azvyagintsev7605a662017-11-03 19:05:04 +0200781 req_status: "Ready"
782 - require:
783 - cmd: maas_login_admin
784 ...
785
Alexandru Avadanii4fa108e2018-09-23 03:57:27 +0200786The timeout setting is taken from the reclass pillar data.
787If the pillar data is not defined, it will use the default value.
788
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300789If module run w/\o any extra paremeters,
790``wait_for_machines_ready`` will wait for defined in salt
791machines. In this case, it is usefull to skip some machines:
azvyagintsev7605a662017-11-03 19:05:04 +0200792
793.. code-block:: bash
794
795 > cat maas/machines/wait_for_machines_deployed.sls
796
797 ...
798
799 wait_for_machines_ready:
800 module.run:
801 - name: maas.wait_for_machine_status
802 - kwargs:
Alexandru Avadanii4fa108e2018-09-23 03:57:27 +0200803 timeout: {{ region.timeout.deployed }}
804 attempts: {{ region.timeout.attempts }}
Michael Polenchuke438bd32017-11-09 20:42:42 +0400805 req_status: "Deployed"
azvyagintsev7605a662017-11-03 19:05:04 +0200806 ignore_machines:
807 - kvm01 # in case it's broken or whatever
808 - require:
809 - cmd: maas_login_admin
810 ...
811
Martin Polreichfc971152019-10-30 13:01:50 +0100812It is also possible to skip all the machines which are already in
813the "Deployed" state. This is especially useful when you are adding
814new nodes and you don't want to check the already deployed ones.
815This can be enabled by setting in the ``ignore_deployed_machines``
816parameter to ``true`` in reclass.
817
818.. code-block:: bash
819
820 ...
821
822 maas:
823 region:
824 ignore_deployed_machines: true
825 ...
826
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300827List of available ``req_status`` defined in global variable:
azvyagintsev06b71e72017-11-08 17:11:07 +0200828
829.. code-block:: python
830
831 STATUS_NAME_DICT = dict([
832 (0, 'New'), (1, 'Commissioning'), (2, 'Failed commissioning'),
833 (3, 'Missing'), (4, 'Ready'), (5, 'Reserved'), (10, 'Allocated'),
834 (9, 'Deploying'), (6, 'Deployed'), (7, 'Retired'), (8, 'Broken'),
835 (11, 'Failed deployment'), (12, 'Releasing'),
836 (13, 'Releasing failed'), (14, 'Disk erasing'),
837 (15, 'Failed disk erasing')])
azvyagintsev7605a662017-11-03 19:05:04 +0200838
Ales Komarekef982692016-02-21 14:56:07 +0100839Read more
840=========
841
Roald Nefsc86d84a2017-10-12 21:19:50 +0200842* https://maas.io/