blob: 939ad53f790a73243bd723af8e8edbbae6b14898 [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
303 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'
343 log:
344 size: 7G
Ondrej Smola47b56752018-03-06 15:38:27 +0100345 type: ext4
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100346 mount: '/var/log'
azvyagintsev7605a662017-11-03 19:05:04 +0200347
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300348Raid setup, 4x HDD:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200349
350.. code-block:: yaml
351
352 maas:
353 region:
354 machines:
355 serverWithRaidExample:
356 disk_layout:
azvyagintsevbca1f462018-05-25 19:06:46 +0300357 type: custom
358 bootable_device: sda
Petr Michalec16cc5c92018-05-17 09:56:35 +0200359 disk:
360 md0:
361 type: raid
362 level: 1
363 devices:
364 - sda
365 - sdb
366 partition_schema:
367 part1:
368 size: 230G
369 type: ext4
370 mount: /
371 md1:
372 type: raid
373 level: 1
374 devices:
375 - sdc
376 - sdd
377 partition_schema:
378 part1:
379 size: 1890G
380 type: ext4
381 mount: /var/lib/libvirt
382
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300383Raid + LVM setup, 2xSSD + 2xHDD:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200384
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300385.. note:: This setup lacks the ability run state twice,
386 as of now when ``disk_partition_present`` is called,
387 it tries blindly to delete the partition and then
388 recreated. That fails as MAAS rejects remove
389 partition used in RAID/LVM.
Petr Michalec16cc5c92018-05-17 09:56:35 +0200390
391.. code-block:: yaml
392
393 maas:
394 region:
395 machines:
396 serverWithRaidExample2:
397 disk_layout:
azvyagintsevbca1f462018-05-25 19:06:46 +0300398 type: custom
Petr Michalec16cc5c92018-05-17 09:56:35 +0200399 #bootable_device: vgssd-root
400 disk:
401 sda: &maas_disk_physical_ssd
402 type: physical
403 partition_schema:
404 part1:
405 size: 239G
406 sdb: *maas_disk_physical_ssd
407 sdc: &maas_disk_physical_hdd
408 type: physical
409 partition_schema:
410 part1:
411 size: 1990G
412 sdd: *maas_disk_physical_hdd
413 md0:
414 type: raid
415 level: 1
416 partitions:
417 - sda-part1
418 - sdb-part1
419 md1:
420 type: raid
421 level: 1
422 partitions:
423 - sdc-part1
424 - sdd-part1
425 vgssd:
426 type: lvm
427 devices:
428 - md0
429 volume:
430 root:
431 size: 230G
432 type: ext4
433 mount: '/'
434 vghdd:
435 type: lvm
436 devices:
437 - md1
438 volume:
439 libvirt:
440 size: 1800G
441 type: ext4
442 mount: '/var/lib/libvirt'
443
azvyagintsevd786e5f2018-11-06 20:57:24 +0200444
445LVM setup using partition
446
447
448.. code-block:: yaml
449
450
451 maas:
452 region:
453 machines:
454 serverWithLvmExample3:
455 disk_layout:
456 type: custom
457 bootable_device: sda
458 disk:
459 sda:
460 type: physical
461 partition_schema:
462 part1:
463 size: 50G
464 part2:
465 mount: /var/lib/libvirt/images/
466 size: 10G
467 type: ext4
468 vg0:
469 partitions:
470 - sda-part1
471 type: lvm
472 volume:
473 root:
474 mount: /
475 size: 40G
476 type: ext4
477
478
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300479Setup image mirror (Maas boot resources):
Jiri Broulike30a60f2018-04-09 21:15:10 +0200480
481.. code-block:: yaml
482
483 maas:
484 mirror:
485 enabled: true
486 image:
azvyagintsev80f9da72018-06-01 18:01:45 +0300487 sections:
488 bootloaders:
489 keyring: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
490 upstream: http://images.maas.io/ephemeral-v3/daily/
491 local_dir: /var/www/html/maas/images/ephemeral-v3/daily
492 count: 1
493 # i386 need for pxe
494 filters: ['arch~(i386|amd64)', 'os~(grub*|pxelinux)']
Jiri Broulike30a60f2018-04-09 21:15:10 +0200495 xenial:
azvyagintsev80f9da72018-06-01 18:01:45 +0300496 keyring: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
497 upstream: http://images.maas.io/ephemeral-v3/daily/
498 local_dir: /var/www/html/maas/images/ephemeral-v3/daily
499 count: 1
500 filters: ['release~(xenial)', 'arch~(amd64)', 'subarch~(generic|hwe-16.04$|ga-16.04)']
Jiri Broulike30a60f2018-04-09 21:15:10 +0200501 count: 1
502
azvyagintseva1afa852018-11-19 20:45:18 +0200503Usage of local deb repos and curtin-based variables.
504
505Dict of variables ``curtin_vars:amd64:xenial: `` format, which will be passed only to:
506``/etc/maas/preseeds/curtin_userdata_amd64_generic_xenial`` accordingly.
507
Richard Felklce118a22017-09-13 11:09:12 +0200508
509.. code-block:: yaml
azvyagintsev7605a662017-11-03 19:05:04 +0200510
Richard Felklce118a22017-09-13 11:09:12 +0200511 maas:
512 cluster:
513 enabled: true
514 region:
515 port: 80
516 host: localhost
517 saltstack_repo_key: |
518 -----BEGIN PGP PUBLIC KEY BLOCK-----
519 Version: GnuPG v2
520
521 mQENBFOpvpgBCADkP656H41i8fpplEEB8IeLhugyC2rTEwwSclb8tQNYtUiGdna9
azvyagintsev06b71e72017-11-08 17:11:07 +0200522 .....
Richard Felklce118a22017-09-13 11:09:12 +0200523 fuBmScum8uQTrEF5+Um5zkwC7EXTdH1co/+/V/fpOtxIg4XO4kcugZefVm5ERfVS
524 MA==
525 =dtMN
526 -----END PGP PUBLIC KEY BLOCK-----
azvyagintseva80fdfb2018-07-16 22:34:45 +0300527 saltstack_repo_xenial: "deb [arch=amd64] http://${_param:local_repo_url}/ubuntu-xenial stable salt"
528 saltstack_repo_trusty: "deb [arch=amd64] http://${_param:local_repo_url}/ubuntu-trusty stable salt"
azvyagintseva1afa852018-11-19 20:45:18 +0200529 curtin_vars:
530 amd64:
531 xenial:
532 # List of packages, to be installed directly in curtin stage.
azvyagintsev05393f62018-11-25 11:15:10 +0200533 extra_pkgs:
534 enabled: true
535 pkgs: [ "linux-headers-generic-hwe-16.04", "linux-image-extra-virtual-hwe-16.04" ]
azvyagintseva1afa852018-11-19 20:45:18 +0200536 # exact kernel pkgs name, to be passed into curtin stage.
azvyagintsev05393f62018-11-25 11:15:10 +0200537 kernel_package:
538 enabled: true
539 value 'linux-image-virtual-hwe-16.04'
Richard Felklce118a22017-09-13 11:09:12 +0200540
Ondrej Smola9af2b082016-08-25 17:37:29 +0200541Single MAAS cluster service [multiple racks]
542
543.. code-block:: yaml
544
545 maas:
546 cluster:
547 enabled: true
Jakub Pavlikf43512b2016-08-30 10:25:42 +0200548 role: master/slave
Ondrej Smola9af2b082016-08-25 17:37:29 +0200549
azvyagintsev7605a662017-11-03 19:05:04 +0200550.. code-block:: yaml
551
552 maas:
553 cluster:
554 enabled: true
555 role: master/slave
556
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300557MAAS region service with backup data:
Martin Polreich0764b762017-11-20 14:08:30 +0100558
559.. code-block:: yaml
azvyagintsev80f9da72018-06-01 18:01:45 +0300560
Martin Polreich0764b762017-11-20 14:08:30 +0100561 maas:
562 region:
563 database:
564 initial_data:
565 source: cfg01.local
566 host: 192.168.0.11
567
azvyagintsev6543ec82018-11-01 23:45:09 +0200568MAAS service power_parameters defintion with OpenStack Nova power_type:
569
570.. code-block:: yaml
571
572 maas:
573 region:
574 machines:
575 cmp1:
576 power_type: nova
577 power_parameters: # old style, deprecated
578 power_nova_id: hostuuid
579 power_os_tenantname: tenant
580 power_os_username: user
581 power_os_password: password
582 power_os_authurl: http://url
583
584
585.. code-block:: yaml
586
587 maas:
588 region:
589 machines:
590 cmp1:
591 power_type: nova
592 power_parameters: # new style
593 nova_id: hostuuid
594 os_tenantname: tenant
595 os_username: user
596 os_password: password
597 os_authurl: http://url
598
Dzmitry Stremkouskid95bd2e2018-12-03 17:35:46 +0100599
600Ext pillar from MAAS address pool:
601==================================
602
603Set up salt master:
604
605.. code-block:: yaml
606
607 salt:
608 master:
609 ext_pillars:
610 1:
611 module: cmd_json
612 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
613
614.. code-block:: bash
615
616 salt-call state.apply salt.master
617 salt '*' saltutil.refresh_pillar
618
619Update infra/address_pool.yml:
620
621.. code-block:: yaml
622
623 parameters:
624 address_pool:
625 external:
626 dns_server01: 8.8.8.8
627 dns_server02: 8.8.4.4
628 upstream_ntp_server: 193.27.208.100
629 remote_rsyslog_host: 127.0.0.3
630 deploy_network:
631 address: 192.168.0.0
632 netmask: 255.255.255.0
633 gateway: 192.168.0.1
634 prefix: 24
635 vlan: 0
636 # Static reservation which interfere with maas reserve pool
637 reserved:
638 cmp001_deploy_address: 192.168.0.101
639 cmp002_deploy_address: 192.168.0.102
640 infra_config_deploy_address: 192.168.0.253
641 infra_kvm_node01_deploy_address: 192.168.0.241
642 infra_kvm_node02_deploy_address: 192.168.0.242
643 infra_kvm_node03_deploy_address: 192.168.0.243
644 infra_kvm_node04_deploy_address: 192.168.0.244
645 infra_kvm_node05_deploy_address: 192.168.0.245
646 infra_kvm_node06_deploy_address: 192.168.0.246
647 ldap_ip_address: 192.168.0.249
648 pool:
649 # Static reservation out of maas reserved pool
650 aptly_server_deploy_address: 192.168.0.252
651 # Dynamic serialization
652 cicd_control_node01_deploy_address: dummy
653 cicd_control_node02_deploy_address: dummy
654 cicd_control_node03_deploy_address: dummy
655 # Release IP address
656 openstack_share_node02_proxy_address: ""
657 cluster_networks:
658 deploy_network:
659 name: 'deploy_network'
660 cidr: ${address_pool:deploy_network:address}/${address_pool:deploy_network:prefix}
661 fabric: deploy_fabric
662 vlan: ${address_pool:deploy_network:vlan}
663 gateway_ip: ${address_pool:deploy_network:gateway}
664 ipranges:
665 1:
666 start: 192.168.0.30
667 end: 192.168.0.80
668 type: dynamic
669 comment: 'dynamic range'
670 2:
671 start: 192.168.0.1
672 end: 192.168.0.29
673 type: reserved
674 comment: 'infra reserve'
675 control_network:
676 name: 'control_network'
677 cidr: ${address_pool:control_network:address}/${address_pool:control_network:prefix}
678 fabric: control_fabric
679 vlan: ${address_pool:control_network:vlan}
680 gateway_ip: ${address_pool:control_network:address}
681
682
683Update maas.yml:
684
685.. code-block:: yaml
686
687 maas:
688 region:
689 fabrics:
690 deploy_fabric:
691 name: ${cluster_networks:deploy_network:fabric}
692 description: 'Fabric for deploy_network'
693 vlans:
694 0:
695 name: 'lan 0'
696 description: Deploy VLAN
697 dhcp: true
698 primary_rack: "${linux:network:hostname}"
699 control_fabric:
700 name: 'control_fabric'
701 description: 'Fabric for control_network'
702 vlans:
703 0:
704 name: ${cluster_networks:control_network:fabric}
705 description: Control VLAN
706 dhcp: false
707 primary_rack: "${linux:network:hostname}"
708 mesh_fabric:
709 name: ${cluster_networks:mesh_network:fabric}
710 description: 'Fabric for mesh_network'
711 vlans:
712 0:
713 name: 'mesh_network'
714 description: Mesh VLAN
715 dhcp: false
716 primary_rack: "${linux:network:hostname}"
717 subnets:
718 deploy_network: ${cluster_networks:deploy_network}
719 control_network: ${cluster_networks:control_network}
720 mesh_network: ${cluster_networks:mesh_network}
721 proxy_network: ${cluster_networks:proxy_network}
722
723
724Populate maas with networks:
725
726.. code-block:: bash
727
728 salt-call state.apply maas.region
729
730Serialize ip addresses using maas network pools:
731
732.. code-block:: bash
733
734 salt-call maasng.sync_address_pool
735
736Verify pillar override works:
737
738.. code-block:: bash
739
740 salt-call pillar.get address_pool:deploy_network:pool:openstack_share_node02_deploy_address
741
742 # Sample output:
743 # local:
744 # 192.168.0.81
745
746
Petr Michalec8a0d52e2018-05-30 16:22:56 +0200747Test pillars
748==============
749
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300750Mind the PostgreSQL and rsyslog ``.sls``. Database and
751syslog service are required for MAAS to properly install
752and work.
Petr Michalec8a0d52e2018-05-30 16:22:56 +0200753
Pavel Cizinskya5469f12018-12-12 12:02:29 +0100754* https://gerrit.mcp.mirantis.com/salt-formulas/rsyslog/tree/master/tests/pillar
Petr Michalec8a0d52e2018-05-30 16:22:56 +0200755
756
azvyagintsev7605a662017-11-03 19:05:04 +0200757Module function's example:
758==========================
759
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300760Wait for status of selected machine's:
azvyagintsev7605a662017-11-03 19:05:04 +0200761
762.. code-block:: bash
763
764 > cat maas/machines/wait_for_machines_ready.sls
765
766 ...
767
768 wait_for_machines_ready:
769 module.run:
770 - name: maas.wait_for_machine_status
771 - kwargs:
772 machines:
773 - kvm01
774 - kvm02
Alexandru Avadanii3206fe72018-09-23 03:57:27 +0200775 timeout: {{ region.timeout.ready }}
776 attempts: {{ region.timeout.attempts }}
azvyagintsev7605a662017-11-03 19:05:04 +0200777 req_status: "Ready"
778 - require:
779 - cmd: maas_login_admin
780 ...
781
Alexandru Avadanii3206fe72018-09-23 03:57:27 +0200782The timeout setting is taken from the reclass pillar data.
783If the pillar data is not defined, it will use the default value.
784
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300785If module run w/\o any extra paremeters,
786``wait_for_machines_ready`` will wait for defined in salt
787machines. In this case, it is usefull to skip some machines:
azvyagintsev7605a662017-11-03 19:05:04 +0200788
789.. code-block:: bash
790
791 > cat maas/machines/wait_for_machines_deployed.sls
792
793 ...
794
795 wait_for_machines_ready:
796 module.run:
797 - name: maas.wait_for_machine_status
798 - kwargs:
Alexandru Avadanii3206fe72018-09-23 03:57:27 +0200799 timeout: {{ region.timeout.deployed }}
800 attempts: {{ region.timeout.attempts }}
Michael Polenchuke438bd32017-11-09 20:42:42 +0400801 req_status: "Deployed"
azvyagintsev7605a662017-11-03 19:05:04 +0200802 ignore_machines:
803 - kvm01 # in case it's broken or whatever
804 - require:
805 - cmd: maas_login_admin
806 ...
807
Martin Polreiche3183ad2019-10-30 13:01:50 +0100808It is also possible to skip all the machines which are already in
809the "Deployed" state. This is especially useful when you are adding
810new nodes and you don't want to check the already deployed ones.
811This can be enabled by setting in the ``ignore_deployed_machines``
812parameter to ``true`` in reclass.
813
814.. code-block:: bash
815
816 ...
817
818 maas:
819 region:
820 ignore_deployed_machines: true
821 ...
822
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300823List of available ``req_status`` defined in global variable:
azvyagintsev06b71e72017-11-08 17:11:07 +0200824
825.. code-block:: python
826
827 STATUS_NAME_DICT = dict([
828 (0, 'New'), (1, 'Commissioning'), (2, 'Failed commissioning'),
829 (3, 'Missing'), (4, 'Ready'), (5, 'Reserved'), (10, 'Allocated'),
830 (9, 'Deploying'), (6, 'Deployed'), (7, 'Retired'), (8, 'Broken'),
831 (11, 'Failed deployment'), (12, 'Releasing'),
832 (13, 'Releasing failed'), (14, 'Disk erasing'),
833 (15, 'Failed disk erasing')])
azvyagintsev7605a662017-11-03 19:05:04 +0200834
Ales Komarekef982692016-02-21 14:56:07 +0100835Read more
836=========
837
Roald Nefsc86d84a2017-10-12 21:19:50 +0200838* https://maas.io/