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