blob: 44984724e3a67f39fbe7d46ae254325d098fbe9c [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
301 part3:
302 size: 3G
303 vdc:
304 type: physical
305 partition_schema:
306 part1:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200307 size: 100G
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100308 vdd:
309 type: physical
310 partition_schema:
311 part1:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200312 size: 100G
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100313 raid0:
314 type: raid
315 level: 10
316 devices:
317 - vde
318 - vdf
319 partition_schema:
320 part1:
321 size: 10G
322 part2:
323 size: 2G
324 part3:
325 size: 3G
326 raid1:
327 type: raid
328 level: 1
329 partitions:
330 - vdc-part1
331 - vdd-part1
332 volume_group2:
333 type: lvm
334 devices:
335 - raid1
336 volume:
337 tmp:
338 size: 5G
Ondrej Smola47b56752018-03-06 15:38:27 +0100339 type: ext4
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100340 mount: '/tmp'
341 log:
342 size: 7G
Ondrej Smola47b56752018-03-06 15:38:27 +0100343 type: ext4
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100344 mount: '/var/log'
azvyagintsev7605a662017-11-03 19:05:04 +0200345
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300346Raid setup, 4x HDD:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200347
348.. code-block:: yaml
349
350 maas:
351 region:
352 machines:
353 serverWithRaidExample:
354 disk_layout:
azvyagintsevbca1f462018-05-25 19:06:46 +0300355 type: custom
356 bootable_device: sda
Petr Michalec16cc5c92018-05-17 09:56:35 +0200357 disk:
358 md0:
359 type: raid
360 level: 1
361 devices:
362 - sda
363 - sdb
364 partition_schema:
365 part1:
366 size: 230G
367 type: ext4
368 mount: /
369 md1:
370 type: raid
371 level: 1
372 devices:
373 - sdc
374 - sdd
375 partition_schema:
376 part1:
377 size: 1890G
378 type: ext4
379 mount: /var/lib/libvirt
380
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300381Raid + LVM setup, 2xSSD + 2xHDD:
Petr Michalec16cc5c92018-05-17 09:56:35 +0200382
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300383.. note:: This setup lacks the ability run state twice,
384 as of now when ``disk_partition_present`` is called,
385 it tries blindly to delete the partition and then
386 recreated. That fails as MAAS rejects remove
387 partition used in RAID/LVM.
Petr Michalec16cc5c92018-05-17 09:56:35 +0200388
389.. code-block:: yaml
390
391 maas:
392 region:
393 machines:
394 serverWithRaidExample2:
395 disk_layout:
azvyagintsevbca1f462018-05-25 19:06:46 +0300396 type: custom
Petr Michalec16cc5c92018-05-17 09:56:35 +0200397 #bootable_device: vgssd-root
398 disk:
399 sda: &maas_disk_physical_ssd
400 type: physical
401 partition_schema:
402 part1:
403 size: 239G
404 sdb: *maas_disk_physical_ssd
405 sdc: &maas_disk_physical_hdd
406 type: physical
407 partition_schema:
408 part1:
409 size: 1990G
410 sdd: *maas_disk_physical_hdd
411 md0:
412 type: raid
413 level: 1
414 partitions:
415 - sda-part1
416 - sdb-part1
417 md1:
418 type: raid
419 level: 1
420 partitions:
421 - sdc-part1
422 - sdd-part1
423 vgssd:
424 type: lvm
425 devices:
426 - md0
427 volume:
428 root:
429 size: 230G
430 type: ext4
431 mount: '/'
432 vghdd:
433 type: lvm
434 devices:
435 - md1
436 volume:
437 libvirt:
438 size: 1800G
439 type: ext4
440 mount: '/var/lib/libvirt'
441
azvyagintsevd786e5f2018-11-06 20:57:24 +0200442
443LVM setup using partition
444
445
446.. code-block:: yaml
447
448
449 maas:
450 region:
451 machines:
452 serverWithLvmExample3:
453 disk_layout:
454 type: custom
455 bootable_device: sda
456 disk:
457 sda:
458 type: physical
459 partition_schema:
460 part1:
461 size: 50G
462 part2:
463 mount: /var/lib/libvirt/images/
464 size: 10G
465 type: ext4
466 vg0:
467 partitions:
468 - sda-part1
469 type: lvm
470 volume:
471 root:
472 mount: /
473 size: 40G
474 type: ext4
475
476
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300477Setup image mirror (Maas boot resources):
Jiri Broulike30a60f2018-04-09 21:15:10 +0200478
479.. code-block:: yaml
480
481 maas:
482 mirror:
483 enabled: true
484 image:
azvyagintsev80f9da72018-06-01 18:01:45 +0300485 sections:
486 bootloaders:
487 keyring: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
488 upstream: http://images.maas.io/ephemeral-v3/daily/
489 local_dir: /var/www/html/maas/images/ephemeral-v3/daily
490 count: 1
491 # i386 need for pxe
492 filters: ['arch~(i386|amd64)', 'os~(grub*|pxelinux)']
Jiri Broulike30a60f2018-04-09 21:15:10 +0200493 xenial:
azvyagintsev80f9da72018-06-01 18:01:45 +0300494 keyring: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
495 upstream: http://images.maas.io/ephemeral-v3/daily/
496 local_dir: /var/www/html/maas/images/ephemeral-v3/daily
497 count: 1
498 filters: ['release~(xenial)', 'arch~(amd64)', 'subarch~(generic|hwe-16.04$|ga-16.04)']
Jiri Broulike30a60f2018-04-09 21:15:10 +0200499 count: 1
500
azvyagintseva1afa852018-11-19 20:45:18 +0200501Usage of local deb repos and curtin-based variables.
502
503Dict of variables ``curtin_vars:amd64:xenial: `` format, which will be passed only to:
504``/etc/maas/preseeds/curtin_userdata_amd64_generic_xenial`` accordingly.
505
Richard Felklce118a22017-09-13 11:09:12 +0200506
507.. code-block:: yaml
azvyagintsev7605a662017-11-03 19:05:04 +0200508
Richard Felklce118a22017-09-13 11:09:12 +0200509 maas:
510 cluster:
511 enabled: true
512 region:
513 port: 80
514 host: localhost
515 saltstack_repo_key: |
516 -----BEGIN PGP PUBLIC KEY BLOCK-----
517 Version: GnuPG v2
518
519 mQENBFOpvpgBCADkP656H41i8fpplEEB8IeLhugyC2rTEwwSclb8tQNYtUiGdna9
azvyagintsev06b71e72017-11-08 17:11:07 +0200520 .....
Richard Felklce118a22017-09-13 11:09:12 +0200521 fuBmScum8uQTrEF5+Um5zkwC7EXTdH1co/+/V/fpOtxIg4XO4kcugZefVm5ERfVS
522 MA==
523 =dtMN
524 -----END PGP PUBLIC KEY BLOCK-----
azvyagintseva80fdfb2018-07-16 22:34:45 +0300525 saltstack_repo_xenial: "deb [arch=amd64] http://${_param:local_repo_url}/ubuntu-xenial stable salt"
526 saltstack_repo_trusty: "deb [arch=amd64] http://${_param:local_repo_url}/ubuntu-trusty stable salt"
azvyagintseva1afa852018-11-19 20:45:18 +0200527 curtin_vars:
528 amd64:
529 xenial:
530 # List of packages, to be installed directly in curtin stage.
azvyagintsev05393f62018-11-25 11:15:10 +0200531 extra_pkgs:
532 enabled: true
533 pkgs: [ "linux-headers-generic-hwe-16.04", "linux-image-extra-virtual-hwe-16.04" ]
azvyagintseva1afa852018-11-19 20:45:18 +0200534 # exact kernel pkgs name, to be passed into curtin stage.
azvyagintsev05393f62018-11-25 11:15:10 +0200535 kernel_package:
536 enabled: true
537 value 'linux-image-virtual-hwe-16.04'
Richard Felklce118a22017-09-13 11:09:12 +0200538
Ondrej Smola9af2b082016-08-25 17:37:29 +0200539Single MAAS cluster service [multiple racks]
540
541.. code-block:: yaml
542
543 maas:
544 cluster:
545 enabled: true
Jakub Pavlikf43512b2016-08-30 10:25:42 +0200546 role: master/slave
Ondrej Smola9af2b082016-08-25 17:37:29 +0200547
azvyagintsev7605a662017-11-03 19:05:04 +0200548.. code-block:: yaml
549
550 maas:
551 cluster:
552 enabled: true
553 role: master/slave
554
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300555MAAS region service with backup data:
Martin Polreich0764b762017-11-20 14:08:30 +0100556
557.. code-block:: yaml
azvyagintsev80f9da72018-06-01 18:01:45 +0300558
Martin Polreich0764b762017-11-20 14:08:30 +0100559 maas:
560 region:
561 database:
562 initial_data:
563 source: cfg01.local
564 host: 192.168.0.11
565
azvyagintsev6543ec82018-11-01 23:45:09 +0200566MAAS service power_parameters defintion with OpenStack Nova power_type:
567
568.. code-block:: yaml
569
570 maas:
571 region:
572 machines:
573 cmp1:
574 power_type: nova
575 power_parameters: # old style, deprecated
576 power_nova_id: hostuuid
577 power_os_tenantname: tenant
578 power_os_username: user
579 power_os_password: password
580 power_os_authurl: http://url
581
582
583.. code-block:: yaml
584
585 maas:
586 region:
587 machines:
588 cmp1:
589 power_type: nova
590 power_parameters: # new style
591 nova_id: hostuuid
592 os_tenantname: tenant
593 os_username: user
594 os_password: password
595 os_authurl: http://url
596
Dzmitry Stremkouskid95bd2e2018-12-03 17:35:46 +0100597
598Ext pillar from MAAS address pool:
599==================================
600
601Set up salt master:
602
603.. code-block:: yaml
604
605 salt:
606 master:
607 ext_pillars:
608 1:
609 module: cmd_json
610 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
611
612.. code-block:: bash
613
614 salt-call state.apply salt.master
615 salt '*' saltutil.refresh_pillar
616
617Update infra/address_pool.yml:
618
619.. code-block:: yaml
620
621 parameters:
622 address_pool:
623 external:
624 dns_server01: 8.8.8.8
625 dns_server02: 8.8.4.4
626 upstream_ntp_server: 193.27.208.100
627 remote_rsyslog_host: 127.0.0.3
628 deploy_network:
629 address: 192.168.0.0
630 netmask: 255.255.255.0
631 gateway: 192.168.0.1
632 prefix: 24
633 vlan: 0
634 # Static reservation which interfere with maas reserve pool
635 reserved:
636 cmp001_deploy_address: 192.168.0.101
637 cmp002_deploy_address: 192.168.0.102
638 infra_config_deploy_address: 192.168.0.253
639 infra_kvm_node01_deploy_address: 192.168.0.241
640 infra_kvm_node02_deploy_address: 192.168.0.242
641 infra_kvm_node03_deploy_address: 192.168.0.243
642 infra_kvm_node04_deploy_address: 192.168.0.244
643 infra_kvm_node05_deploy_address: 192.168.0.245
644 infra_kvm_node06_deploy_address: 192.168.0.246
645 ldap_ip_address: 192.168.0.249
646 pool:
647 # Static reservation out of maas reserved pool
648 aptly_server_deploy_address: 192.168.0.252
649 # Dynamic serialization
650 cicd_control_node01_deploy_address: dummy
651 cicd_control_node02_deploy_address: dummy
652 cicd_control_node03_deploy_address: dummy
653 # Release IP address
654 openstack_share_node02_proxy_address: ""
655 cluster_networks:
656 deploy_network:
657 name: 'deploy_network'
658 cidr: ${address_pool:deploy_network:address}/${address_pool:deploy_network:prefix}
659 fabric: deploy_fabric
660 vlan: ${address_pool:deploy_network:vlan}
661 gateway_ip: ${address_pool:deploy_network:gateway}
662 ipranges:
663 1:
664 start: 192.168.0.30
665 end: 192.168.0.80
666 type: dynamic
667 comment: 'dynamic range'
668 2:
669 start: 192.168.0.1
670 end: 192.168.0.29
671 type: reserved
672 comment: 'infra reserve'
673 control_network:
674 name: 'control_network'
675 cidr: ${address_pool:control_network:address}/${address_pool:control_network:prefix}
676 fabric: control_fabric
677 vlan: ${address_pool:control_network:vlan}
678 gateway_ip: ${address_pool:control_network:address}
679
680
681Update maas.yml:
682
683.. code-block:: yaml
684
685 maas:
686 region:
687 fabrics:
688 deploy_fabric:
689 name: ${cluster_networks:deploy_network:fabric}
690 description: 'Fabric for deploy_network'
691 vlans:
692 0:
693 name: 'lan 0'
694 description: Deploy VLAN
695 dhcp: true
696 primary_rack: "${linux:network:hostname}"
697 control_fabric:
698 name: 'control_fabric'
699 description: 'Fabric for control_network'
700 vlans:
701 0:
702 name: ${cluster_networks:control_network:fabric}
703 description: Control VLAN
704 dhcp: false
705 primary_rack: "${linux:network:hostname}"
706 mesh_fabric:
707 name: ${cluster_networks:mesh_network:fabric}
708 description: 'Fabric for mesh_network'
709 vlans:
710 0:
711 name: 'mesh_network'
712 description: Mesh VLAN
713 dhcp: false
714 primary_rack: "${linux:network:hostname}"
715 subnets:
716 deploy_network: ${cluster_networks:deploy_network}
717 control_network: ${cluster_networks:control_network}
718 mesh_network: ${cluster_networks:mesh_network}
719 proxy_network: ${cluster_networks:proxy_network}
720
721
722Populate maas with networks:
723
724.. code-block:: bash
725
726 salt-call state.apply maas.region
727
728Serialize ip addresses using maas network pools:
729
730.. code-block:: bash
731
732 salt-call maasng.sync_address_pool
733
734Verify pillar override works:
735
736.. code-block:: bash
737
738 salt-call pillar.get address_pool:deploy_network:pool:openstack_share_node02_deploy_address
739
740 # Sample output:
741 # local:
742 # 192.168.0.81
743
744
Petr Michalec8a0d52e2018-05-30 16:22:56 +0200745Test pillars
746==============
747
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300748Mind the PostgreSQL and rsyslog ``.sls``. Database and
749syslog service are required for MAAS to properly install
750and work.
Petr Michalec8a0d52e2018-05-30 16:22:56 +0200751
Pavel Cizinskya5469f12018-12-12 12:02:29 +0100752* https://gerrit.mcp.mirantis.com/salt-formulas/rsyslog/tree/master/tests/pillar
Petr Michalec8a0d52e2018-05-30 16:22:56 +0200753
754
azvyagintsev7605a662017-11-03 19:05:04 +0200755Module function's example:
756==========================
757
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300758Wait for status of selected machine's:
azvyagintsev7605a662017-11-03 19:05:04 +0200759
760.. code-block:: bash
761
762 > cat maas/machines/wait_for_machines_ready.sls
763
764 ...
765
766 wait_for_machines_ready:
767 module.run:
768 - name: maas.wait_for_machine_status
769 - kwargs:
770 machines:
771 - kvm01
772 - kvm02
773 timeout: 1200 # in seconds
774 req_status: "Ready"
775 - require:
776 - cmd: maas_login_admin
777 ...
778
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300779If module run w/\o any extra paremeters,
780``wait_for_machines_ready`` will wait for defined in salt
781machines. In this case, it is usefull to skip some machines:
azvyagintsev7605a662017-11-03 19:05:04 +0200782
783.. code-block:: bash
784
785 > cat maas/machines/wait_for_machines_deployed.sls
786
787 ...
788
789 wait_for_machines_ready:
790 module.run:
791 - name: maas.wait_for_machine_status
792 - kwargs:
793 timeout: 1200 # in seconds
Michael Polenchuke438bd32017-11-09 20:42:42 +0400794 req_status: "Deployed"
azvyagintsev7605a662017-11-03 19:05:04 +0200795 ignore_machines:
796 - kvm01 # in case it's broken or whatever
797 - require:
798 - cmd: maas_login_admin
799 ...
800
OlgaGusarenkoa8b77152018-07-30 23:33:35 +0300801List of available ``req_status`` defined in global variable:
azvyagintsev06b71e72017-11-08 17:11:07 +0200802
803.. code-block:: python
804
805 STATUS_NAME_DICT = dict([
806 (0, 'New'), (1, 'Commissioning'), (2, 'Failed commissioning'),
807 (3, 'Missing'), (4, 'Ready'), (5, 'Reserved'), (10, 'Allocated'),
808 (9, 'Deploying'), (6, 'Deployed'), (7, 'Retired'), (8, 'Broken'),
809 (11, 'Failed deployment'), (12, 'Releasing'),
810 (13, 'Releasing failed'), (14, 'Disk erasing'),
811 (15, 'Failed disk erasing')])
azvyagintsev7605a662017-11-03 19:05:04 +0200812
Ales Komarekef982692016-02-21 14:56:07 +0100813Read more
814=========
815
Roald Nefsc86d84a2017-10-12 21:19:50 +0200816* https://maas.io/