blob: 57ac7257c46ce8abd993518c255333d229f37c41 [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'
Richard Felklce118a22017-09-13 11:09:12 +0200541
Ondrej Smola9af2b082016-08-25 17:37:29 +0200542Single MAAS cluster service [multiple racks]
543
544.. code-block:: yaml
545
546 maas:
547 cluster:
548 enabled: true
Jakub Pavlikf43512b2016-08-30 10:25:42 +0200549 role: master/slave
Ondrej Smola9af2b082016-08-25 17:37:29 +0200550
azvyagintsev7605a662017-11-03 19:05:04 +0200551.. code-block:: yaml
552
553 maas:
554 cluster:
555 enabled: true
556 role: master/slave
557
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300558MAAS region service with backup data:
Martin Polreich0764b762017-11-20 14:08:30 +0100559
560.. code-block:: yaml
azvyagintsev80f9da72018-06-01 18:01:45 +0300561
Martin Polreich0764b762017-11-20 14:08:30 +0100562 maas:
563 region:
564 database:
565 initial_data:
566 source: cfg01.local
567 host: 192.168.0.11
568
azvyagintsev6543ec82018-11-01 23:45:09 +0200569MAAS service power_parameters defintion with OpenStack Nova power_type:
570
571.. code-block:: yaml
572
573 maas:
574 region:
575 machines:
576 cmp1:
577 power_type: nova
578 power_parameters: # old style, deprecated
579 power_nova_id: hostuuid
580 power_os_tenantname: tenant
581 power_os_username: user
582 power_os_password: password
583 power_os_authurl: http://url
584
585
586.. code-block:: yaml
587
588 maas:
589 region:
590 machines:
591 cmp1:
592 power_type: nova
593 power_parameters: # new style
594 nova_id: hostuuid
595 os_tenantname: tenant
596 os_username: user
597 os_password: password
598 os_authurl: http://url
599
Dzmitry Stremkouskid95bd2e2018-12-03 17:35:46 +0100600
601Ext pillar from MAAS address pool:
602==================================
603
604Set up salt master:
605
606.. code-block:: yaml
607
608 salt:
609 master:
610 ext_pillars:
611 1:
612 module: cmd_json
613 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
614
615.. code-block:: bash
616
617 salt-call state.apply salt.master
618 salt '*' saltutil.refresh_pillar
619
620Update infra/address_pool.yml:
621
622.. code-block:: yaml
623
624 parameters:
625 address_pool:
626 external:
627 dns_server01: 8.8.8.8
628 dns_server02: 8.8.4.4
629 upstream_ntp_server: 193.27.208.100
630 remote_rsyslog_host: 127.0.0.3
631 deploy_network:
632 address: 192.168.0.0
633 netmask: 255.255.255.0
634 gateway: 192.168.0.1
635 prefix: 24
636 vlan: 0
637 # Static reservation which interfere with maas reserve pool
638 reserved:
639 cmp001_deploy_address: 192.168.0.101
640 cmp002_deploy_address: 192.168.0.102
641 infra_config_deploy_address: 192.168.0.253
642 infra_kvm_node01_deploy_address: 192.168.0.241
643 infra_kvm_node02_deploy_address: 192.168.0.242
644 infra_kvm_node03_deploy_address: 192.168.0.243
645 infra_kvm_node04_deploy_address: 192.168.0.244
646 infra_kvm_node05_deploy_address: 192.168.0.245
647 infra_kvm_node06_deploy_address: 192.168.0.246
648 ldap_ip_address: 192.168.0.249
649 pool:
650 # Static reservation out of maas reserved pool
651 aptly_server_deploy_address: 192.168.0.252
652 # Dynamic serialization
653 cicd_control_node01_deploy_address: dummy
654 cicd_control_node02_deploy_address: dummy
655 cicd_control_node03_deploy_address: dummy
656 # Release IP address
657 openstack_share_node02_proxy_address: ""
658 cluster_networks:
659 deploy_network:
660 name: 'deploy_network'
661 cidr: ${address_pool:deploy_network:address}/${address_pool:deploy_network:prefix}
662 fabric: deploy_fabric
663 vlan: ${address_pool:deploy_network:vlan}
664 gateway_ip: ${address_pool:deploy_network:gateway}
665 ipranges:
666 1:
667 start: 192.168.0.30
668 end: 192.168.0.80
669 type: dynamic
670 comment: 'dynamic range'
671 2:
672 start: 192.168.0.1
673 end: 192.168.0.29
674 type: reserved
675 comment: 'infra reserve'
676 control_network:
677 name: 'control_network'
678 cidr: ${address_pool:control_network:address}/${address_pool:control_network:prefix}
679 fabric: control_fabric
680 vlan: ${address_pool:control_network:vlan}
681 gateway_ip: ${address_pool:control_network:address}
682
683
684Update maas.yml:
685
686.. code-block:: yaml
687
688 maas:
689 region:
690 fabrics:
691 deploy_fabric:
692 name: ${cluster_networks:deploy_network:fabric}
693 description: 'Fabric for deploy_network'
694 vlans:
695 0:
696 name: 'lan 0'
697 description: Deploy VLAN
698 dhcp: true
699 primary_rack: "${linux:network:hostname}"
700 control_fabric:
701 name: 'control_fabric'
702 description: 'Fabric for control_network'
703 vlans:
704 0:
705 name: ${cluster_networks:control_network:fabric}
706 description: Control VLAN
707 dhcp: false
708 primary_rack: "${linux:network:hostname}"
709 mesh_fabric:
710 name: ${cluster_networks:mesh_network:fabric}
711 description: 'Fabric for mesh_network'
712 vlans:
713 0:
714 name: 'mesh_network'
715 description: Mesh VLAN
716 dhcp: false
717 primary_rack: "${linux:network:hostname}"
718 subnets:
719 deploy_network: ${cluster_networks:deploy_network}
720 control_network: ${cluster_networks:control_network}
721 mesh_network: ${cluster_networks:mesh_network}
722 proxy_network: ${cluster_networks:proxy_network}
723
724
725Populate maas with networks:
726
727.. code-block:: bash
728
729 salt-call state.apply maas.region
730
731Serialize ip addresses using maas network pools:
732
733.. code-block:: bash
734
735 salt-call maasng.sync_address_pool
736
737Verify pillar override works:
738
739.. code-block:: bash
740
741 salt-call pillar.get address_pool:deploy_network:pool:openstack_share_node02_deploy_address
742
743 # Sample output:
744 # local:
745 # 192.168.0.81
746
747
Petr Michalec8a0d52e2018-05-30 16:22:56 +0200748Test pillars
749==============
750
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300751Mind the PostgreSQL and rsyslog ``.sls``. Database and
752syslog service are required for MAAS to properly install
753and work.
Petr Michalec8a0d52e2018-05-30 16:22:56 +0200754
Pavel Cizinskya5469f12018-12-12 12:02:29 +0100755* https://gerrit.mcp.mirantis.com/salt-formulas/rsyslog/tree/master/tests/pillar
Petr Michalec8a0d52e2018-05-30 16:22:56 +0200756
757
azvyagintsev7605a662017-11-03 19:05:04 +0200758Module function's example:
759==========================
760
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300761Wait for status of selected machine's:
azvyagintsev7605a662017-11-03 19:05:04 +0200762
763.. code-block:: bash
764
765 > cat maas/machines/wait_for_machines_ready.sls
766
767 ...
768
769 wait_for_machines_ready:
770 module.run:
771 - name: maas.wait_for_machine_status
772 - kwargs:
773 machines:
774 - kvm01
775 - kvm02
Alexandru Avadanii4fa108e2018-09-23 03:57:27 +0200776 timeout: {{ region.timeout.ready }}
777 attempts: {{ region.timeout.attempts }}
azvyagintsev7605a662017-11-03 19:05:04 +0200778 req_status: "Ready"
779 - require:
780 - cmd: maas_login_admin
781 ...
782
Alexandru Avadanii4fa108e2018-09-23 03:57:27 +0200783The timeout setting is taken from the reclass pillar data.
784If the pillar data is not defined, it will use the default value.
785
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300786If module run w/\o any extra paremeters,
787``wait_for_machines_ready`` will wait for defined in salt
788machines. In this case, it is usefull to skip some machines:
azvyagintsev7605a662017-11-03 19:05:04 +0200789
790.. code-block:: bash
791
792 > cat maas/machines/wait_for_machines_deployed.sls
793
794 ...
795
796 wait_for_machines_ready:
797 module.run:
798 - name: maas.wait_for_machine_status
799 - kwargs:
Alexandru Avadanii4fa108e2018-09-23 03:57:27 +0200800 timeout: {{ region.timeout.deployed }}
801 attempts: {{ region.timeout.attempts }}
Michael Polenchuke438bd32017-11-09 20:42:42 +0400802 req_status: "Deployed"
azvyagintsev7605a662017-11-03 19:05:04 +0200803 ignore_machines:
804 - kvm01 # in case it's broken or whatever
805 - require:
806 - cmd: maas_login_admin
807 ...
808
Martin Polreichfc971152019-10-30 13:01:50 +0100809It is also possible to skip all the machines which are already in
810the "Deployed" state. This is especially useful when you are adding
811new nodes and you don't want to check the already deployed ones.
812This can be enabled by setting in the ``ignore_deployed_machines``
813parameter to ``true`` in reclass.
814
815.. code-block:: bash
816
817 ...
818
819 maas:
820 region:
821 ignore_deployed_machines: true
822 ...
823
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300824List of available ``req_status`` defined in global variable:
azvyagintsev06b71e72017-11-08 17:11:07 +0200825
826.. code-block:: python
827
828 STATUS_NAME_DICT = dict([
829 (0, 'New'), (1, 'Commissioning'), (2, 'Failed commissioning'),
830 (3, 'Missing'), (4, 'Ready'), (5, 'Reserved'), (10, 'Allocated'),
831 (9, 'Deploying'), (6, 'Deployed'), (7, 'Retired'), (8, 'Broken'),
832 (11, 'Failed deployment'), (12, 'Releasing'),
833 (13, 'Releasing failed'), (14, 'Disk erasing'),
834 (15, 'Failed disk erasing')])
azvyagintsev7605a662017-11-03 19:05:04 +0200835
Ales Komarekef982692016-02-21 14:56:07 +0100836Read more
837=========
838
Roald Nefsc86d84a2017-10-12 21:19:50 +0200839* https://maas.io/