Revision d1b1deb4

b/man/ganeti-os-interface.rst
9 9
DESCRIPTION
10 10
-----------
11 11

  
12
The method of supporting guest operating systems in Ganeti is to
13
have, for each guest OS type, a directory containing a number of
14
required files.
12
The method of supporting guest operating systems in Ganeti is to have,
13
for each guest OS type, a directory containing a number of required
14
files. This directory must be present across all nodes (Ganeti doesn't
15
replicate it) in order for the OS to be usable by Ganeti.
16

  
15 17

  
16 18
REFERENCE
17 19
---------
18 20

  
19
There are six required files: *create*, *import*, *export*, *rename*
20
(executables), *ganeti_api_version* and *variants.list* (text files).
21
There are six required files: *create*, *import*, *export*, *rename*,
22
*verify* (executables), *ganeti_api_version*, *variants.list* and
23
*parameters.list* (text files).
21 24

  
22 25
Common environment
23 26
~~~~~~~~~~~~~~~~~~
......
27 30
of them might have extra ones. Note that all counts are
28 31
zero-based.
29 32

  
30

  
31

  
32 33
OS_API_VERSION
33 34
    The OS API version that the rest of the environment conforms to.
34 35

  
......
111 112
    instance, this can be one of: ``rtl8139``, ``ne2k_pci``,
112 113
    ``ne2k_isa``, ``paravirtual``.
113 114

  
115
OSP_*name*
116
    Each OS parameter (see below) will be exported in its own
117
    variable, prefixed with ``OSP``, and upper-cased. For example, a
118
    ``dhcp`` parameter will be exported as ``OSP_DHCP``.
119

  
114 120
DEBUG_LEVEL
115 121
    If non-zero, this should cause the OS script to generate verbose
116 122
    logs of its execution, for troubleshooting purposes. Currently
117 123
    only ``0`` and ``1`` are valid values.
118 124

  
119 125

  
126
EXECUTABLE SCRIPTS
127
------------------
128

  
129

  
120 130
create
121 131
~~~~~~
122 132

  
......
194 204
IP address of the instance, leaving the administrator to update the
195 205
other services.
196 206

  
207
verify
208
~~~~~~
209

  
210
The *verify* script is used to verify consistency of the OS parameters
211
(see below). The command should take one or more arguments denoting
212
what checks should be performed, and return a proper exit code
213
depending on whether the validation failed or succeeded.
214

  
215
Currently (API version 20), only one parameter is supported:
216
``parameters``. This should validate the ``OSP_`` variables from the
217
environment, and output diagnostic message in case the validation
218
fails.
219

  
220
.. highlight:: sh
221

  
222
For the ``dhcp`` parameter given as example above, a verification
223
script could be::
224

  
225
    #!/bin/sh
226

  
227
    case $OSP_DHCP in
228
        ""|yes|no)
229
            ;;
230
        *)
231
            echo "Invalid value '$OSP_DHCP' for the dhcp parameter" 1>&2
232
            exit 1;
233
            ;;
234
    esac
235

  
236
    exit 0
237

  
238

  
239
TEXT FILES
240
----------
241

  
242

  
197 243
ganeti_api_version
198 244
~~~~~~~~~~~~~~~~~~
199 245

  
......
213 259
supported variants for this OS, one per line. At least one variant
214 260
must be supported.
215 261

  
262
parameters.list
263
~~~~~~~~~~~~~~~
264

  
265
This file declares the parameters supported by the OS, one parameter
266
per line, with name and description (space and/or tab separated). For
267
example::
268

  
269
    dhcp Whether to enable (yes) or disable (no) dhcp
270
    root_size The size of the root partition, in GiB
271

  
272
The parameters can then be used in instance add or modification, as
273
follows::
274

  
275
    # gnt-instance add -O dhcp=no,root_size=8 …
276

  
277

  
216 278
NOTES
217 279
-----
218 280

  
219 281
Backwards compatibility
220 282
~~~~~~~~~~~~~~~~~~~~~~~
221 283

  
222
Ganeti 2.2 is compatible with both API version 10, and 15. In API
223
version 10 the variants.list file is ignored and no OS_VARIANT
224
environment variable is passed.
284
Ganeti 2.3 and up is compatible with API version 10, 15 and 20. The OS
285
parameters and related scripts (verify) are only supported in
286
version 20. The variants functionality (variants.list, and OS_VARIANT
287
env. var) are supported/present only in version 15 and up.
225 288

  
226 289
Common behaviour
227 290
~~~~~~~~~~~~~~~~
......
233 296
Upgrading from old versions
234 297
~~~~~~~~~~~~~~~~~~~~~~~~~~~
235 298

  
299
Version 15 to 20
300
^^^^^^^^^^^^^^^^
301

  
302
The ``parameters.list`` file and ``verify`` script have been
303
added. For no parameters, an empty parameters file and an empty verify
304
script which returns success can be used.
305

  
236 306
Version 10 to 15
237 307
^^^^^^^^^^^^^^^^
238 308

  

Also available in: Unified diff