Statistics
| Branch: | Tag: | Revision:

root / man / ganeti-extstorage-interface.rst @ 4ab75599

History | View | Annotate | Download (7.8 kB)

1 95b92c34 Constantinos Venetsanopoulos
ganeti-extstorage-interface(7) Ganeti | Version @GANETI_VERSION@
2 95b92c34 Constantinos Venetsanopoulos
================================================================
3 95b92c34 Constantinos Venetsanopoulos
4 95b92c34 Constantinos Venetsanopoulos
Name
5 95b92c34 Constantinos Venetsanopoulos
----
6 95b92c34 Constantinos Venetsanopoulos
7 95b92c34 Constantinos Venetsanopoulos
ganeti-extstorage-interface - Specifications for ExtStorage providers
8 95b92c34 Constantinos Venetsanopoulos
9 95b92c34 Constantinos Venetsanopoulos
DESCRIPTION
10 95b92c34 Constantinos Venetsanopoulos
-----------
11 95b92c34 Constantinos Venetsanopoulos
12 95b92c34 Constantinos Venetsanopoulos
The method for supporting external shared storage in Ganeti is to have
13 95b92c34 Constantinos Venetsanopoulos
an ExtStorage provider for each external shared storage hardware type.
14 95b92c34 Constantinos Venetsanopoulos
The ExtStorage provider is a set of files (executable scripts and text
15 95b92c34 Constantinos Venetsanopoulos
files), contained inside a directory which is named after the provider.
16 95b92c34 Constantinos Venetsanopoulos
This directory must be present across all nodes of a nodegroup (Ganeti
17 95b92c34 Constantinos Venetsanopoulos
doesn't replicate it), in order for the provider to be usable by Ganeti
18 95b92c34 Constantinos Venetsanopoulos
for this nodegroup (valid). The external shared storage hardware should
19 95b92c34 Constantinos Venetsanopoulos
also be accessible by all nodes of this nodegroup too.
20 95b92c34 Constantinos Venetsanopoulos
21 95b92c34 Constantinos Venetsanopoulos
REFERENCE
22 95b92c34 Constantinos Venetsanopoulos
---------
23 95b92c34 Constantinos Venetsanopoulos
24 855f9bad Constantinos Venetsanopoulos
There are eight required files: *create*, *attach*, *detach*, *remove*,
25 855f9bad Constantinos Venetsanopoulos
*grow*, *setinfo*, *verify* (executables) and *parameters.list*
26 855f9bad Constantinos Venetsanopoulos
(text file).
27 95b92c34 Constantinos Venetsanopoulos
28 95b92c34 Constantinos Venetsanopoulos
Common environment
29 95b92c34 Constantinos Venetsanopoulos
~~~~~~~~~~~~~~~~~~
30 95b92c34 Constantinos Venetsanopoulos
31 95b92c34 Constantinos Venetsanopoulos
All commands will get their input via environment variables. A common
32 95b92c34 Constantinos Venetsanopoulos
set of variables will be exported for all commands, and some of them
33 95b92c34 Constantinos Venetsanopoulos
might have extra ones. Note that all counts are zero-based.
34 95b92c34 Constantinos Venetsanopoulos
35 95b92c34 Constantinos Venetsanopoulos
Since Ganeti version 2.5, the environment will be cleaned up before
36 95b92c34 Constantinos Venetsanopoulos
being passed to scripts, therefore they will not inherit the environment
37 95b92c34 Constantinos Venetsanopoulos
in with which the ganeti node daemon was started. If you depend on any
38 95b92c34 Constantinos Venetsanopoulos
environment variables (non-Ganeti), then you will need to define or
39 95b92c34 Constantinos Venetsanopoulos
source them appropriately.
40 95b92c34 Constantinos Venetsanopoulos
41 95b92c34 Constantinos Venetsanopoulos
VOL_NAME
42 95b92c34 Constantinos Venetsanopoulos
    The name of the volume. This is unique for Ganeti and it uses it
43 95b92c34 Constantinos Venetsanopoulos
    to refer to a specific volume inside the external storage. Its
44 95b92c34 Constantinos Venetsanopoulos
    format is ``UUID.ext.diskX`` where ``UUID`` is produced by Ganeti
45 95b92c34 Constantinos Venetsanopoulos
    and is unique inside the Ganeti context. ``X`` is the number of the
46 95b92c34 Constantinos Venetsanopoulos
    disk count.
47 95b92c34 Constantinos Venetsanopoulos
48 95b92c34 Constantinos Venetsanopoulos
VOL_SIZE
49 95b92c34 Constantinos Venetsanopoulos
    The volume's size in mebibytes.
50 95b92c34 Constantinos Venetsanopoulos
51 95b92c34 Constantinos Venetsanopoulos
VOL_NEW_SIZE
52 95b92c34 Constantinos Venetsanopoulos
    Available only to the **grow** script. It declares the new size of
53 95b92c34 Constantinos Venetsanopoulos
    the volume after grow (in mebibytes). To find the amount of grow,
54 95b92c34 Constantinos Venetsanopoulos
    the scipt should calculate the number VOL_NEW_SIZE - VOL_SIZE.
55 95b92c34 Constantinos Venetsanopoulos
56 95b92c34 Constantinos Venetsanopoulos
EXTP_*name*
57 95b92c34 Constantinos Venetsanopoulos
    Each ExtStorage parameter (see below) will be exported in its own
58 95b92c34 Constantinos Venetsanopoulos
    variable, prefixed with ``EXTP_``, and upper-cased. For example, a
59 95b92c34 Constantinos Venetsanopoulos
    ``fromsnap`` parameter will be exported as ``EXTP_FROMSNAP``.
60 95b92c34 Constantinos Venetsanopoulos
61 855f9bad Constantinos Venetsanopoulos
VOL_METADATA
62 855f9bad Constantinos Venetsanopoulos
    Available only to the **setinfo** script. A string containing
63 855f9bad Constantinos Venetsanopoulos
    metadata to be associated with the volume. Currently, Ganeti sets
64 855f9bad Constantinos Venetsanopoulos
    this value to ``originstname+X`` where ``X`` is the instance's name.
65 855f9bad Constantinos Venetsanopoulos
66 95b92c34 Constantinos Venetsanopoulos
EXECUTABLE SCRIPTS
67 95b92c34 Constantinos Venetsanopoulos
------------------
68 95b92c34 Constantinos Venetsanopoulos
69 95b92c34 Constantinos Venetsanopoulos
70 95b92c34 Constantinos Venetsanopoulos
create
71 95b92c34 Constantinos Venetsanopoulos
~~~~~~
72 95b92c34 Constantinos Venetsanopoulos
73 95b92c34 Constantinos Venetsanopoulos
The **create** command is used for creating a new volume inside the
74 95b92c34 Constantinos Venetsanopoulos
external storage. The ``VOL_NAME`` denotes the volume's name, which
75 95b92c34 Constantinos Venetsanopoulos
should be unique. After creation, Ganeti will refer to this volume by
76 95b92c34 Constantinos Venetsanopoulos
this name for all other actions.
77 95b92c34 Constantinos Venetsanopoulos
78 95b92c34 Constantinos Venetsanopoulos
Ganeti produces this name dynamically and ensures its uniqueness inside
79 95b92c34 Constantinos Venetsanopoulos
the Ganeti context. Therefore, you should make sure not to provision
80 95b92c34 Constantinos Venetsanopoulos
manually additional volumes inside the external storage with this type
81 95b92c34 Constantinos Venetsanopoulos
of name, because this will lead to conflicts and possible loss of data.
82 95b92c34 Constantinos Venetsanopoulos
83 95b92c34 Constantinos Venetsanopoulos
The ``VOL_SIZE`` variable denotes the size of the new volume to be
84 95b92c34 Constantinos Venetsanopoulos
created in mebibytes.
85 95b92c34 Constantinos Venetsanopoulos
86 95b92c34 Constantinos Venetsanopoulos
If the script ends successfully, a new volume of size ``VOL_SIZE``
87 95b92c34 Constantinos Venetsanopoulos
should exist inside the external storage. e.g:: a lun inside a NAS
88 95b92c34 Constantinos Venetsanopoulos
appliance.
89 95b92c34 Constantinos Venetsanopoulos
90 95b92c34 Constantinos Venetsanopoulos
The script returns ``0`` on success.
91 95b92c34 Constantinos Venetsanopoulos
92 95b92c34 Constantinos Venetsanopoulos
attach
93 95b92c34 Constantinos Venetsanopoulos
~~~~~~
94 95b92c34 Constantinos Venetsanopoulos
95 95b92c34 Constantinos Venetsanopoulos
This command is used in order to make an already created volume visible
96 95b92c34 Constantinos Venetsanopoulos
to the physical node which will host the instance. This is done by
97 95b92c34 Constantinos Venetsanopoulos
mapping the already provisioned volume to a block device inside the host
98 95b92c34 Constantinos Venetsanopoulos
node.
99 95b92c34 Constantinos Venetsanopoulos
100 95b92c34 Constantinos Venetsanopoulos
The ``VOL_NAME`` variable denotes the volume to be mapped.
101 95b92c34 Constantinos Venetsanopoulos
102 95b92c34 Constantinos Venetsanopoulos
After successful attachment the script returns to its stdout a string,
103 95b92c34 Constantinos Venetsanopoulos
which is the full path of the block device to which the volume is
104 95b92c34 Constantinos Venetsanopoulos
mapped.  e.g:: /dev/dummy1
105 95b92c34 Constantinos Venetsanopoulos
106 95b92c34 Constantinos Venetsanopoulos
When attach returns, this path should be a valid block device on the
107 95b92c34 Constantinos Venetsanopoulos
host node.
108 95b92c34 Constantinos Venetsanopoulos
109 95b92c34 Constantinos Venetsanopoulos
The attach script should be idempotent if the volume is already mapped.
110 95b92c34 Constantinos Venetsanopoulos
If the requested volume is already mapped, then the script should just
111 95b92c34 Constantinos Venetsanopoulos
return to its stdout the path which is already mapped to.
112 95b92c34 Constantinos Venetsanopoulos
113 95b92c34 Constantinos Venetsanopoulos
detach
114 95b92c34 Constantinos Venetsanopoulos
~~~~~~
115 95b92c34 Constantinos Venetsanopoulos
116 95b92c34 Constantinos Venetsanopoulos
This command is used in order to unmap an already mapped volume from the
117 95b92c34 Constantinos Venetsanopoulos
host node. Detach undoes everything attach did. This is done by
118 95b92c34 Constantinos Venetsanopoulos
unmapping the requested volume from the block device it is mapped to.
119 95b92c34 Constantinos Venetsanopoulos
120 95b92c34 Constantinos Venetsanopoulos
The ``VOL_NAME`` variable denotes the volume to be unmapped.
121 95b92c34 Constantinos Venetsanopoulos
122 95b92c34 Constantinos Venetsanopoulos
``detach`` doesn't affect the volume itself. It just unmaps it from the
123 95b92c34 Constantinos Venetsanopoulos
host node. The volume continues to exist inside the external storage.
124 95b92c34 Constantinos Venetsanopoulos
It's just not accessible by the node anymore. This script doesn't return
125 95b92c34 Constantinos Venetsanopoulos
anything to its stdout.
126 95b92c34 Constantinos Venetsanopoulos
127 95b92c34 Constantinos Venetsanopoulos
The detach script should be idempotent if the volume is already
128 95b92c34 Constantinos Venetsanopoulos
unmapped. If the volume is not mapped, the script doesn't perform any
129 95b92c34 Constantinos Venetsanopoulos
action at all.
130 95b92c34 Constantinos Venetsanopoulos
131 95b92c34 Constantinos Venetsanopoulos
The script returns ``0`` on success.
132 95b92c34 Constantinos Venetsanopoulos
133 95b92c34 Constantinos Venetsanopoulos
remove
134 95b92c34 Constantinos Venetsanopoulos
~~~~~~
135 95b92c34 Constantinos Venetsanopoulos
136 95b92c34 Constantinos Venetsanopoulos
This command is used to remove an existing volume from the external
137 95b92c34 Constantinos Venetsanopoulos
storage. The volume is permanently removed from inside the external
138 95b92c34 Constantinos Venetsanopoulos
storage along with all its data.
139 95b92c34 Constantinos Venetsanopoulos
140 95b92c34 Constantinos Venetsanopoulos
The ``VOL_NAME`` variable denotes the volume to be removed.
141 95b92c34 Constantinos Venetsanopoulos
142 95b92c34 Constantinos Venetsanopoulos
The script returns ``0`` on success.
143 95b92c34 Constantinos Venetsanopoulos
144 95b92c34 Constantinos Venetsanopoulos
grow
145 95b92c34 Constantinos Venetsanopoulos
~~~~
146 95b92c34 Constantinos Venetsanopoulos
147 95b92c34 Constantinos Venetsanopoulos
This command is used to grow an existing volume of the external storage.
148 95b92c34 Constantinos Venetsanopoulos
149 95b92c34 Constantinos Venetsanopoulos
The ``VOL_NAME`` variable denotes the volume to grow.
150 95b92c34 Constantinos Venetsanopoulos
151 95b92c34 Constantinos Venetsanopoulos
The ``VOL_SIZE`` variable denotes the current volume's size (in
152 95b92c34 Constantinos Venetsanopoulos
mebibytes). The ``VOL_NEW_SIZE`` variable denotes the final size after
153 95b92c34 Constantinos Venetsanopoulos
the volume has been grown (in mebibytes).
154 95b92c34 Constantinos Venetsanopoulos
155 95b92c34 Constantinos Venetsanopoulos
The amount of grow can be easily calculated by the scipt and is:
156 95b92c34 Constantinos Venetsanopoulos
157 95b92c34 Constantinos Venetsanopoulos
grow_amount = VOL_NEW_SIZE - VOL_SIZE (in mebibytes)
158 95b92c34 Constantinos Venetsanopoulos
159 95b92c34 Constantinos Venetsanopoulos
Ganeti ensures that: ``VOL_NEW_SIZE`` > ``VOL_SIZE``
160 95b92c34 Constantinos Venetsanopoulos
161 95b92c34 Constantinos Venetsanopoulos
If the script returns successfully, then the volume inside the external
162 95b92c34 Constantinos Venetsanopoulos
storage will have a new size of ``VOL_NEW_SIZE``. This isn't immediately
163 95b92c34 Constantinos Venetsanopoulos
reflected to the instance's disk. See ``gnt-instance grow`` for more
164 95b92c34 Constantinos Venetsanopoulos
details on when the running instance becomes aware of its grown disk.
165 95b92c34 Constantinos Venetsanopoulos
166 95b92c34 Constantinos Venetsanopoulos
The script returns ``0`` on success.
167 95b92c34 Constantinos Venetsanopoulos
168 855f9bad Constantinos Venetsanopoulos
setinfo
169 855f9bad Constantinos Venetsanopoulos
~~~~~~~
170 855f9bad Constantinos Venetsanopoulos
171 855f9bad Constantinos Venetsanopoulos
This script is used to add metadata to an existing volume. It is helpful
172 855f9bad Constantinos Venetsanopoulos
when we need to keep an external, Ganeti-independent mapping between
173 855f9bad Constantinos Venetsanopoulos
instances and volumes; primarily for recovery reasons. This is provider
174 855f9bad Constantinos Venetsanopoulos
specific and the author of the provider chooses whether/how to implement
175 855f9bad Constantinos Venetsanopoulos
this. You can just exit with ``0``, if you do not want to implement this
176 855f9bad Constantinos Venetsanopoulos
feature, without harming the overall functionality of the provider.
177 855f9bad Constantinos Venetsanopoulos
178 855f9bad Constantinos Venetsanopoulos
The ``VOL_METADATA`` variable contains the metadata of the volume.
179 855f9bad Constantinos Venetsanopoulos
180 855f9bad Constantinos Venetsanopoulos
Currently, Ganeti sets this value to ``originstname+X`` where ``X`` is
181 855f9bad Constantinos Venetsanopoulos
the instance's name.
182 855f9bad Constantinos Venetsanopoulos
183 855f9bad Constantinos Venetsanopoulos
The script returns ``0`` on success.
184 855f9bad Constantinos Venetsanopoulos
185 95b92c34 Constantinos Venetsanopoulos
verify
186 95b92c34 Constantinos Venetsanopoulos
~~~~~~
187 95b92c34 Constantinos Venetsanopoulos
188 95b92c34 Constantinos Venetsanopoulos
The *verify* script is used to verify consistency of the external
189 95b92c34 Constantinos Venetsanopoulos
parameters (ext-params) (see below). The command should take one or more
190 95b92c34 Constantinos Venetsanopoulos
arguments denoting what checks should be performed, and return a proper
191 95b92c34 Constantinos Venetsanopoulos
exit code depending on whether the validation failed or succeeded.
192 95b92c34 Constantinos Venetsanopoulos
193 95b92c34 Constantinos Venetsanopoulos
Currently, the script is not invoked by Ganeti, but should be present
194 95b92c34 Constantinos Venetsanopoulos
for future use and consistency with gnt-os-interface's verify script.
195 95b92c34 Constantinos Venetsanopoulos
196 95b92c34 Constantinos Venetsanopoulos
The script should return ``0`` on success.
197 95b92c34 Constantinos Venetsanopoulos
198 95b92c34 Constantinos Venetsanopoulos
TEXT FILES
199 95b92c34 Constantinos Venetsanopoulos
----------
200 95b92c34 Constantinos Venetsanopoulos
201 95b92c34 Constantinos Venetsanopoulos
202 95b92c34 Constantinos Venetsanopoulos
parameters.list
203 95b92c34 Constantinos Venetsanopoulos
~~~~~~~~~~~~~~~
204 95b92c34 Constantinos Venetsanopoulos
205 95b92c34 Constantinos Venetsanopoulos
This file declares the parameters supported by the ExtStorage provider,
206 95b92c34 Constantinos Venetsanopoulos
one parameter per line, with name and description (space and/or tab
207 95b92c34 Constantinos Venetsanopoulos
separated). For example::
208 95b92c34 Constantinos Venetsanopoulos
209 95b92c34 Constantinos Venetsanopoulos
    fromsnap Snapshot name to create the volume from
210 95b92c34 Constantinos Venetsanopoulos
    nas_ip The IP of the NAS appliance
211 95b92c34 Constantinos Venetsanopoulos
212 95b92c34 Constantinos Venetsanopoulos
The parameters can then be used during instance add as follows::
213 95b92c34 Constantinos Venetsanopoulos
214 95b92c34 Constantinos Venetsanopoulos
    # gnt-instance add --disk=0:fromsnap="file_name",nas_ip="1.2.3.4" ...
215 95b92c34 Constantinos Venetsanopoulos
216 95b92c34 Constantinos Venetsanopoulos
NOTES
217 95b92c34 Constantinos Venetsanopoulos
-----
218 95b92c34 Constantinos Venetsanopoulos
219 95b92c34 Constantinos Venetsanopoulos
Backwards compatibility
220 95b92c34 Constantinos Venetsanopoulos
~~~~~~~~~~~~~~~~~~~~~~~
221 95b92c34 Constantinos Venetsanopoulos
222 855f9bad Constantinos Venetsanopoulos
The ExtStorage Interface was introduced in Ganeti 2.7.
223 855f9bad Constantinos Venetsanopoulos
Ganeti 2.7 and up is compatible with the ExtStorage Interface.
224 95b92c34 Constantinos Venetsanopoulos
225 95b92c34 Constantinos Venetsanopoulos
Common behaviour
226 95b92c34 Constantinos Venetsanopoulos
~~~~~~~~~~~~~~~~
227 95b92c34 Constantinos Venetsanopoulos
228 95b92c34 Constantinos Venetsanopoulos
All the scripts should display an usage message when called with a wrong
229 95b92c34 Constantinos Venetsanopoulos
number of arguments or when the first argument is ``-h`` or ``--help``.
230 95b92c34 Constantinos Venetsanopoulos
231 95b92c34 Constantinos Venetsanopoulos
.. vim: set textwidth=72 :
232 95b92c34 Constantinos Venetsanopoulos
.. Local Variables:
233 95b92c34 Constantinos Venetsanopoulos
.. mode: rst
234 95b92c34 Constantinos Venetsanopoulos
.. fill-column: 72
235 95b92c34 Constantinos Venetsanopoulos
.. End: