blob: 4382320d18ea039a5666b11c2623633dc5a83cef [file] [log] [blame]
Ales Komarekef982692016-02-21 14:56:07 +01001
2==================
smolaon552ba582016-02-23 20:35:42 +01003Metal as a Service
Ales Komarekef982692016-02-21 14:56:07 +01004==================
5
6Service maas description
7
8Sample pillars
9==============
10
11Single maas service
12
13.. code-block:: yaml
14
15 maas:
16 server:
17 enabled: true
18
Ondrej Smola9af2b082016-08-25 17:37:29 +020019Single MAAS region service [single UI/API]
20
21.. code-block:: yaml
22
Damian Szelugaa8248102017-03-16 08:48:51 +010023 maas:
Damian Szeluga336ff2e2017-03-30 11:19:34 +020024 salt_master_ip: 192.168.0.10
Damian Szelugaa8248102017-03-16 08:48:51 +010025 region:
Jiri Broulik0df14bc2017-08-07 10:01:55 +020026 upstream_proxy:
27 address: 10.0.0.1
28 port: 8080
Ondrej Smola3ffb6312017-09-22 17:13:10 +020029 user: username #OPTIONAL
30 password: password #OPTIONAL
Damian Szelugaa8248102017-03-16 08:48:51 +010031 theme: mirantis
32 bind:
33 host: 192.168.0.10:5240
34 port: 5240
35 admin:
36 username: exampleuser
37 password: examplepassword
38 email: email@example.com
39 database:
40 engine: null
41 host: localhost
42 name: maasdb
43 password: qwqwqw
44 username: maas
45 enabled: true
46 user: mirantis
47 token: "89EgtWkX45ddjMYpuL:SqVjxFG87Dr6kVf4Wp:5WLfbUgmm9XQtJxm3V2LUUy7bpCmqmnk"
48 fabrics:
azvyagintsev06b71e72017-11-08 17:11:07 +020049 test-fabric1:
50 description: "Test fabric"
51 test-fabric2:
52 description: "Test fabric2"
Damian Szelugaa8248102017-03-16 08:48:51 +010053 subnets:
54 subnet1:
azvyagintsev06b71e72017-11-08 17:11:07 +020055 fabric: test-fabric1
Damian Szelugaa8248102017-03-16 08:48:51 +010056 cidr: 2.2.3.0/24
57 gateway_ip: 2.2.3.2
azvyagintsev06b71e72017-11-08 17:11:07 +020058 iprange: # reserved range for DHCP\auto mapping
Damian Szelugaa8248102017-03-16 08:48:51 +010059 start: 2.2.3.20
60 end: 2.2.3.250
61 dhcp_snippets:
62 test-snippet:
63 value: option bootfile-name "tftp://192.168.0.10/snippet";
64 description: Test snippet
65 enabled: true
66 subnet: subnet1
67 boot_resources:
68 bootscript1:
69 title: bootscript
70 architecture: amd64/generic
71 filetype: tgz
72 content: /srv/salt/reclass/nodes/path_to_file
73 package_repositories:
74 Saltstack:
75 url: http://repo.saltstack.com/apt/ubuntu/14.04/amd64/2016.3/
76 distributions:
77 - trusty
78 components:
79 - main
Damian Szelugaa8248102017-03-16 08:48:51 +010080 arches: amd64
81 key: "-----BEGIN PGP PUBLIC KEY BLOCK-----
82 Version: GnuPG v2
Pavel Cizinsky5a6e2722016-08-31 15:58:13 +020083
Damian Szelugaa8248102017-03-16 08:48:51 +010084 mQENBFOpvpgBCADkP656H41i8fpplEEB8IeLhugyC2rTEwwSclb8tQNYtUiGdna9
azvyagintsev06b71e72017-11-08 17:11:07 +020085 ......
Damian Szelugaa8248102017-03-16 08:48:51 +010086 fuBmScum8uQTrEF5+Um5zkwC7EXTdH1co/+/V/fpOtxIg4XO4kcugZefVm5ERfVS
87 MA==
88 =dtMN
89 -----END PGP PUBLIC KEY BLOCK-----"
90 enabled: true
91 machines:
azvyagintsev06b71e72017-11-08 17:11:07 +020092 machine1_new_schema:
93 pxe_interface_mac: "11:22:33:44:55:66" # Node will be identified by those mac
94 interfaces:
95 nic01: # could be any, used for iterate only
96 type: eth # NotImplemented
97 name: eth0 # Override default nic name. Interface to rename will be identified by mac
98 mac: "11:22:33:44:55:66"
99 mode: "static"
100 ip: "2.2.3.19" # ip should be out of reserved subnet range, but still in subnet range
101 subnet: "subnet1"
102 gateway: "2.2.3.2" # override default gateway from subnet
103 nic02:
104 type: eth # Not-implemented
105 mac: "11:22:33:44:55:78"
106 subnet: "subnet2"
107 mode: "dhcp"
Damian Szelugaa8248102017-03-16 08:48:51 +0100108 power_parameters:
109 power_type: ipmi
110 power_address: '192.168.10.10'
111 power_user: bmc_user
112 power_password: bmc_password
Ondrej Smola455003c2017-06-01 22:53:39 +0200113 #Optional (for legacy HW)
114 power_driver: LAN
azvyagintsev06b71e72017-11-08 17:11:07 +0200115 distro_series: xenial
116 hwe_kernel: hwe-16.04
117 machine1_old_schema:
118 interface:
119 mac: "11:22:33:44:55:88" # Node will be identified by those mac
120 mode: "static"
121 ip: "2.2.3.15"
122 subnet: "subnet1"
123 gateway: "2.2.3.2"
124 power_parameters:
125 power_type: ipmi
126 power_address: '192.168.10.10'
127 power_user: bmc_user
128 power_password: bmc_password
129 #Optional (for legacy HW)
130 power_driver: LAN
131 # FIXME: that's should be moved into another,livirt example.
Petr Ruzicka5fe96742017-11-10 14:22:24 +0100132 # Used in case of power_type: virsh
133 power_id: my_libvirt_vm_name
Maciej Relewicz37b12a22017-04-25 15:23:16 +0200134 distro_series: xenial
135 hwe_kernel: hwe-16.04
Damian Szelugaa8248102017-03-16 08:48:51 +0100136 devices:
137 machine1-ipmi:
138 interface:
139 ip_address: 192.168.10.10
140 subnet: cidr:192.168.10.0/24
141 mac: '66:55:44:33:22:11'
Damian Szeluga336ff2e2017-03-30 11:19:34 +0200142 commissioning_scripts:
azvyagintsevec61dd62017-11-16 19:12:05 +0200143 00-maas-05-simplify-network-interfaces: /etc/maas/files/commisioning_scripts/00-maas-05-simplify-network-interfaces
Damian Szeluga336ff2e2017-03-30 11:19:34 +0200144 maas_config:
145 domain: mydomain.local
146 http_proxy: http://192.168.0.10:3142
147 commissioning_distro_series: xenial
148 default_distro_series: xenial
149 default_osystem: 'ubuntu'
150 default_storage_layout: lvm
151 disk_erase_with_secure_erase: true
152 dnssec_validation: 'no'
153 enable_third_party_drivers: true
154 maas_name: cfg01
155 network_discovery: 'enabled'
156 active_discovery_interval: '600'
157 ntp_external_only: true
158 ntp_servers: 10.10.11.23 10.10.11.24
159 upstream_dns: 192.168.12.13
160 enable_http_proxy: true
161 default_min_hwe_kernel: ''
162 sshprefs:
azvyagintsev06b71e72017-11-08 17:11:07 +0200163 - 'ssh-rsa ASD.........dfsadf blah@blah'
Ondrej Smola9af2b082016-08-25 17:37:29 +0200164
165
Ondrej Smolab57a23b2018-01-24 11:18:24 +0100166Create disk schema per machine via maas/client.sls with default lvm schema + default values
167
168NOTE: This should be used mostly for custom root partitioning and RAID configuration. For not-root partitions please use salt-formulas/salt-formula-linux.
169
170.. code-block:: yaml
171
172 maas:
173 region:
174 machines:
175 server1:
176 disk_layout:
177 type: lvm
178 root_size: 20G
179 root_device: vda
180 volume_group: vg1
181 volume_name: root
182 volume_size: 8
183 bootable_device: vda
184
185FLAT layout with custom root size
186
187.. code-block:: yaml
188
189 maas:
190 region:
191 machines:
192 server2:
193 disk_layout:
194 type: flat
195 root_size: 20
196 physical_device: vda
197 bootable_device: vda
198
199Define more complex layout
200
201.. code-block:: yaml
202
203 maas:
204 region:
205 machines:
206 server3:
207 disk_layout:
208 type: flat #This is simplies setup
209 bootable_device: vda
210 disk:
211 vda:
212 type: physical
213 partition_schema:
214 part1:
215 size: 10G
216 type: ext4
217 mount: '/'
218 part2:
219 size: 2G
220 part3:
221 size: 3G
222 vdc:
223 type: physical
224 partition_schema:
225 part1:
226 size: 100%
227 vdd:
228 type: physical
229 partition_schema:
230 part1:
231 size: 100%
232 raid0:
233 type: raid
234 level: 10
235 devices:
236 - vde
237 - vdf
238 partition_schema:
239 part1:
240 size: 10G
241 part2:
242 size: 2G
243 part3:
244 size: 3G
245 raid1:
246 type: raid
247 level: 1
248 partitions:
249 - vdc-part1
250 - vdd-part1
251 volume_group2:
252 type: lvm
253 devices:
254 - raid1
255 volume:
256 tmp:
257 size: 5G
258 fs_type: ext4
259 mount: '/tmp'
260 log:
261 size: 7G
262 fs_type: ext4
263 mount: '/var/log'
azvyagintsev7605a662017-11-03 19:05:04 +0200264
Richard Felklce118a22017-09-13 11:09:12 +0200265Usage of local repos
266
267.. code-block:: yaml
azvyagintsev7605a662017-11-03 19:05:04 +0200268
Richard Felklce118a22017-09-13 11:09:12 +0200269 maas:
270 cluster:
271 enabled: true
272 region:
273 port: 80
274 host: localhost
275 saltstack_repo_key: |
276 -----BEGIN PGP PUBLIC KEY BLOCK-----
277 Version: GnuPG v2
278
279 mQENBFOpvpgBCADkP656H41i8fpplEEB8IeLhugyC2rTEwwSclb8tQNYtUiGdna9
azvyagintsev06b71e72017-11-08 17:11:07 +0200280 .....
Richard Felklce118a22017-09-13 11:09:12 +0200281 fuBmScum8uQTrEF5+Um5zkwC7EXTdH1co/+/V/fpOtxIg4XO4kcugZefVm5ERfVS
282 MA==
283 =dtMN
284 -----END PGP PUBLIC KEY BLOCK-----
285 saltstack_repo_xenial: "http://${_param:local_repo_url}/ubuntu-xenial stable salt"
286 saltstack_repo_trusty: "http://${_param:local_repo_url}/ubuntu-trusty stable salt"
287
Ondrej Smola9af2b082016-08-25 17:37:29 +0200288Single MAAS cluster service [multiple racks]
289
290.. code-block:: yaml
291
292 maas:
293 cluster:
294 enabled: true
Jakub Pavlikf43512b2016-08-30 10:25:42 +0200295 role: master/slave
Ondrej Smola9af2b082016-08-25 17:37:29 +0200296
azvyagintsev7605a662017-11-03 19:05:04 +0200297.. code-block:: yaml
298
299 maas:
300 cluster:
301 enabled: true
302 role: master/slave
303
Martin Polreich0764b762017-11-20 14:08:30 +0100304MAAS region service with backup data
305
306.. code-block:: yaml
307 maas:
308 region:
309 database:
310 initial_data:
311 source: cfg01.local
312 host: 192.168.0.11
313
azvyagintsev7605a662017-11-03 19:05:04 +0200314Module function's example:
315==========================
316
317* Wait for status of selected machine's:
318
319.. code-block:: bash
320
321 > cat maas/machines/wait_for_machines_ready.sls
322
323 ...
324
325 wait_for_machines_ready:
326 module.run:
327 - name: maas.wait_for_machine_status
328 - kwargs:
329 machines:
330 - kvm01
331 - kvm02
332 timeout: 1200 # in seconds
333 req_status: "Ready"
334 - require:
335 - cmd: maas_login_admin
336 ...
337
338If module run w/\o any extra paremeters - `wait_for_machines_ready` will wait for defined in salt machines. In those case, will be usefull to skip some machines:
339
340.. code-block:: bash
341
342 > cat maas/machines/wait_for_machines_deployed.sls
343
344 ...
345
346 wait_for_machines_ready:
347 module.run:
348 - name: maas.wait_for_machine_status
349 - kwargs:
350 timeout: 1200 # in seconds
Michael Polenchuke438bd32017-11-09 20:42:42 +0400351 req_status: "Deployed"
azvyagintsev7605a662017-11-03 19:05:04 +0200352 ignore_machines:
353 - kvm01 # in case it's broken or whatever
354 - require:
355 - cmd: maas_login_admin
356 ...
357
azvyagintsev06b71e72017-11-08 17:11:07 +0200358List of available `req_status` defined in global variable:
359
360.. code-block:: python
361
362 STATUS_NAME_DICT = dict([
363 (0, 'New'), (1, 'Commissioning'), (2, 'Failed commissioning'),
364 (3, 'Missing'), (4, 'Ready'), (5, 'Reserved'), (10, 'Allocated'),
365 (9, 'Deploying'), (6, 'Deployed'), (7, 'Retired'), (8, 'Broken'),
366 (11, 'Failed deployment'), (12, 'Releasing'),
367 (13, 'Releasing failed'), (14, 'Disk erasing'),
368 (15, 'Failed disk erasing')])
azvyagintsev7605a662017-11-03 19:05:04 +0200369
370
Ales Komarekef982692016-02-21 14:56:07 +0100371Read more
372=========
373
Roald Nefsc86d84a2017-10-12 21:19:50 +0200374* https://maas.io/
Filip Pytlounc07d2352017-02-02 13:02:03 +0100375
376Documentation and Bugs
377======================
378
379To learn how to install and update salt-formulas, consult the documentation
380available online at:
381
382 http://salt-formulas.readthedocs.io/
383
384In the unfortunate event that bugs are discovered, they should be reported to
385the appropriate issue tracker. Use Github issue tracker for specific salt
386formula:
387
388 https://github.com/salt-formulas/salt-formula-maas/issues
389
390For feature requests, bug reports or blueprints affecting entire ecosystem,
391use Launchpad salt-formulas project:
392
393 https://launchpad.net/salt-formulas
394
395You can also join salt-formulas-users team and subscribe to mailing list:
396
397 https://launchpad.net/~salt-formulas-users
398
399Developers wishing to work on the salt-formulas projects should always base
400their work on master branch and submit pull request against specific formula.
401
402 https://github.com/salt-formulas/salt-formula-maas
403
404Any questions or feedback is always welcome so feel free to join our IRC
405channel:
406
Martin Polreich0764b762017-11-20 14:08:30 +0100407 #salt-formulas @ irc.freenode.net