OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 1 | ===== |
| 2 | Usage |
| 3 | ===== |
Ales Komarek | ef98269 | 2016-02-21 14:56:07 +0100 | [diff] [blame] | 4 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 5 | Metal as a Service |
Ales Komarek | ef98269 | 2016-02-21 14:56:07 +0100 | [diff] [blame] | 6 | |
| 7 | Sample pillars |
| 8 | ============== |
| 9 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 10 | Single maas service: |
Ales Komarek | ef98269 | 2016-02-21 14:56:07 +0100 | [diff] [blame] | 11 | |
| 12 | .. code-block:: yaml |
| 13 | |
| 14 | maas: |
| 15 | server: |
| 16 | enabled: true |
| 17 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 18 | Single MAAS region service [single UI/API]: |
Ondrej Smola | 9af2b08 | 2016-08-25 17:37:29 +0200 | [diff] [blame] | 19 | |
| 20 | .. code-block:: yaml |
| 21 | |
Damian Szeluga | a824810 | 2017-03-16 08:48:51 +0100 | [diff] [blame] | 22 | maas: |
Damian Szeluga | 336ff2e | 2017-03-30 11:19:34 +0200 | [diff] [blame] | 23 | salt_master_ip: 192.168.0.10 |
Damian Szeluga | a824810 | 2017-03-16 08:48:51 +0100 | [diff] [blame] | 24 | region: |
Jiri Broulik | 0df14bc | 2017-08-07 10:01:55 +0200 | [diff] [blame] | 25 | upstream_proxy: |
| 26 | address: 10.0.0.1 |
| 27 | port: 8080 |
Ondrej Smola | 3ffb631 | 2017-09-22 17:13:10 +0200 | [diff] [blame] | 28 | user: username #OPTIONAL |
| 29 | password: password #OPTIONAL |
Damian Szeluga | a824810 | 2017-03-16 08:48:51 +0100 | [diff] [blame] | 30 | 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: |
azvyagintsev | f3515c8 | 2018-06-26 18:59:05 +0300 | [diff] [blame] | 48 | fabric1: |
| 49 | name: 'tf2' |
azvyagintsev | 06b71e7 | 2017-11-08 17:11:07 +0200 | [diff] [blame] | 50 | description: "Test fabric" |
azvyagintsev | f3515c8 | 2018-06-26 18:59:05 +0300 | [diff] [blame] | 51 | fabric2: |
| 52 | name: 'tf2' |
azvyagintsev | 06b71e7 | 2017-11-08 17:11:07 +0200 | [diff] [blame] | 53 | description: "Test fabric2" |
azvyagintsev | f3515c8 | 2018-06-26 18:59:05 +0300 | [diff] [blame] | 54 | 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 Ruzicka | 8047185 | 2018-07-13 14:08:27 +0200 | [diff] [blame] | 61 | mtu: 1500 |
azvyagintsev | f3515c8 | 2018-06-26 18:59:05 +0300 | [diff] [blame] | 62 | dhcp: true |
azvyagintsev | 6913e5e | 2018-07-05 11:42:53 +0300 | [diff] [blame] | 63 | # FIXME: after refactoring domain module, it should be |
| 64 | # fixed exactly for FQDN, not only 'hostname' |
azvyagintsev | f3515c8 | 2018-06-26 18:59:05 +0300 | [diff] [blame] | 65 | primary_rack: "${linux:network:hostname}" |
| 66 | |
Damian Szeluga | a824810 | 2017-03-16 08:48:51 +0100 | [diff] [blame] | 67 | subnets: |
| 68 | subnet1: |
azvyagintsev | f3515c8 | 2018-06-26 18:59:05 +0300 | [diff] [blame] | 69 | fabric: ${maas:region:fabrics:deploy_network:name} |
Damian Szeluga | a824810 | 2017-03-16 08:48:51 +0100 | [diff] [blame] | 70 | cidr: 2.2.3.0/24 |
| 71 | gateway_ip: 2.2.3.2 |
azvyagintsev | f3515c8 | 2018-06-26 18:59:05 +0300 | [diff] [blame] | 72 | 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" |
azvyagintsev | 87e6836 | 2018-07-23 09:21:38 +0200 | [diff] [blame] | 81 | type: reserved |
Damian Szeluga | a824810 | 2017-03-16 08:48:51 +0100 | [diff] [blame] | 82 | 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 |
azvyagintsev | 3ff2ef1 | 2018-06-01 21:30:45 +0300 | [diff] [blame] | 88 | boot_sources_delete_all_others: true |
Jiri Broulik | e30a60f | 2018-04-09 21:15:10 +0200 | [diff] [blame] | 89 | boot_sources: |
azvyagintsev | 3ff2ef1 | 2018-06-01 21:30:45 +0300 | [diff] [blame] | 90 | resources_mirror: |
| 91 | url: http://images.maas.io/ephemeral-v3/ |
Jiri Broulik | e30a60f | 2018-04-09 21:15:10 +0200 | [diff] [blame] | 92 | keyring_file: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg |
azvyagintsev | 3ff2ef1 | 2018-06-01 21:30:45 +0300 | [diff] [blame] | 93 | 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 Szeluga | a824810 | 2017-03-16 08:48:51 +0100 | [diff] [blame] | 101 | 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 Szeluga | a824810 | 2017-03-16 08:48:51 +0100 | [diff] [blame] | 108 | arches: amd64 |
| 109 | key: "-----BEGIN PGP PUBLIC KEY BLOCK----- |
| 110 | Version: GnuPG v2 |
Pavel Cizinsky | 5a6e272 | 2016-08-31 15:58:13 +0200 | [diff] [blame] | 111 | |
Damian Szeluga | a824810 | 2017-03-16 08:48:51 +0100 | [diff] [blame] | 112 | mQENBFOpvpgBCADkP656H41i8fpplEEB8IeLhugyC2rTEwwSclb8tQNYtUiGdna9 |
azvyagintsev | 06b71e7 | 2017-11-08 17:11:07 +0200 | [diff] [blame] | 113 | ...... |
Damian Szeluga | a824810 | 2017-03-16 08:48:51 +0100 | [diff] [blame] | 114 | fuBmScum8uQTrEF5+Um5zkwC7EXTdH1co/+/V/fpOtxIg4XO4kcugZefVm5ERfVS |
| 115 | MA== |
| 116 | =dtMN |
| 117 | -----END PGP PUBLIC KEY BLOCK-----" |
| 118 | enabled: true |
| 119 | machines: |
azvyagintsev | 06b71e7 | 2017-11-08 17:11:07 +0200 | [diff] [blame] | 120 | 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 Szeluga | a824810 | 2017-03-16 08:48:51 +0100 | [diff] [blame] | 136 | power_parameters: |
| 137 | power_type: ipmi |
| 138 | power_address: '192.168.10.10' |
| 139 | power_user: bmc_user |
azvyagintsev | 6543ec8 | 2018-11-01 23:45:09 +0200 | [diff] [blame] | 140 | # power_password: bmc_password # Old format,please use new one |
| 141 | power_pass: bmc_password |
Ondrej Smola | 455003c | 2017-06-01 22:53:39 +0200 | [diff] [blame] | 142 | #Optional (for legacy HW) |
| 143 | power_driver: LAN |
azvyagintsev | 06b71e7 | 2017-11-08 17:11:07 +0200 | [diff] [blame] | 144 | 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 |
azvyagintsev | 6543ec8 | 2018-11-01 23:45:09 +0200 | [diff] [blame] | 157 | # power_password: bmc_password # Old format,please use new one |
| 158 | power_pass: bmc_password |
azvyagintsev | 06b71e7 | 2017-11-08 17:11:07 +0200 | [diff] [blame] | 159 | #Optional (for legacy HW) |
| 160 | power_driver: LAN |
Maciej Relewicz | 37b12a2 | 2017-04-25 15:23:16 +0200 | [diff] [blame] | 161 | distro_series: xenial |
| 162 | hwe_kernel: hwe-16.04 |
Petr Ruzicka | 610f285 | 2018-08-22 15:05:52 +0200 | [diff] [blame] | 163 | 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 Szeluga | a824810 | 2017-03-16 08:48:51 +0100 | [diff] [blame] | 176 | 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 Szeluga | 336ff2e | 2017-03-30 11:19:34 +0200 | [diff] [blame] | 182 | commissioning_scripts: |
azvyagintsev | ec61dd6 | 2017-11-16 19:12:05 +0200 | [diff] [blame] | 183 | 00-maas-05-simplify-network-interfaces: /etc/maas/files/commisioning_scripts/00-maas-05-simplify-network-interfaces |
Damian Szeluga | 336ff2e | 2017-03-30 11:19:34 +0200 | [diff] [blame] | 184 | maas_config: |
azvyagintsev | 6913e5e | 2018-07-05 11:42:53 +0300 | [diff] [blame] | 185 | # domain: mydomain.local # This function broken |
Damian Szeluga | 336ff2e | 2017-03-30 11:19:34 +0200 | [diff] [blame] | 186 | 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: |
azvyagintsev | 06b71e7 | 2017-11-08 17:11:07 +0200 | [diff] [blame] | 203 | - 'ssh-rsa ASD.........dfsadf blah@blah' |
Ondrej Smola | 9af2b08 | 2016-08-25 17:37:29 +0200 | [diff] [blame] | 204 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 205 | Update VLAN: |
Pavel Cizinsky | 8dd85b5 | 2018-06-18 21:40:13 +0200 | [diff] [blame] | 206 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 207 | .. note:: Vid 0 has default name untagged in the MaaS UI. |
Pavel Cizinsky | 0995e8f | 2018-05-04 17:10:37 +0200 | [diff] [blame] | 208 | |
| 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 Smola | 9af2b08 | 2016-08-25 17:37:29 +0200 | [diff] [blame] | 223 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 224 | Create disk schema per machine via ``maas/client.sls`` with |
| 225 | default lvm schema + default values. |
Ondrej Smola | b57a23b | 2018-01-24 11:18:24 +0100 | [diff] [blame] | 226 | |
Maria Zlatkova | 3e88fd7 | 2018-08-08 10:51:29 +0300 | [diff] [blame] | 227 | .. note:: This should be used mostly for custom root |
| 228 | partitioning and RAID configuration. For |
| 229 | not-root partitions, use ``salt-formula-linux``. |
Ondrej Smola | b57a23b | 2018-01-24 11:18:24 +0100 | [diff] [blame] | 230 | |
| 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 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 246 | FLAT layout with custom root size: |
Ondrej Smola | b57a23b | 2018-01-24 11:18:24 +0100 | [diff] [blame] | 247 | |
| 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 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 260 | Size specification with ``%`` char used is not yet supported. |
Petr Michalec | 16cc5c9 | 2018-05-17 09:56:35 +0200 | [diff] [blame] | 261 | |
| 262 | .. code-block:: yaml |
azvyagintsev | 80f9da7 | 2018-06-01 18:01:45 +0300 | [diff] [blame] | 263 | |
Petr Michalec | 16cc5c9 | 2018-05-17 09:56:35 +0200 | [diff] [blame] | 264 | 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 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 280 | Define more complex layout: |
Ondrej Smola | b57a23b | 2018-01-24 11:18:24 +0100 | [diff] [blame] | 281 | |
| 282 | .. code-block:: yaml |
| 283 | |
| 284 | maas: |
| 285 | region: |
| 286 | machines: |
| 287 | server3: |
| 288 | disk_layout: |
azvyagintsev | bca1f46 | 2018-05-25 19:06:46 +0300 | [diff] [blame] | 289 | type: custom |
Ondrej Smola | b57a23b | 2018-01-24 11:18:24 +0100 | [diff] [blame] | 290 | 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 Michalec | 16cc5c9 | 2018-05-17 09:56:35 +0200 | [diff] [blame] | 307 | size: 100G |
Ondrej Smola | b57a23b | 2018-01-24 11:18:24 +0100 | [diff] [blame] | 308 | vdd: |
| 309 | type: physical |
| 310 | partition_schema: |
| 311 | part1: |
Petr Michalec | 16cc5c9 | 2018-05-17 09:56:35 +0200 | [diff] [blame] | 312 | size: 100G |
Ondrej Smola | b57a23b | 2018-01-24 11:18:24 +0100 | [diff] [blame] | 313 | 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 Smola | 47b5675 | 2018-03-06 15:38:27 +0100 | [diff] [blame] | 339 | type: ext4 |
Ondrej Smola | b57a23b | 2018-01-24 11:18:24 +0100 | [diff] [blame] | 340 | mount: '/tmp' |
| 341 | log: |
| 342 | size: 7G |
Ondrej Smola | 47b5675 | 2018-03-06 15:38:27 +0100 | [diff] [blame] | 343 | type: ext4 |
Ondrej Smola | b57a23b | 2018-01-24 11:18:24 +0100 | [diff] [blame] | 344 | mount: '/var/log' |
azvyagintsev | 7605a66 | 2017-11-03 19:05:04 +0200 | [diff] [blame] | 345 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 346 | Raid setup, 4x HDD: |
Petr Michalec | 16cc5c9 | 2018-05-17 09:56:35 +0200 | [diff] [blame] | 347 | |
| 348 | .. code-block:: yaml |
| 349 | |
| 350 | maas: |
| 351 | region: |
| 352 | machines: |
| 353 | serverWithRaidExample: |
| 354 | disk_layout: |
azvyagintsev | bca1f46 | 2018-05-25 19:06:46 +0300 | [diff] [blame] | 355 | type: custom |
| 356 | bootable_device: sda |
Petr Michalec | 16cc5c9 | 2018-05-17 09:56:35 +0200 | [diff] [blame] | 357 | 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 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 381 | Raid + LVM setup, 2xSSD + 2xHDD: |
Petr Michalec | 16cc5c9 | 2018-05-17 09:56:35 +0200 | [diff] [blame] | 382 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 383 | .. 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 Michalec | 16cc5c9 | 2018-05-17 09:56:35 +0200 | [diff] [blame] | 388 | |
| 389 | .. code-block:: yaml |
| 390 | |
| 391 | maas: |
| 392 | region: |
| 393 | machines: |
| 394 | serverWithRaidExample2: |
| 395 | disk_layout: |
azvyagintsev | bca1f46 | 2018-05-25 19:06:46 +0300 | [diff] [blame] | 396 | type: custom |
Petr Michalec | 16cc5c9 | 2018-05-17 09:56:35 +0200 | [diff] [blame] | 397 | #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 | |
azvyagintsev | d786e5f | 2018-11-06 20:57:24 +0200 | [diff] [blame] | 442 | |
| 443 | LVM 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 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 477 | Setup image mirror (Maas boot resources): |
Jiri Broulik | e30a60f | 2018-04-09 21:15:10 +0200 | [diff] [blame] | 478 | |
| 479 | .. code-block:: yaml |
| 480 | |
| 481 | maas: |
| 482 | mirror: |
| 483 | enabled: true |
| 484 | image: |
azvyagintsev | 80f9da7 | 2018-06-01 18:01:45 +0300 | [diff] [blame] | 485 | 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 Broulik | e30a60f | 2018-04-09 21:15:10 +0200 | [diff] [blame] | 493 | xenial: |
azvyagintsev | 80f9da7 | 2018-06-01 18:01:45 +0300 | [diff] [blame] | 494 | 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 Broulik | e30a60f | 2018-04-09 21:15:10 +0200 | [diff] [blame] | 499 | count: 1 |
| 500 | |
azvyagintsev | a1afa85 | 2018-11-19 20:45:18 +0200 | [diff] [blame] | 501 | Usage of local deb repos and curtin-based variables. |
| 502 | |
| 503 | Dict 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 Felkl | ce118a2 | 2017-09-13 11:09:12 +0200 | [diff] [blame] | 506 | |
| 507 | .. code-block:: yaml |
azvyagintsev | 7605a66 | 2017-11-03 19:05:04 +0200 | [diff] [blame] | 508 | |
Richard Felkl | ce118a2 | 2017-09-13 11:09:12 +0200 | [diff] [blame] | 509 | 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 |
azvyagintsev | 06b71e7 | 2017-11-08 17:11:07 +0200 | [diff] [blame] | 520 | ..... |
Richard Felkl | ce118a2 | 2017-09-13 11:09:12 +0200 | [diff] [blame] | 521 | fuBmScum8uQTrEF5+Um5zkwC7EXTdH1co/+/V/fpOtxIg4XO4kcugZefVm5ERfVS |
| 522 | MA== |
| 523 | =dtMN |
| 524 | -----END PGP PUBLIC KEY BLOCK----- |
azvyagintsev | a80fdfb | 2018-07-16 22:34:45 +0300 | [diff] [blame] | 525 | 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" |
azvyagintsev | a1afa85 | 2018-11-19 20:45:18 +0200 | [diff] [blame] | 527 | curtin_vars: |
| 528 | amd64: |
| 529 | xenial: |
| 530 | # List of packages, to be installed directly in curtin stage. |
azvyagintsev | 05393f6 | 2018-11-25 11:15:10 +0200 | [diff] [blame] | 531 | extra_pkgs: |
| 532 | enabled: true |
| 533 | pkgs: [ "linux-headers-generic-hwe-16.04", "linux-image-extra-virtual-hwe-16.04" ] |
azvyagintsev | a1afa85 | 2018-11-19 20:45:18 +0200 | [diff] [blame] | 534 | # exact kernel pkgs name, to be passed into curtin stage. |
azvyagintsev | 05393f6 | 2018-11-25 11:15:10 +0200 | [diff] [blame] | 535 | kernel_package: |
| 536 | enabled: true |
| 537 | value 'linux-image-virtual-hwe-16.04' |
Richard Felkl | ce118a2 | 2017-09-13 11:09:12 +0200 | [diff] [blame] | 538 | |
Ondrej Smola | 9af2b08 | 2016-08-25 17:37:29 +0200 | [diff] [blame] | 539 | Single MAAS cluster service [multiple racks] |
| 540 | |
| 541 | .. code-block:: yaml |
| 542 | |
| 543 | maas: |
| 544 | cluster: |
| 545 | enabled: true |
Jakub Pavlik | f43512b | 2016-08-30 10:25:42 +0200 | [diff] [blame] | 546 | role: master/slave |
Ondrej Smola | 9af2b08 | 2016-08-25 17:37:29 +0200 | [diff] [blame] | 547 | |
azvyagintsev | 7605a66 | 2017-11-03 19:05:04 +0200 | [diff] [blame] | 548 | .. code-block:: yaml |
| 549 | |
| 550 | maas: |
| 551 | cluster: |
| 552 | enabled: true |
| 553 | role: master/slave |
| 554 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 555 | MAAS region service with backup data: |
Martin Polreich | 0764b76 | 2017-11-20 14:08:30 +0100 | [diff] [blame] | 556 | |
| 557 | .. code-block:: yaml |
azvyagintsev | 80f9da7 | 2018-06-01 18:01:45 +0300 | [diff] [blame] | 558 | |
Martin Polreich | 0764b76 | 2017-11-20 14:08:30 +0100 | [diff] [blame] | 559 | maas: |
| 560 | region: |
| 561 | database: |
| 562 | initial_data: |
| 563 | source: cfg01.local |
| 564 | host: 192.168.0.11 |
| 565 | |
azvyagintsev | 6543ec8 | 2018-11-01 23:45:09 +0200 | [diff] [blame] | 566 | MAAS 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 Stremkouski | d95bd2e | 2018-12-03 17:35:46 +0100 | [diff] [blame] | 597 | |
| 598 | Ext pillar from MAAS address pool: |
| 599 | ================================== |
| 600 | |
| 601 | Set 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 | |
| 617 | Update 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 | |
| 681 | Update 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 | |
| 722 | Populate maas with networks: |
| 723 | |
| 724 | .. code-block:: bash |
| 725 | |
| 726 | salt-call state.apply maas.region |
| 727 | |
| 728 | Serialize ip addresses using maas network pools: |
| 729 | |
| 730 | .. code-block:: bash |
| 731 | |
| 732 | salt-call maasng.sync_address_pool |
| 733 | |
| 734 | Verify 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 Michalec | 8a0d52e | 2018-05-30 16:22:56 +0200 | [diff] [blame] | 745 | Test pillars |
| 746 | ============== |
| 747 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 748 | Mind the PostgreSQL and rsyslog ``.sls``. Database and |
| 749 | syslog service are required for MAAS to properly install |
| 750 | and work. |
Petr Michalec | 8a0d52e | 2018-05-30 16:22:56 +0200 | [diff] [blame] | 751 | |
Pavel Cizinsky | a5469f1 | 2018-12-12 12:02:29 +0100 | [diff] [blame] | 752 | * https://gerrit.mcp.mirantis.com/salt-formulas/rsyslog/tree/master/tests/pillar |
Petr Michalec | 8a0d52e | 2018-05-30 16:22:56 +0200 | [diff] [blame] | 753 | |
| 754 | |
azvyagintsev | 7605a66 | 2017-11-03 19:05:04 +0200 | [diff] [blame] | 755 | Module function's example: |
| 756 | ========================== |
| 757 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 758 | Wait for status of selected machine's: |
azvyagintsev | 7605a66 | 2017-11-03 19:05:04 +0200 | [diff] [blame] | 759 | |
| 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 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 779 | If module run w/\o any extra paremeters, |
| 780 | ``wait_for_machines_ready`` will wait for defined in salt |
| 781 | machines. In this case, it is usefull to skip some machines: |
azvyagintsev | 7605a66 | 2017-11-03 19:05:04 +0200 | [diff] [blame] | 782 | |
| 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 Polenchuk | e438bd3 | 2017-11-09 20:42:42 +0400 | [diff] [blame] | 794 | req_status: "Deployed" |
azvyagintsev | 7605a66 | 2017-11-03 19:05:04 +0200 | [diff] [blame] | 795 | ignore_machines: |
| 796 | - kvm01 # in case it's broken or whatever |
| 797 | - require: |
| 798 | - cmd: maas_login_admin |
| 799 | ... |
| 800 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 801 | List of available ``req_status`` defined in global variable: |
azvyagintsev | 06b71e7 | 2017-11-08 17:11:07 +0200 | [diff] [blame] | 802 | |
| 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')]) |
azvyagintsev | 7605a66 | 2017-11-03 19:05:04 +0200 | [diff] [blame] | 812 | |
Ales Komarek | ef98269 | 2016-02-21 14:56:07 +0100 | [diff] [blame] | 813 | Read more |
| 814 | ========= |
| 815 | |
Roald Nefs | c86d84a | 2017-10-12 21:19:50 +0200 | [diff] [blame] | 816 | * https://maas.io/ |