blob: bc963e8e66969786b7f1fceb50f5a9d163716612 [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
Stanislav Riazanov38b01862019-01-21 19:27:06 +040031 ntp:
32 server_1:
33 enabled: true
34 host: pool.ntp.org
Damian Szelugaa8248102017-03-16 08:48:51 +010035 bind:
36 host: 192.168.0.10:5240
37 port: 5240
38 admin:
39 username: exampleuser
40 password: examplepassword
41 email: email@example.com
42 database:
43 engine: null
44 host: localhost
45 name: maasdb
46 password: qwqwqw
47 username: maas
48 enabled: true
49 user: mirantis
50 token: "89EgtWkX45ddjMYpuL:SqVjxFG87Dr6kVf4Wp:5WLfbUgmm9XQtJxm3V2LUUy7bpCmqmnk"
51 fabrics:
azvyagintsevf3515c82018-06-26 18:59:05 +030052 fabric1:
53 name: 'tf2'
azvyagintsev06b71e72017-11-08 17:11:07 +020054 description: "Test fabric"
azvyagintsevf3515c82018-06-26 18:59:05 +030055 fabric2:
56 name: 'tf2'
azvyagintsev06b71e72017-11-08 17:11:07 +020057 description: "Test fabric2"
azvyagintsevf3515c82018-06-26 18:59:05 +030058 deploy_network:
59 name: 'deploy_network'
60 description: Fabric for deploy_network
61 vlans:
62 0:
63 name: 'vlan 0'
64 description: Deploy VLAN
Petr Ruzicka80471852018-07-13 14:08:27 +020065 mtu: 1500
azvyagintsevf3515c82018-06-26 18:59:05 +030066 dhcp: true
azvyagintsev6913e5e2018-07-05 11:42:53 +030067 # FIXME: after refactoring domain module, it should be
68 # fixed exactly for FQDN, not only 'hostname'
azvyagintsevf3515c82018-06-26 18:59:05 +030069 primary_rack: "${linux:network:hostname}"
70
Damian Szelugaa8248102017-03-16 08:48:51 +010071 subnets:
72 subnet1:
azvyagintsevf3515c82018-06-26 18:59:05 +030073 fabric: ${maas:region:fabrics:deploy_network:name}
Damian Szelugaa8248102017-03-16 08:48:51 +010074 cidr: 2.2.3.0/24
75 gateway_ip: 2.2.3.2
azvyagintsevf3515c82018-06-26 18:59:05 +030076 vlan: 150
77 ipranges:
78 1:
79 end: "2.2.3.40"
80 start: "2.2.3.20"
81 type: dynamic
82 2:
83 end: "2.2.3.250"
84 start: "2.2.3.45"
azvyagintsev87e68362018-07-23 09:21:38 +020085 type: reserved
Damian Szelugaa8248102017-03-16 08:48:51 +010086 dhcp_snippets:
87 test-snippet:
88 value: option bootfile-name "tftp://192.168.0.10/snippet";
89 description: Test snippet
90 enabled: true
91 subnet: subnet1
azvyagintsev3ff2ef12018-06-01 21:30:45 +030092 boot_sources_delete_all_others: true
Jiri Broulike30a60f2018-04-09 21:15:10 +020093 boot_sources:
azvyagintsev3ff2ef12018-06-01 21:30:45 +030094 resources_mirror:
95 url: http://images.maas.io/ephemeral-v3/
Jiri Broulike30a60f2018-04-09 21:15:10 +020096 keyring_file: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
azvyagintsev3ff2ef12018-06-01 21:30:45 +030097 boot_sources_selections:
98 xenial:
99 url: "http://images.maas.io/ephemeral-v3/" # should be same in boot_sources, or other already defined.
100 os: "ubuntu"
101 release: "xenial"
102 arches: "amd64"
103 subarches: '"*"'
104 labels: '"*"'
Damian Szelugaa8248102017-03-16 08:48:51 +0100105 package_repositories:
106 Saltstack:
107 url: http://repo.saltstack.com/apt/ubuntu/14.04/amd64/2016.3/
108 distributions:
109 - trusty
110 components:
111 - main
Damian Szelugaa8248102017-03-16 08:48:51 +0100112 arches: amd64
113 key: "-----BEGIN PGP PUBLIC KEY BLOCK-----
114 Version: GnuPG v2
Pavel Cizinsky5a6e2722016-08-31 15:58:13 +0200115
Damian Szelugaa8248102017-03-16 08:48:51 +0100116 mQENBFOpvpgBCADkP656H41i8fpplEEB8IeLhugyC2rTEwwSclb8tQNYtUiGdna9
azvyagintsev06b71e72017-11-08 17:11:07 +0200117 ......
Damian Szelugaa8248102017-03-16 08:48:51 +0100118 fuBmScum8uQTrEF5+Um5zkwC7EXTdH1co/+/V/fpOtxIg4XO4kcugZefVm5ERfVS
119 MA==
120 =dtMN
121 -----END PGP PUBLIC KEY BLOCK-----"
122 enabled: true
123 machines:
azvyagintsev06b71e72017-11-08 17:11:07 +0200124 machine1_new_schema:
125 pxe_interface_mac: "11:22:33:44:55:66" # Node will be identified by those mac
126 interfaces:
127 nic01: # could be any, used for iterate only
128 type: eth # NotImplemented
129 name: eth0 # Override default nic name. Interface to rename will be identified by mac
130 mac: "11:22:33:44:55:66"
131 mode: "static"
132 ip: "2.2.3.19" # ip should be out of reserved subnet range, but still in subnet range
133 subnet: "subnet1"
134 gateway: "2.2.3.2" # override default gateway from subnet
135 nic02:
136 type: eth # Not-implemented
137 mac: "11:22:33:44:55:78"
138 subnet: "subnet2"
139 mode: "dhcp"
Damian Szelugaa8248102017-03-16 08:48:51 +0100140 power_parameters:
141 power_type: ipmi
142 power_address: '192.168.10.10'
143 power_user: bmc_user
azvyagintsev6543ec82018-11-01 23:45:09 +0200144 # power_password: bmc_password # Old format,please use new one
145 power_pass: bmc_password
Ondrej Smola455003c2017-06-01 22:53:39 +0200146 #Optional (for legacy HW)
147 power_driver: LAN
azvyagintsev06b71e72017-11-08 17:11:07 +0200148 distro_series: xenial
149 hwe_kernel: hwe-16.04
150 machine1_old_schema:
151 interface:
152 mac: "11:22:33:44:55:88" # Node will be identified by those mac
153 mode: "static"
154 ip: "2.2.3.15"
155 subnet: "subnet1"
156 gateway: "2.2.3.2"
157 power_parameters:
158 power_type: ipmi
159 power_address: '192.168.10.10'
160 power_user: bmc_user
azvyagintsev6543ec82018-11-01 23:45:09 +0200161 # power_password: bmc_password # Old format,please use new one
162 power_pass: bmc_password
azvyagintsev06b71e72017-11-08 17:11:07 +0200163 #Optional (for legacy HW)
164 power_driver: LAN
Maciej Relewicz37b12a22017-04-25 15:23:16 +0200165 distro_series: xenial
166 hwe_kernel: hwe-16.04
Petr Ruzicka610f2852018-08-22 15:05:52 +0200167 virsh_example:
168 pxe_interface_mac: "52:54:00:00:01:01"
169 interfaces:
170 nic01:
171 type: eth
172 name: eth0
173 mac: "52:54:00:00:01:01"
174 subnet: "${maas:region:subnets:deploy_network:name}"
175 mode: "dhcp"
176 power_parameters:
177 power_type: virsh
178 power_address: "qemu+tcp://my-kvm-node-hostname/system"
179 power_id: "kvm01-pxe01"
Damian Szelugaa8248102017-03-16 08:48:51 +0100180 devices:
181 machine1-ipmi:
182 interface:
183 ip_address: 192.168.10.10
184 subnet: cidr:192.168.10.0/24
185 mac: '66:55:44:33:22:11'
Damian Szeluga336ff2e2017-03-30 11:19:34 +0200186 commissioning_scripts:
azvyagintsevec61dd62017-11-16 19:12:05 +0200187 00-maas-05-simplify-network-interfaces: /etc/maas/files/commisioning_scripts/00-maas-05-simplify-network-interfaces
Damian Szeluga336ff2e2017-03-30 11:19:34 +0200188 maas_config:
azvyagintsev6913e5e2018-07-05 11:42:53 +0300189 # domain: mydomain.local # This function broken
Damian Szeluga336ff2e2017-03-30 11:19:34 +0200190 http_proxy: http://192.168.0.10:3142
191 commissioning_distro_series: xenial
192 default_distro_series: xenial
193 default_osystem: 'ubuntu'
194 default_storage_layout: lvm
195 disk_erase_with_secure_erase: true
196 dnssec_validation: 'no'
197 enable_third_party_drivers: true
198 maas_name: cfg01
199 network_discovery: 'enabled'
200 active_discovery_interval: '600'
Damian Szeluga336ff2e2017-03-30 11:19:34 +0200201 upstream_dns: 192.168.12.13
202 enable_http_proxy: true
203 default_min_hwe_kernel: ''
204 sshprefs:
azvyagintsev06b71e72017-11-08 17:11:07 +0200205 - 'ssh-rsa ASD.........dfsadf blah@blah'
Ondrej Smola9af2b082016-08-25 17:37:29 +0200206
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300207Update VLAN:
Pavel Cizinsky8dd85b52018-06-18 21:40:13 +0200208
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300209.. note:: Vid 0 has default name untagged in the MaaS UI.
Pavel Cizinsky0995e8f2018-05-04 17:10:37 +0200210
211.. code-block:: yaml
212
213 maas:
214 region:
215 fabrics:
216 test-fabric:
217 description: "Test fabric"
218 vlan:
219 0:
220 description: "Your VLAN 0"
221 dhcp: True
222 13:
223 description: "Your VLAN 13"
224 dhcp: False
Ondrej Smola9af2b082016-08-25 17:37:29 +0200225
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300226Create disk schema per machine via ``maas/client.sls`` with
227default lvm schema + default values.
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100228
Maria Zlatkova3e88fd72018-08-08 10:51:29 +0300229.. note:: This should be used mostly for custom root
230 partitioning and RAID configuration. For
231 not-root partitions, use ``salt-formula-linux``.
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100232
233.. code-block:: yaml
234
235 maas:
236 region:
237 machines:
238 server1:
239 disk_layout:
240 type: lvm
241 root_size: 20G
242 root_device: vda
243 volume_group: vg1
244 volume_name: root
245 volume_size: 8
246 bootable_device: vda
247
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300248FLAT layout with custom root size:
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100249
250.. code-block:: yaml
251
252 maas:
253 region:
254 machines:
255 server2:
256 disk_layout:
257 type: flat
258 root_size: 20
259 physical_device: vda
260 bootable_device: vda
261
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300262Size specification with ``%`` char used is not yet supported.
Petr Michalec16cc5c92018-05-17 09:56:35 +0200263
264.. code-block:: yaml
azvyagintsev80f9da72018-06-01 18:01:45 +0300265
Petr Michalec16cc5c92018-05-17 09:56:35 +0200266 maas:
267 region:
268 machines:
269 server3:
270 disk_layout:
271 type: flat
272 bootable_device: sda
273 disk:
274 sda:
275 type: physical
276 partition_schema:
277 part1:
278 size: 100%
279 type: ext4
280 mount: '/'
281
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300282Define more complex layout:
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100283
284.. code-block:: yaml
285
286 maas:
287 region:
288 machines:
289 server3:
290 disk_layout:
azvyagintsevbca1f462018-05-25 19:06:46 +0300291 type: custom
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100292 bootable_device: vda
293 disk:
294 vda:
295 type: physical
296 partition_schema:
297 part1:
298 size: 10G
299 type: ext4
300 mount: '/'
301 part2:
302 size: 2G
Valeriy Sakharov14ccca32020-08-13 14:29:30 +0400303 mount: '/var/tmp'
304 mount_options: defaults,nodev,noexec,nosuid
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100305 part3:
306 size: 3G
307 vdc:
308 type: physical
309 partition_schema:
310 part1:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200311 size: 100G
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100312 vdd:
313 type: physical
314 partition_schema:
315 part1:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200316 size: 100G
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100317 raid0:
318 type: raid
319 level: 10
320 devices:
321 - vde
322 - vdf
323 partition_schema:
324 part1:
325 size: 10G
326 part2:
327 size: 2G
328 part3:
329 size: 3G
330 raid1:
331 type: raid
332 level: 1
333 partitions:
334 - vdc-part1
335 - vdd-part1
336 volume_group2:
337 type: lvm
338 devices:
339 - raid1
340 volume:
341 tmp:
342 size: 5G
Ondrej Smola47b56752018-03-06 15:38:27 +0100343 type: ext4
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100344 mount: '/tmp'
Valeriy Sakharov14ccca32020-08-13 14:29:30 +0400345 mount_options: defaults,nodev,noexec,nosuid
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100346 log:
347 size: 7G
Ondrej Smola47b56752018-03-06 15:38:27 +0100348 type: ext4
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100349 mount: '/var/log'
azvyagintsev7605a662017-11-03 19:05:04 +0200350
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300351Raid setup, 4x HDD:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200352
353.. code-block:: yaml
354
355 maas:
356 region:
357 machines:
358 serverWithRaidExample:
359 disk_layout:
azvyagintsevbca1f462018-05-25 19:06:46 +0300360 type: custom
361 bootable_device: sda
Petr Michalec16cc5c92018-05-17 09:56:35 +0200362 disk:
363 md0:
364 type: raid
365 level: 1
366 devices:
367 - sda
368 - sdb
369 partition_schema:
370 part1:
371 size: 230G
372 type: ext4
373 mount: /
374 md1:
375 type: raid
376 level: 1
377 devices:
378 - sdc
379 - sdd
380 partition_schema:
381 part1:
382 size: 1890G
383 type: ext4
384 mount: /var/lib/libvirt
385
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300386Raid + LVM setup, 2xSSD + 2xHDD:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200387
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300388.. note:: This setup lacks the ability run state twice,
389 as of now when ``disk_partition_present`` is called,
390 it tries blindly to delete the partition and then
391 recreated. That fails as MAAS rejects remove
392 partition used in RAID/LVM.
Petr Michalec16cc5c92018-05-17 09:56:35 +0200393
394.. code-block:: yaml
395
396 maas:
397 region:
398 machines:
399 serverWithRaidExample2:
400 disk_layout:
azvyagintsevbca1f462018-05-25 19:06:46 +0300401 type: custom
Petr Michalec16cc5c92018-05-17 09:56:35 +0200402 #bootable_device: vgssd-root
403 disk:
404 sda: &maas_disk_physical_ssd
405 type: physical
406 partition_schema:
407 part1:
408 size: 239G
409 sdb: *maas_disk_physical_ssd
410 sdc: &maas_disk_physical_hdd
411 type: physical
412 partition_schema:
413 part1:
414 size: 1990G
415 sdd: *maas_disk_physical_hdd
416 md0:
417 type: raid
418 level: 1
419 partitions:
420 - sda-part1
421 - sdb-part1
422 md1:
423 type: raid
424 level: 1
425 partitions:
426 - sdc-part1
427 - sdd-part1
428 vgssd:
429 type: lvm
430 devices:
431 - md0
432 volume:
433 root:
434 size: 230G
435 type: ext4
436 mount: '/'
437 vghdd:
438 type: lvm
439 devices:
440 - md1
441 volume:
442 libvirt:
443 size: 1800G
444 type: ext4
445 mount: '/var/lib/libvirt'
446
azvyagintsevd786e5f2018-11-06 20:57:24 +0200447
448LVM setup using partition
449
450
451.. code-block:: yaml
452
453
454 maas:
455 region:
456 machines:
457 serverWithLvmExample3:
458 disk_layout:
459 type: custom
460 bootable_device: sda
461 disk:
462 sda:
463 type: physical
464 partition_schema:
465 part1:
466 size: 50G
467 part2:
468 mount: /var/lib/libvirt/images/
469 size: 10G
470 type: ext4
471 vg0:
472 partitions:
473 - sda-part1
474 type: lvm
475 volume:
476 root:
477 mount: /
478 size: 40G
479 type: ext4
480
481
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300482Setup image mirror (Maas boot resources):
Jiri Broulike30a60f2018-04-09 21:15:10 +0200483
484.. code-block:: yaml
485
486 maas:
487 mirror:
488 enabled: true
489 image:
azvyagintsev80f9da72018-06-01 18:01:45 +0300490 sections:
491 bootloaders:
492 keyring: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
493 upstream: http://images.maas.io/ephemeral-v3/daily/
494 local_dir: /var/www/html/maas/images/ephemeral-v3/daily
495 count: 1
496 # i386 need for pxe
497 filters: ['arch~(i386|amd64)', 'os~(grub*|pxelinux)']
Jiri Broulike30a60f2018-04-09 21:15:10 +0200498 xenial:
azvyagintsev80f9da72018-06-01 18:01:45 +0300499 keyring: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
500 upstream: http://images.maas.io/ephemeral-v3/daily/
501 local_dir: /var/www/html/maas/images/ephemeral-v3/daily
502 count: 1
503 filters: ['release~(xenial)', 'arch~(amd64)', 'subarch~(generic|hwe-16.04$|ga-16.04)']
Jiri Broulike30a60f2018-04-09 21:15:10 +0200504 count: 1
505
azvyagintseva1afa852018-11-19 20:45:18 +0200506Usage of local deb repos and curtin-based variables.
507
508Dict of variables ``curtin_vars:amd64:xenial: `` format, which will be passed only to:
509``/etc/maas/preseeds/curtin_userdata_amd64_generic_xenial`` accordingly.
510
Richard Felklce118a22017-09-13 11:09:12 +0200511
512.. code-block:: yaml
azvyagintsev7605a662017-11-03 19:05:04 +0200513
Richard Felklce118a22017-09-13 11:09:12 +0200514 maas:
515 cluster:
516 enabled: true
517 region:
518 port: 80
519 host: localhost
520 saltstack_repo_key: |
521 -----BEGIN PGP PUBLIC KEY BLOCK-----
522 Version: GnuPG v2
523
524 mQENBFOpvpgBCADkP656H41i8fpplEEB8IeLhugyC2rTEwwSclb8tQNYtUiGdna9
azvyagintsev06b71e72017-11-08 17:11:07 +0200525 .....
Richard Felklce118a22017-09-13 11:09:12 +0200526 fuBmScum8uQTrEF5+Um5zkwC7EXTdH1co/+/V/fpOtxIg4XO4kcugZefVm5ERfVS
527 MA==
528 =dtMN
529 -----END PGP PUBLIC KEY BLOCK-----
azvyagintseva80fdfb2018-07-16 22:34:45 +0300530 saltstack_repo_xenial: "deb [arch=amd64] http://${_param:local_repo_url}/ubuntu-xenial stable salt"
531 saltstack_repo_trusty: "deb [arch=amd64] http://${_param:local_repo_url}/ubuntu-trusty stable salt"
azvyagintseva1afa852018-11-19 20:45:18 +0200532 curtin_vars:
533 amd64:
534 xenial:
535 # List of packages, to be installed directly in curtin stage.
azvyagintsev05393f62018-11-25 11:15:10 +0200536 extra_pkgs:
537 enabled: true
538 pkgs: [ "linux-headers-generic-hwe-16.04", "linux-image-extra-virtual-hwe-16.04" ]
azvyagintseva1afa852018-11-19 20:45:18 +0200539 # exact kernel pkgs name, to be passed into curtin stage.
azvyagintsev05393f62018-11-25 11:15:10 +0200540 kernel_package:
541 enabled: true
542 value 'linux-image-virtual-hwe-16.04'
Richard Felklce118a22017-09-13 11:09:12 +0200543
Ondrej Smola9af2b082016-08-25 17:37:29 +0200544Single MAAS cluster service [multiple racks]
545
546.. code-block:: yaml
547
548 maas:
549 cluster:
550 enabled: true
Jakub Pavlikf43512b2016-08-30 10:25:42 +0200551 role: master/slave
Ondrej Smola9af2b082016-08-25 17:37:29 +0200552
azvyagintsev7605a662017-11-03 19:05:04 +0200553.. code-block:: yaml
554
555 maas:
556 cluster:
557 enabled: true
558 role: master/slave
559
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300560MAAS region service with backup data:
Martin Polreich0764b762017-11-20 14:08:30 +0100561
562.. code-block:: yaml
azvyagintsev80f9da72018-06-01 18:01:45 +0300563
Martin Polreich0764b762017-11-20 14:08:30 +0100564 maas:
565 region:
566 database:
567 initial_data:
568 source: cfg01.local
569 host: 192.168.0.11
570
azvyagintsev6543ec82018-11-01 23:45:09 +0200571MAAS service power_parameters defintion with OpenStack Nova power_type:
572
573.. code-block:: yaml
574
575 maas:
576 region:
577 machines:
578 cmp1:
579 power_type: nova
580 power_parameters: # old style, deprecated
581 power_nova_id: hostuuid
582 power_os_tenantname: tenant
583 power_os_username: user
584 power_os_password: password
585 power_os_authurl: http://url
586
587
588.. code-block:: yaml
589
590 maas:
591 region:
592 machines:
593 cmp1:
594 power_type: nova
595 power_parameters: # new style
596 nova_id: hostuuid
597 os_tenantname: tenant
598 os_username: user
599 os_password: password
600 os_authurl: http://url
601
Dzmitry Stremkouskid95bd2e2018-12-03 17:35:46 +0100602
603Ext pillar from MAAS address pool:
604==================================
605
606Set up salt master:
607
608.. code-block:: yaml
609
610 salt:
611 master:
612 ext_pillars:
613 1:
614 module: cmd_json
615 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
616
617.. code-block:: bash
618
619 salt-call state.apply salt.master
620 salt '*' saltutil.refresh_pillar
621
622Update infra/address_pool.yml:
623
624.. code-block:: yaml
625
626 parameters:
627 address_pool:
628 external:
629 dns_server01: 8.8.8.8
630 dns_server02: 8.8.4.4
631 upstream_ntp_server: 193.27.208.100
632 remote_rsyslog_host: 127.0.0.3
633 deploy_network:
634 address: 192.168.0.0
635 netmask: 255.255.255.0
636 gateway: 192.168.0.1
637 prefix: 24
638 vlan: 0
639 # Static reservation which interfere with maas reserve pool
640 reserved:
641 cmp001_deploy_address: 192.168.0.101
642 cmp002_deploy_address: 192.168.0.102
643 infra_config_deploy_address: 192.168.0.253
644 infra_kvm_node01_deploy_address: 192.168.0.241
645 infra_kvm_node02_deploy_address: 192.168.0.242
646 infra_kvm_node03_deploy_address: 192.168.0.243
647 infra_kvm_node04_deploy_address: 192.168.0.244
648 infra_kvm_node05_deploy_address: 192.168.0.245
649 infra_kvm_node06_deploy_address: 192.168.0.246
650 ldap_ip_address: 192.168.0.249
651 pool:
652 # Static reservation out of maas reserved pool
653 aptly_server_deploy_address: 192.168.0.252
654 # Dynamic serialization
655 cicd_control_node01_deploy_address: dummy
656 cicd_control_node02_deploy_address: dummy
657 cicd_control_node03_deploy_address: dummy
658 # Release IP address
659 openstack_share_node02_proxy_address: ""
660 cluster_networks:
661 deploy_network:
662 name: 'deploy_network'
663 cidr: ${address_pool:deploy_network:address}/${address_pool:deploy_network:prefix}
664 fabric: deploy_fabric
665 vlan: ${address_pool:deploy_network:vlan}
666 gateway_ip: ${address_pool:deploy_network:gateway}
667 ipranges:
668 1:
669 start: 192.168.0.30
670 end: 192.168.0.80
671 type: dynamic
672 comment: 'dynamic range'
673 2:
674 start: 192.168.0.1
675 end: 192.168.0.29
676 type: reserved
677 comment: 'infra reserve'
678 control_network:
679 name: 'control_network'
680 cidr: ${address_pool:control_network:address}/${address_pool:control_network:prefix}
681 fabric: control_fabric
682 vlan: ${address_pool:control_network:vlan}
683 gateway_ip: ${address_pool:control_network:address}
684
685
686Update maas.yml:
687
688.. code-block:: yaml
689
690 maas:
691 region:
692 fabrics:
693 deploy_fabric:
694 name: ${cluster_networks:deploy_network:fabric}
695 description: 'Fabric for deploy_network'
696 vlans:
697 0:
698 name: 'lan 0'
699 description: Deploy VLAN
700 dhcp: true
701 primary_rack: "${linux:network:hostname}"
702 control_fabric:
703 name: 'control_fabric'
704 description: 'Fabric for control_network'
705 vlans:
706 0:
707 name: ${cluster_networks:control_network:fabric}
708 description: Control VLAN
709 dhcp: false
710 primary_rack: "${linux:network:hostname}"
711 mesh_fabric:
712 name: ${cluster_networks:mesh_network:fabric}
713 description: 'Fabric for mesh_network'
714 vlans:
715 0:
716 name: 'mesh_network'
717 description: Mesh VLAN
718 dhcp: false
719 primary_rack: "${linux:network:hostname}"
720 subnets:
721 deploy_network: ${cluster_networks:deploy_network}
722 control_network: ${cluster_networks:control_network}
723 mesh_network: ${cluster_networks:mesh_network}
724 proxy_network: ${cluster_networks:proxy_network}
725
726
727Populate maas with networks:
728
729.. code-block:: bash
730
731 salt-call state.apply maas.region
732
733Serialize ip addresses using maas network pools:
734
735.. code-block:: bash
736
737 salt-call maasng.sync_address_pool
738
739Verify pillar override works:
740
741.. code-block:: bash
742
743 salt-call pillar.get address_pool:deploy_network:pool:openstack_share_node02_deploy_address
744
745 # Sample output:
746 # local:
747 # 192.168.0.81
748
749
Petr Michalec8a0d52e2018-05-30 16:22:56 +0200750Test pillars
751==============
752
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300753Mind the PostgreSQL and rsyslog ``.sls``. Database and
754syslog service are required for MAAS to properly install
755and work.
Petr Michalec8a0d52e2018-05-30 16:22:56 +0200756
Pavel Cizinskya5469f12018-12-12 12:02:29 +0100757* https://gerrit.mcp.mirantis.com/salt-formulas/rsyslog/tree/master/tests/pillar
Petr Michalec8a0d52e2018-05-30 16:22:56 +0200758
759
azvyagintsev7605a662017-11-03 19:05:04 +0200760Module function's example:
761==========================
762
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300763Wait for status of selected machine's:
azvyagintsev7605a662017-11-03 19:05:04 +0200764
765.. code-block:: bash
766
767 > cat maas/machines/wait_for_machines_ready.sls
768
769 ...
770
771 wait_for_machines_ready:
772 module.run:
773 - name: maas.wait_for_machine_status
774 - kwargs:
775 machines:
776 - kvm01
777 - kvm02
Alexandru Avadanii3206fe72018-09-23 03:57:27 +0200778 timeout: {{ region.timeout.ready }}
779 attempts: {{ region.timeout.attempts }}
azvyagintsev7605a662017-11-03 19:05:04 +0200780 req_status: "Ready"
781 - require:
782 - cmd: maas_login_admin
783 ...
784
Alexandru Avadanii3206fe72018-09-23 03:57:27 +0200785The timeout setting is taken from the reclass pillar data.
786If the pillar data is not defined, it will use the default value.
787
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300788If module run w/\o any extra paremeters,
789``wait_for_machines_ready`` will wait for defined in salt
790machines. In this case, it is usefull to skip some machines:
azvyagintsev7605a662017-11-03 19:05:04 +0200791
792.. code-block:: bash
793
794 > cat maas/machines/wait_for_machines_deployed.sls
795
796 ...
797
798 wait_for_machines_ready:
799 module.run:
800 - name: maas.wait_for_machine_status
801 - kwargs:
Alexandru Avadanii3206fe72018-09-23 03:57:27 +0200802 timeout: {{ region.timeout.deployed }}
803 attempts: {{ region.timeout.attempts }}
Michael Polenchuke438bd32017-11-09 20:42:42 +0400804 req_status: "Deployed"
azvyagintsev7605a662017-11-03 19:05:04 +0200805 ignore_machines:
806 - kvm01 # in case it's broken or whatever
807 - require:
808 - cmd: maas_login_admin
809 ...
810
Martin Polreiche3183ad2019-10-30 13:01:50 +0100811It is also possible to skip all the machines which are already in
812the "Deployed" state. This is especially useful when you are adding
813new nodes and you don't want to check the already deployed ones.
814This can be enabled by setting in the ``ignore_deployed_machines``
815parameter to ``true`` in reclass.
816
817.. code-block:: bash
818
819 ...
820
821 maas:
822 region:
823 ignore_deployed_machines: true
824 ...
825
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300826List of available ``req_status`` defined in global variable:
azvyagintsev06b71e72017-11-08 17:11:07 +0200827
828.. code-block:: python
829
830 STATUS_NAME_DICT = dict([
831 (0, 'New'), (1, 'Commissioning'), (2, 'Failed commissioning'),
832 (3, 'Missing'), (4, 'Ready'), (5, 'Reserved'), (10, 'Allocated'),
833 (9, 'Deploying'), (6, 'Deployed'), (7, 'Retired'), (8, 'Broken'),
834 (11, 'Failed deployment'), (12, 'Releasing'),
835 (13, 'Releasing failed'), (14, 'Disk erasing'),
836 (15, 'Failed disk erasing')])
azvyagintsev7605a662017-11-03 19:05:04 +0200837
Ales Komarekef982692016-02-21 14:56:07 +0100838Read more
839=========
840
Roald Nefsc86d84a2017-10-12 21:19:50 +0200841* https://maas.io/