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 |
Stanislav Riazanov | 38b0186 | 2019-01-21 19:27:06 +0400 | [diff] [blame] | 31 | ntp: |
| 32 | server_1: |
| 33 | enabled: true |
| 34 | host: pool.ntp.org |
Damian Szeluga | a824810 | 2017-03-16 08:48:51 +0100 | [diff] [blame] | 35 | 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: |
azvyagintsev | f3515c8 | 2018-06-26 18:59:05 +0300 | [diff] [blame] | 52 | fabric1: |
| 53 | name: 'tf2' |
azvyagintsev | 06b71e7 | 2017-11-08 17:11:07 +0200 | [diff] [blame] | 54 | description: "Test fabric" |
azvyagintsev | f3515c8 | 2018-06-26 18:59:05 +0300 | [diff] [blame] | 55 | fabric2: |
| 56 | name: 'tf2' |
azvyagintsev | 06b71e7 | 2017-11-08 17:11:07 +0200 | [diff] [blame] | 57 | description: "Test fabric2" |
azvyagintsev | f3515c8 | 2018-06-26 18:59:05 +0300 | [diff] [blame] | 58 | 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 Ruzicka | 8047185 | 2018-07-13 14:08:27 +0200 | [diff] [blame] | 65 | mtu: 1500 |
azvyagintsev | f3515c8 | 2018-06-26 18:59:05 +0300 | [diff] [blame] | 66 | dhcp: true |
azvyagintsev | 6913e5e | 2018-07-05 11:42:53 +0300 | [diff] [blame] | 67 | # FIXME: after refactoring domain module, it should be |
| 68 | # fixed exactly for FQDN, not only 'hostname' |
azvyagintsev | f3515c8 | 2018-06-26 18:59:05 +0300 | [diff] [blame] | 69 | primary_rack: "${linux:network:hostname}" |
| 70 | |
Damian Szeluga | a824810 | 2017-03-16 08:48:51 +0100 | [diff] [blame] | 71 | subnets: |
| 72 | subnet1: |
azvyagintsev | f3515c8 | 2018-06-26 18:59:05 +0300 | [diff] [blame] | 73 | fabric: ${maas:region:fabrics:deploy_network:name} |
Damian Szeluga | a824810 | 2017-03-16 08:48:51 +0100 | [diff] [blame] | 74 | cidr: 2.2.3.0/24 |
| 75 | gateway_ip: 2.2.3.2 |
azvyagintsev | f3515c8 | 2018-06-26 18:59:05 +0300 | [diff] [blame] | 76 | 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" |
azvyagintsev | 87e6836 | 2018-07-23 09:21:38 +0200 | [diff] [blame] | 85 | type: reserved |
Damian Szeluga | a824810 | 2017-03-16 08:48:51 +0100 | [diff] [blame] | 86 | 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 |
azvyagintsev | 3ff2ef1 | 2018-06-01 21:30:45 +0300 | [diff] [blame] | 92 | boot_sources_delete_all_others: true |
Jiri Broulik | e30a60f | 2018-04-09 21:15:10 +0200 | [diff] [blame] | 93 | boot_sources: |
azvyagintsev | 3ff2ef1 | 2018-06-01 21:30:45 +0300 | [diff] [blame] | 94 | resources_mirror: |
| 95 | url: http://images.maas.io/ephemeral-v3/ |
Jiri Broulik | e30a60f | 2018-04-09 21:15:10 +0200 | [diff] [blame] | 96 | keyring_file: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg |
azvyagintsev | 3ff2ef1 | 2018-06-01 21:30:45 +0300 | [diff] [blame] | 97 | 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 Szeluga | a824810 | 2017-03-16 08:48:51 +0100 | [diff] [blame] | 105 | 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 Szeluga | a824810 | 2017-03-16 08:48:51 +0100 | [diff] [blame] | 112 | arches: amd64 |
| 113 | key: "-----BEGIN PGP PUBLIC KEY BLOCK----- |
| 114 | Version: GnuPG v2 |
Pavel Cizinsky | 5a6e272 | 2016-08-31 15:58:13 +0200 | [diff] [blame] | 115 | |
Damian Szeluga | a824810 | 2017-03-16 08:48:51 +0100 | [diff] [blame] | 116 | mQENBFOpvpgBCADkP656H41i8fpplEEB8IeLhugyC2rTEwwSclb8tQNYtUiGdna9 |
azvyagintsev | 06b71e7 | 2017-11-08 17:11:07 +0200 | [diff] [blame] | 117 | ...... |
Damian Szeluga | a824810 | 2017-03-16 08:48:51 +0100 | [diff] [blame] | 118 | fuBmScum8uQTrEF5+Um5zkwC7EXTdH1co/+/V/fpOtxIg4XO4kcugZefVm5ERfVS |
| 119 | MA== |
| 120 | =dtMN |
| 121 | -----END PGP PUBLIC KEY BLOCK-----" |
| 122 | enabled: true |
| 123 | machines: |
azvyagintsev | 06b71e7 | 2017-11-08 17:11:07 +0200 | [diff] [blame] | 124 | 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 Szeluga | a824810 | 2017-03-16 08:48:51 +0100 | [diff] [blame] | 140 | power_parameters: |
| 141 | power_type: ipmi |
| 142 | power_address: '192.168.10.10' |
| 143 | power_user: bmc_user |
azvyagintsev | 6543ec8 | 2018-11-01 23:45:09 +0200 | [diff] [blame] | 144 | # power_password: bmc_password # Old format,please use new one |
| 145 | power_pass: bmc_password |
Ondrej Smola | 455003c | 2017-06-01 22:53:39 +0200 | [diff] [blame] | 146 | #Optional (for legacy HW) |
| 147 | power_driver: LAN |
azvyagintsev | 06b71e7 | 2017-11-08 17:11:07 +0200 | [diff] [blame] | 148 | 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 |
azvyagintsev | 6543ec8 | 2018-11-01 23:45:09 +0200 | [diff] [blame] | 161 | # power_password: bmc_password # Old format,please use new one |
| 162 | power_pass: bmc_password |
azvyagintsev | 06b71e7 | 2017-11-08 17:11:07 +0200 | [diff] [blame] | 163 | #Optional (for legacy HW) |
| 164 | power_driver: LAN |
Maciej Relewicz | 37b12a2 | 2017-04-25 15:23:16 +0200 | [diff] [blame] | 165 | distro_series: xenial |
| 166 | hwe_kernel: hwe-16.04 |
Petr Ruzicka | 610f285 | 2018-08-22 15:05:52 +0200 | [diff] [blame] | 167 | 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 Szeluga | a824810 | 2017-03-16 08:48:51 +0100 | [diff] [blame] | 180 | 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 Szeluga | 336ff2e | 2017-03-30 11:19:34 +0200 | [diff] [blame] | 186 | commissioning_scripts: |
azvyagintsev | ec61dd6 | 2017-11-16 19:12:05 +0200 | [diff] [blame] | 187 | 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] | 188 | maas_config: |
azvyagintsev | 6913e5e | 2018-07-05 11:42:53 +0300 | [diff] [blame] | 189 | # domain: mydomain.local # This function broken |
Damian Szeluga | 336ff2e | 2017-03-30 11:19:34 +0200 | [diff] [blame] | 190 | 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 Szeluga | 336ff2e | 2017-03-30 11:19:34 +0200 | [diff] [blame] | 201 | upstream_dns: 192.168.12.13 |
| 202 | enable_http_proxy: true |
| 203 | default_min_hwe_kernel: '' |
| 204 | sshprefs: |
azvyagintsev | 06b71e7 | 2017-11-08 17:11:07 +0200 | [diff] [blame] | 205 | - 'ssh-rsa ASD.........dfsadf blah@blah' |
Ondrej Smola | 9af2b08 | 2016-08-25 17:37:29 +0200 | [diff] [blame] | 206 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 207 | Update VLAN: |
Pavel Cizinsky | 8dd85b5 | 2018-06-18 21:40:13 +0200 | [diff] [blame] | 208 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 209 | .. note:: Vid 0 has default name untagged in the MaaS UI. |
Pavel Cizinsky | 0995e8f | 2018-05-04 17:10:37 +0200 | [diff] [blame] | 210 | |
| 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 Smola | 9af2b08 | 2016-08-25 17:37:29 +0200 | [diff] [blame] | 225 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 226 | Create disk schema per machine via ``maas/client.sls`` with |
| 227 | default lvm schema + default values. |
Ondrej Smola | b57a23b | 2018-01-24 11:18:24 +0100 | [diff] [blame] | 228 | |
Maria Zlatkova | 3e88fd7 | 2018-08-08 10:51:29 +0300 | [diff] [blame] | 229 | .. note:: This should be used mostly for custom root |
| 230 | partitioning and RAID configuration. For |
| 231 | not-root partitions, use ``salt-formula-linux``. |
Ondrej Smola | b57a23b | 2018-01-24 11:18:24 +0100 | [diff] [blame] | 232 | |
| 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 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 248 | FLAT layout with custom root size: |
Ondrej Smola | b57a23b | 2018-01-24 11:18:24 +0100 | [diff] [blame] | 249 | |
| 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 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 262 | Size specification with ``%`` char used is not yet supported. |
Petr Michalec | 16cc5c9 | 2018-05-17 09:56:35 +0200 | [diff] [blame] | 263 | |
| 264 | .. code-block:: yaml |
azvyagintsev | 80f9da7 | 2018-06-01 18:01:45 +0300 | [diff] [blame] | 265 | |
Petr Michalec | 16cc5c9 | 2018-05-17 09:56:35 +0200 | [diff] [blame] | 266 | 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 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 282 | Define more complex layout: |
Ondrej Smola | b57a23b | 2018-01-24 11:18:24 +0100 | [diff] [blame] | 283 | |
| 284 | .. code-block:: yaml |
| 285 | |
| 286 | maas: |
| 287 | region: |
| 288 | machines: |
| 289 | server3: |
| 290 | disk_layout: |
azvyagintsev | bca1f46 | 2018-05-25 19:06:46 +0300 | [diff] [blame] | 291 | type: custom |
Ondrej Smola | b57a23b | 2018-01-24 11:18:24 +0100 | [diff] [blame] | 292 | 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 Sakharov | 14ccca3 | 2020-08-13 14:29:30 +0400 | [diff] [blame^] | 303 | mount: '/var/tmp' |
| 304 | mount_options: defaults,nodev,noexec,nosuid |
Ondrej Smola | b57a23b | 2018-01-24 11:18:24 +0100 | [diff] [blame] | 305 | part3: |
| 306 | size: 3G |
| 307 | vdc: |
| 308 | type: physical |
| 309 | partition_schema: |
| 310 | part1: |
Petr Michalec | 16cc5c9 | 2018-05-17 09:56:35 +0200 | [diff] [blame] | 311 | size: 100G |
Ondrej Smola | b57a23b | 2018-01-24 11:18:24 +0100 | [diff] [blame] | 312 | vdd: |
| 313 | type: physical |
| 314 | partition_schema: |
| 315 | part1: |
Petr Michalec | 16cc5c9 | 2018-05-17 09:56:35 +0200 | [diff] [blame] | 316 | size: 100G |
Ondrej Smola | b57a23b | 2018-01-24 11:18:24 +0100 | [diff] [blame] | 317 | 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 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: '/tmp' |
Valeriy Sakharov | 14ccca3 | 2020-08-13 14:29:30 +0400 | [diff] [blame^] | 345 | mount_options: defaults,nodev,noexec,nosuid |
Ondrej Smola | b57a23b | 2018-01-24 11:18:24 +0100 | [diff] [blame] | 346 | log: |
| 347 | size: 7G |
Ondrej Smola | 47b5675 | 2018-03-06 15:38:27 +0100 | [diff] [blame] | 348 | type: ext4 |
Ondrej Smola | b57a23b | 2018-01-24 11:18:24 +0100 | [diff] [blame] | 349 | mount: '/var/log' |
azvyagintsev | 7605a66 | 2017-11-03 19:05:04 +0200 | [diff] [blame] | 350 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 351 | Raid setup, 4x HDD: |
Petr Michalec | 16cc5c9 | 2018-05-17 09:56:35 +0200 | [diff] [blame] | 352 | |
| 353 | .. code-block:: yaml |
| 354 | |
| 355 | maas: |
| 356 | region: |
| 357 | machines: |
| 358 | serverWithRaidExample: |
| 359 | disk_layout: |
azvyagintsev | bca1f46 | 2018-05-25 19:06:46 +0300 | [diff] [blame] | 360 | type: custom |
| 361 | bootable_device: sda |
Petr Michalec | 16cc5c9 | 2018-05-17 09:56:35 +0200 | [diff] [blame] | 362 | 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 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 386 | Raid + LVM setup, 2xSSD + 2xHDD: |
Petr Michalec | 16cc5c9 | 2018-05-17 09:56:35 +0200 | [diff] [blame] | 387 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 388 | .. 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 Michalec | 16cc5c9 | 2018-05-17 09:56:35 +0200 | [diff] [blame] | 393 | |
| 394 | .. code-block:: yaml |
| 395 | |
| 396 | maas: |
| 397 | region: |
| 398 | machines: |
| 399 | serverWithRaidExample2: |
| 400 | disk_layout: |
azvyagintsev | bca1f46 | 2018-05-25 19:06:46 +0300 | [diff] [blame] | 401 | type: custom |
Petr Michalec | 16cc5c9 | 2018-05-17 09:56:35 +0200 | [diff] [blame] | 402 | #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 | |
azvyagintsev | d786e5f | 2018-11-06 20:57:24 +0200 | [diff] [blame] | 447 | |
| 448 | LVM 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 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 482 | Setup image mirror (Maas boot resources): |
Jiri Broulik | e30a60f | 2018-04-09 21:15:10 +0200 | [diff] [blame] | 483 | |
| 484 | .. code-block:: yaml |
| 485 | |
| 486 | maas: |
| 487 | mirror: |
| 488 | enabled: true |
| 489 | image: |
azvyagintsev | 80f9da7 | 2018-06-01 18:01:45 +0300 | [diff] [blame] | 490 | 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 Broulik | e30a60f | 2018-04-09 21:15:10 +0200 | [diff] [blame] | 498 | xenial: |
azvyagintsev | 80f9da7 | 2018-06-01 18:01:45 +0300 | [diff] [blame] | 499 | 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 Broulik | e30a60f | 2018-04-09 21:15:10 +0200 | [diff] [blame] | 504 | count: 1 |
| 505 | |
azvyagintsev | a1afa85 | 2018-11-19 20:45:18 +0200 | [diff] [blame] | 506 | Usage of local deb repos and curtin-based variables. |
| 507 | |
| 508 | Dict 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 Felkl | ce118a2 | 2017-09-13 11:09:12 +0200 | [diff] [blame] | 511 | |
| 512 | .. code-block:: yaml |
azvyagintsev | 7605a66 | 2017-11-03 19:05:04 +0200 | [diff] [blame] | 513 | |
Richard Felkl | ce118a2 | 2017-09-13 11:09:12 +0200 | [diff] [blame] | 514 | 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 |
azvyagintsev | 06b71e7 | 2017-11-08 17:11:07 +0200 | [diff] [blame] | 525 | ..... |
Richard Felkl | ce118a2 | 2017-09-13 11:09:12 +0200 | [diff] [blame] | 526 | fuBmScum8uQTrEF5+Um5zkwC7EXTdH1co/+/V/fpOtxIg4XO4kcugZefVm5ERfVS |
| 527 | MA== |
| 528 | =dtMN |
| 529 | -----END PGP PUBLIC KEY BLOCK----- |
azvyagintsev | a80fdfb | 2018-07-16 22:34:45 +0300 | [diff] [blame] | 530 | 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" |
azvyagintsev | a1afa85 | 2018-11-19 20:45:18 +0200 | [diff] [blame] | 532 | curtin_vars: |
| 533 | amd64: |
| 534 | xenial: |
| 535 | # List of packages, to be installed directly in curtin stage. |
azvyagintsev | 05393f6 | 2018-11-25 11:15:10 +0200 | [diff] [blame] | 536 | extra_pkgs: |
| 537 | enabled: true |
| 538 | 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] | 539 | # exact kernel pkgs name, to be passed into curtin stage. |
azvyagintsev | 05393f6 | 2018-11-25 11:15:10 +0200 | [diff] [blame] | 540 | kernel_package: |
| 541 | enabled: true |
| 542 | value 'linux-image-virtual-hwe-16.04' |
Richard Felkl | ce118a2 | 2017-09-13 11:09:12 +0200 | [diff] [blame] | 543 | |
Ondrej Smola | 9af2b08 | 2016-08-25 17:37:29 +0200 | [diff] [blame] | 544 | Single MAAS cluster service [multiple racks] |
| 545 | |
| 546 | .. code-block:: yaml |
| 547 | |
| 548 | maas: |
| 549 | cluster: |
| 550 | enabled: true |
Jakub Pavlik | f43512b | 2016-08-30 10:25:42 +0200 | [diff] [blame] | 551 | role: master/slave |
Ondrej Smola | 9af2b08 | 2016-08-25 17:37:29 +0200 | [diff] [blame] | 552 | |
azvyagintsev | 7605a66 | 2017-11-03 19:05:04 +0200 | [diff] [blame] | 553 | .. code-block:: yaml |
| 554 | |
| 555 | maas: |
| 556 | cluster: |
| 557 | enabled: true |
| 558 | role: master/slave |
| 559 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 560 | MAAS region service with backup data: |
Martin Polreich | 0764b76 | 2017-11-20 14:08:30 +0100 | [diff] [blame] | 561 | |
| 562 | .. code-block:: yaml |
azvyagintsev | 80f9da7 | 2018-06-01 18:01:45 +0300 | [diff] [blame] | 563 | |
Martin Polreich | 0764b76 | 2017-11-20 14:08:30 +0100 | [diff] [blame] | 564 | maas: |
| 565 | region: |
| 566 | database: |
| 567 | initial_data: |
| 568 | source: cfg01.local |
| 569 | host: 192.168.0.11 |
| 570 | |
azvyagintsev | 6543ec8 | 2018-11-01 23:45:09 +0200 | [diff] [blame] | 571 | MAAS service power_parameters defintion with OpenStack Nova power_type: |
| 572 | |
| 573 | .. code-block:: yaml |
| 574 | |
| 575 | maas: |
| 576 | region: |
| 577 | machines: |
| 578 | cmp1: |
| 579 | power_type: nova |
| 580 | power_parameters: # old style, deprecated |
| 581 | power_nova_id: hostuuid |
| 582 | power_os_tenantname: tenant |
| 583 | power_os_username: user |
| 584 | power_os_password: password |
| 585 | power_os_authurl: http://url |
| 586 | |
| 587 | |
| 588 | .. code-block:: yaml |
| 589 | |
| 590 | maas: |
| 591 | region: |
| 592 | machines: |
| 593 | cmp1: |
| 594 | power_type: nova |
| 595 | power_parameters: # new style |
| 596 | nova_id: hostuuid |
| 597 | os_tenantname: tenant |
| 598 | os_username: user |
| 599 | os_password: password |
| 600 | os_authurl: http://url |
| 601 | |
Dzmitry Stremkouski | d95bd2e | 2018-12-03 17:35:46 +0100 | [diff] [blame] | 602 | |
| 603 | Ext pillar from MAAS address pool: |
| 604 | ================================== |
| 605 | |
| 606 | Set up salt master: |
| 607 | |
| 608 | .. code-block:: yaml |
| 609 | |
| 610 | salt: |
| 611 | master: |
| 612 | ext_pillars: |
| 613 | 1: |
| 614 | module: cmd_json |
| 615 | params: /usr/share/salt-formulas/env/_modules/maas-IPAM.py --address_pool ${salt:master:pillar:data_dir}/classes/cluster/${_param:cluster_name}/infra/address_pool.yml |
| 616 | |
| 617 | .. code-block:: bash |
| 618 | |
| 619 | salt-call state.apply salt.master |
| 620 | salt '*' saltutil.refresh_pillar |
| 621 | |
| 622 | Update infra/address_pool.yml: |
| 623 | |
| 624 | .. code-block:: yaml |
| 625 | |
| 626 | parameters: |
| 627 | address_pool: |
| 628 | external: |
| 629 | dns_server01: 8.8.8.8 |
| 630 | dns_server02: 8.8.4.4 |
| 631 | upstream_ntp_server: 193.27.208.100 |
| 632 | remote_rsyslog_host: 127.0.0.3 |
| 633 | deploy_network: |
| 634 | address: 192.168.0.0 |
| 635 | netmask: 255.255.255.0 |
| 636 | gateway: 192.168.0.1 |
| 637 | prefix: 24 |
| 638 | vlan: 0 |
| 639 | # Static reservation which interfere with maas reserve pool |
| 640 | reserved: |
| 641 | cmp001_deploy_address: 192.168.0.101 |
| 642 | cmp002_deploy_address: 192.168.0.102 |
| 643 | infra_config_deploy_address: 192.168.0.253 |
| 644 | infra_kvm_node01_deploy_address: 192.168.0.241 |
| 645 | infra_kvm_node02_deploy_address: 192.168.0.242 |
| 646 | infra_kvm_node03_deploy_address: 192.168.0.243 |
| 647 | infra_kvm_node04_deploy_address: 192.168.0.244 |
| 648 | infra_kvm_node05_deploy_address: 192.168.0.245 |
| 649 | infra_kvm_node06_deploy_address: 192.168.0.246 |
| 650 | ldap_ip_address: 192.168.0.249 |
| 651 | pool: |
| 652 | # Static reservation out of maas reserved pool |
| 653 | aptly_server_deploy_address: 192.168.0.252 |
| 654 | # Dynamic serialization |
| 655 | cicd_control_node01_deploy_address: dummy |
| 656 | cicd_control_node02_deploy_address: dummy |
| 657 | cicd_control_node03_deploy_address: dummy |
| 658 | # Release IP address |
| 659 | openstack_share_node02_proxy_address: "" |
| 660 | cluster_networks: |
| 661 | deploy_network: |
| 662 | name: 'deploy_network' |
| 663 | cidr: ${address_pool:deploy_network:address}/${address_pool:deploy_network:prefix} |
| 664 | fabric: deploy_fabric |
| 665 | vlan: ${address_pool:deploy_network:vlan} |
| 666 | gateway_ip: ${address_pool:deploy_network:gateway} |
| 667 | ipranges: |
| 668 | 1: |
| 669 | start: 192.168.0.30 |
| 670 | end: 192.168.0.80 |
| 671 | type: dynamic |
| 672 | comment: 'dynamic range' |
| 673 | 2: |
| 674 | start: 192.168.0.1 |
| 675 | end: 192.168.0.29 |
| 676 | type: reserved |
| 677 | comment: 'infra reserve' |
| 678 | control_network: |
| 679 | name: 'control_network' |
| 680 | cidr: ${address_pool:control_network:address}/${address_pool:control_network:prefix} |
| 681 | fabric: control_fabric |
| 682 | vlan: ${address_pool:control_network:vlan} |
| 683 | gateway_ip: ${address_pool:control_network:address} |
| 684 | |
| 685 | |
| 686 | Update maas.yml: |
| 687 | |
| 688 | .. code-block:: yaml |
| 689 | |
| 690 | maas: |
| 691 | region: |
| 692 | fabrics: |
| 693 | deploy_fabric: |
| 694 | name: ${cluster_networks:deploy_network:fabric} |
| 695 | description: 'Fabric for deploy_network' |
| 696 | vlans: |
| 697 | 0: |
| 698 | name: 'lan 0' |
| 699 | description: Deploy VLAN |
| 700 | dhcp: true |
| 701 | primary_rack: "${linux:network:hostname}" |
| 702 | control_fabric: |
| 703 | name: 'control_fabric' |
| 704 | description: 'Fabric for control_network' |
| 705 | vlans: |
| 706 | 0: |
| 707 | name: ${cluster_networks:control_network:fabric} |
| 708 | description: Control VLAN |
| 709 | dhcp: false |
| 710 | primary_rack: "${linux:network:hostname}" |
| 711 | mesh_fabric: |
| 712 | name: ${cluster_networks:mesh_network:fabric} |
| 713 | description: 'Fabric for mesh_network' |
| 714 | vlans: |
| 715 | 0: |
| 716 | name: 'mesh_network' |
| 717 | description: Mesh VLAN |
| 718 | dhcp: false |
| 719 | primary_rack: "${linux:network:hostname}" |
| 720 | subnets: |
| 721 | deploy_network: ${cluster_networks:deploy_network} |
| 722 | control_network: ${cluster_networks:control_network} |
| 723 | mesh_network: ${cluster_networks:mesh_network} |
| 724 | proxy_network: ${cluster_networks:proxy_network} |
| 725 | |
| 726 | |
| 727 | Populate maas with networks: |
| 728 | |
| 729 | .. code-block:: bash |
| 730 | |
| 731 | salt-call state.apply maas.region |
| 732 | |
| 733 | Serialize ip addresses using maas network pools: |
| 734 | |
| 735 | .. code-block:: bash |
| 736 | |
| 737 | salt-call maasng.sync_address_pool |
| 738 | |
| 739 | Verify pillar override works: |
| 740 | |
| 741 | .. code-block:: bash |
| 742 | |
| 743 | salt-call pillar.get address_pool:deploy_network:pool:openstack_share_node02_deploy_address |
| 744 | |
| 745 | # Sample output: |
| 746 | # local: |
| 747 | # 192.168.0.81 |
| 748 | |
| 749 | |
Petr Michalec | 8a0d52e | 2018-05-30 16:22:56 +0200 | [diff] [blame] | 750 | Test pillars |
| 751 | ============== |
| 752 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 753 | Mind the PostgreSQL and rsyslog ``.sls``. Database and |
| 754 | syslog service are required for MAAS to properly install |
| 755 | and work. |
Petr Michalec | 8a0d52e | 2018-05-30 16:22:56 +0200 | [diff] [blame] | 756 | |
Pavel Cizinsky | a5469f1 | 2018-12-12 12:02:29 +0100 | [diff] [blame] | 757 | * https://gerrit.mcp.mirantis.com/salt-formulas/rsyslog/tree/master/tests/pillar |
Petr Michalec | 8a0d52e | 2018-05-30 16:22:56 +0200 | [diff] [blame] | 758 | |
| 759 | |
azvyagintsev | 7605a66 | 2017-11-03 19:05:04 +0200 | [diff] [blame] | 760 | Module function's example: |
| 761 | ========================== |
| 762 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 763 | Wait for status of selected machine's: |
azvyagintsev | 7605a66 | 2017-11-03 19:05:04 +0200 | [diff] [blame] | 764 | |
| 765 | .. code-block:: bash |
| 766 | |
| 767 | > cat maas/machines/wait_for_machines_ready.sls |
| 768 | |
| 769 | ... |
| 770 | |
| 771 | wait_for_machines_ready: |
| 772 | module.run: |
| 773 | - name: maas.wait_for_machine_status |
| 774 | - kwargs: |
| 775 | machines: |
| 776 | - kvm01 |
| 777 | - kvm02 |
Alexandru Avadanii | 3206fe7 | 2018-09-23 03:57:27 +0200 | [diff] [blame] | 778 | timeout: {{ region.timeout.ready }} |
| 779 | attempts: {{ region.timeout.attempts }} |
azvyagintsev | 7605a66 | 2017-11-03 19:05:04 +0200 | [diff] [blame] | 780 | req_status: "Ready" |
| 781 | - require: |
| 782 | - cmd: maas_login_admin |
| 783 | ... |
| 784 | |
Alexandru Avadanii | 3206fe7 | 2018-09-23 03:57:27 +0200 | [diff] [blame] | 785 | The timeout setting is taken from the reclass pillar data. |
| 786 | If the pillar data is not defined, it will use the default value. |
| 787 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 788 | If module run w/\o any extra paremeters, |
| 789 | ``wait_for_machines_ready`` will wait for defined in salt |
| 790 | machines. In this case, it is usefull to skip some machines: |
azvyagintsev | 7605a66 | 2017-11-03 19:05:04 +0200 | [diff] [blame] | 791 | |
| 792 | .. code-block:: bash |
| 793 | |
| 794 | > cat maas/machines/wait_for_machines_deployed.sls |
| 795 | |
| 796 | ... |
| 797 | |
| 798 | wait_for_machines_ready: |
| 799 | module.run: |
| 800 | - name: maas.wait_for_machine_status |
| 801 | - kwargs: |
Alexandru Avadanii | 3206fe7 | 2018-09-23 03:57:27 +0200 | [diff] [blame] | 802 | timeout: {{ region.timeout.deployed }} |
| 803 | attempts: {{ region.timeout.attempts }} |
Michael Polenchuk | e438bd3 | 2017-11-09 20:42:42 +0400 | [diff] [blame] | 804 | req_status: "Deployed" |
azvyagintsev | 7605a66 | 2017-11-03 19:05:04 +0200 | [diff] [blame] | 805 | ignore_machines: |
| 806 | - kvm01 # in case it's broken or whatever |
| 807 | - require: |
| 808 | - cmd: maas_login_admin |
| 809 | ... |
| 810 | |
Martin Polreich | e3183ad | 2019-10-30 13:01:50 +0100 | [diff] [blame] | 811 | It is also possible to skip all the machines which are already in |
| 812 | the "Deployed" state. This is especially useful when you are adding |
| 813 | new nodes and you don't want to check the already deployed ones. |
| 814 | This can be enabled by setting in the ``ignore_deployed_machines`` |
| 815 | parameter to ``true`` in reclass. |
| 816 | |
| 817 | .. code-block:: bash |
| 818 | |
| 819 | ... |
| 820 | |
| 821 | maas: |
| 822 | region: |
| 823 | ignore_deployed_machines: true |
| 824 | ... |
| 825 | |
OlgaGusarenko | a8b7715 | 2018-07-30 23:33:35 +0300 | [diff] [blame] | 826 | List of available ``req_status`` defined in global variable: |
azvyagintsev | 06b71e7 | 2017-11-08 17:11:07 +0200 | [diff] [blame] | 827 | |
| 828 | .. code-block:: python |
| 829 | |
| 830 | STATUS_NAME_DICT = dict([ |
| 831 | (0, 'New'), (1, 'Commissioning'), (2, 'Failed commissioning'), |
| 832 | (3, 'Missing'), (4, 'Ready'), (5, 'Reserved'), (10, 'Allocated'), |
| 833 | (9, 'Deploying'), (6, 'Deployed'), (7, 'Retired'), (8, 'Broken'), |
| 834 | (11, 'Failed deployment'), (12, 'Releasing'), |
| 835 | (13, 'Releasing failed'), (14, 'Disk erasing'), |
| 836 | (15, 'Failed disk erasing')]) |
azvyagintsev | 7605a66 | 2017-11-03 19:05:04 +0200 | [diff] [blame] | 837 | |
Ales Komarek | ef98269 | 2016-02-21 14:56:07 +0100 | [diff] [blame] | 838 | Read more |
| 839 | ========= |
| 840 | |
Roald Nefs | c86d84a | 2017-10-12 21:19:50 +0200 | [diff] [blame] | 841 | * https://maas.io/ |