Statistics
| Branch: | Tag: | Revision:

root / man / ganeti-extstorage-interface.rst @ e715a6d6

History | View | Annotate | Download (9 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 702c3270 Dimitris Aragiorgis
VOL_CNAME
67 702c3270 Dimitris Aragiorgis
    The name of the Disk config object (optional).
68 702c3270 Dimitris Aragiorgis
69 702c3270 Dimitris Aragiorgis
VOL_UUID
70 702c3270 Dimitris Aragiorgis
    The uuid of the Disk config object.
71 702c3270 Dimitris Aragiorgis
72 95b92c34 Constantinos Venetsanopoulos
EXECUTABLE SCRIPTS
73 95b92c34 Constantinos Venetsanopoulos
------------------
74 95b92c34 Constantinos Venetsanopoulos
75 95b92c34 Constantinos Venetsanopoulos
create
76 95b92c34 Constantinos Venetsanopoulos
~~~~~~
77 95b92c34 Constantinos Venetsanopoulos
78 95b92c34 Constantinos Venetsanopoulos
The **create** command is used for creating a new volume inside the
79 95b92c34 Constantinos Venetsanopoulos
external storage. The ``VOL_NAME`` denotes the volume's name, which
80 95b92c34 Constantinos Venetsanopoulos
should be unique. After creation, Ganeti will refer to this volume by
81 95b92c34 Constantinos Venetsanopoulos
this name for all other actions.
82 95b92c34 Constantinos Venetsanopoulos
83 95b92c34 Constantinos Venetsanopoulos
Ganeti produces this name dynamically and ensures its uniqueness inside
84 95b92c34 Constantinos Venetsanopoulos
the Ganeti context. Therefore, you should make sure not to provision
85 95b92c34 Constantinos Venetsanopoulos
manually additional volumes inside the external storage with this type
86 95b92c34 Constantinos Venetsanopoulos
of name, because this will lead to conflicts and possible loss of data.
87 95b92c34 Constantinos Venetsanopoulos
88 95b92c34 Constantinos Venetsanopoulos
The ``VOL_SIZE`` variable denotes the size of the new volume to be
89 95b92c34 Constantinos Venetsanopoulos
created in mebibytes.
90 95b92c34 Constantinos Venetsanopoulos
91 95b92c34 Constantinos Venetsanopoulos
If the script ends successfully, a new volume of size ``VOL_SIZE``
92 95b92c34 Constantinos Venetsanopoulos
should exist inside the external storage. e.g:: a lun inside a NAS
93 95b92c34 Constantinos Venetsanopoulos
appliance.
94 95b92c34 Constantinos Venetsanopoulos
95 95b92c34 Constantinos Venetsanopoulos
The script returns ``0`` on success.
96 95b92c34 Constantinos Venetsanopoulos
97 95b92c34 Constantinos Venetsanopoulos
attach
98 95b92c34 Constantinos Venetsanopoulos
~~~~~~
99 95b92c34 Constantinos Venetsanopoulos
100 95b92c34 Constantinos Venetsanopoulos
This command is used in order to make an already created volume visible
101 95b92c34 Constantinos Venetsanopoulos
to the physical node which will host the instance. This is done by
102 95b92c34 Constantinos Venetsanopoulos
mapping the already provisioned volume to a block device inside the host
103 95b92c34 Constantinos Venetsanopoulos
node.
104 95b92c34 Constantinos Venetsanopoulos
105 95b92c34 Constantinos Venetsanopoulos
The ``VOL_NAME`` variable denotes the volume to be mapped.
106 95b92c34 Constantinos Venetsanopoulos
107 95b92c34 Constantinos Venetsanopoulos
After successful attachment the script returns to its stdout a string,
108 95b92c34 Constantinos Venetsanopoulos
which is the full path of the block device to which the volume is
109 95b92c34 Constantinos Venetsanopoulos
mapped.  e.g:: /dev/dummy1
110 95b92c34 Constantinos Venetsanopoulos
111 95b92c34 Constantinos Venetsanopoulos
When attach returns, this path should be a valid block device on the
112 95b92c34 Constantinos Venetsanopoulos
host node.
113 95b92c34 Constantinos Venetsanopoulos
114 95b92c34 Constantinos Venetsanopoulos
The attach script should be idempotent if the volume is already mapped.
115 95b92c34 Constantinos Venetsanopoulos
If the requested volume is already mapped, then the script should just
116 95b92c34 Constantinos Venetsanopoulos
return to its stdout the path which is already mapped to.
117 95b92c34 Constantinos Venetsanopoulos
118 95b92c34 Constantinos Venetsanopoulos
detach
119 95b92c34 Constantinos Venetsanopoulos
~~~~~~
120 95b92c34 Constantinos Venetsanopoulos
121 95b92c34 Constantinos Venetsanopoulos
This command is used in order to unmap an already mapped volume from the
122 95b92c34 Constantinos Venetsanopoulos
host node. Detach undoes everything attach did. This is done by
123 95b92c34 Constantinos Venetsanopoulos
unmapping the requested volume from the block device it is mapped to.
124 95b92c34 Constantinos Venetsanopoulos
125 95b92c34 Constantinos Venetsanopoulos
The ``VOL_NAME`` variable denotes the volume to be unmapped.
126 95b92c34 Constantinos Venetsanopoulos
127 95b92c34 Constantinos Venetsanopoulos
``detach`` doesn't affect the volume itself. It just unmaps it from the
128 95b92c34 Constantinos Venetsanopoulos
host node. The volume continues to exist inside the external storage.
129 95b92c34 Constantinos Venetsanopoulos
It's just not accessible by the node anymore. This script doesn't return
130 95b92c34 Constantinos Venetsanopoulos
anything to its stdout.
131 95b92c34 Constantinos Venetsanopoulos
132 95b92c34 Constantinos Venetsanopoulos
The detach script should be idempotent if the volume is already
133 95b92c34 Constantinos Venetsanopoulos
unmapped. If the volume is not mapped, the script doesn't perform any
134 95b92c34 Constantinos Venetsanopoulos
action at all.
135 95b92c34 Constantinos Venetsanopoulos
136 95b92c34 Constantinos Venetsanopoulos
The script returns ``0`` on success.
137 95b92c34 Constantinos Venetsanopoulos
138 95b92c34 Constantinos Venetsanopoulos
remove
139 95b92c34 Constantinos Venetsanopoulos
~~~~~~
140 95b92c34 Constantinos Venetsanopoulos
141 95b92c34 Constantinos Venetsanopoulos
This command is used to remove an existing volume from the external
142 95b92c34 Constantinos Venetsanopoulos
storage. The volume is permanently removed from inside the external
143 95b92c34 Constantinos Venetsanopoulos
storage along with all its data.
144 95b92c34 Constantinos Venetsanopoulos
145 95b92c34 Constantinos Venetsanopoulos
The ``VOL_NAME`` variable denotes the volume to be removed.
146 95b92c34 Constantinos Venetsanopoulos
147 95b92c34 Constantinos Venetsanopoulos
The script returns ``0`` on success.
148 95b92c34 Constantinos Venetsanopoulos
149 95b92c34 Constantinos Venetsanopoulos
grow
150 95b92c34 Constantinos Venetsanopoulos
~~~~
151 95b92c34 Constantinos Venetsanopoulos
152 95b92c34 Constantinos Venetsanopoulos
This command is used to grow an existing volume of the external storage.
153 95b92c34 Constantinos Venetsanopoulos
154 95b92c34 Constantinos Venetsanopoulos
The ``VOL_NAME`` variable denotes the volume to grow.
155 95b92c34 Constantinos Venetsanopoulos
156 95b92c34 Constantinos Venetsanopoulos
The ``VOL_SIZE`` variable denotes the current volume's size (in
157 95b92c34 Constantinos Venetsanopoulos
mebibytes). The ``VOL_NEW_SIZE`` variable denotes the final size after
158 95b92c34 Constantinos Venetsanopoulos
the volume has been grown (in mebibytes).
159 95b92c34 Constantinos Venetsanopoulos
160 95b92c34 Constantinos Venetsanopoulos
The amount of grow can be easily calculated by the scipt and is:
161 95b92c34 Constantinos Venetsanopoulos
162 95b92c34 Constantinos Venetsanopoulos
grow_amount = VOL_NEW_SIZE - VOL_SIZE (in mebibytes)
163 95b92c34 Constantinos Venetsanopoulos
164 95b92c34 Constantinos Venetsanopoulos
Ganeti ensures that: ``VOL_NEW_SIZE`` > ``VOL_SIZE``
165 95b92c34 Constantinos Venetsanopoulos
166 95b92c34 Constantinos Venetsanopoulos
If the script returns successfully, then the volume inside the external
167 95b92c34 Constantinos Venetsanopoulos
storage will have a new size of ``VOL_NEW_SIZE``. This isn't immediately
168 95b92c34 Constantinos Venetsanopoulos
reflected to the instance's disk. See ``gnt-instance grow`` for more
169 95b92c34 Constantinos Venetsanopoulos
details on when the running instance becomes aware of its grown disk.
170 95b92c34 Constantinos Venetsanopoulos
171 95b92c34 Constantinos Venetsanopoulos
The script returns ``0`` on success.
172 95b92c34 Constantinos Venetsanopoulos
173 855f9bad Constantinos Venetsanopoulos
setinfo
174 855f9bad Constantinos Venetsanopoulos
~~~~~~~
175 855f9bad Constantinos Venetsanopoulos
176 855f9bad Constantinos Venetsanopoulos
This script is used to add metadata to an existing volume. It is helpful
177 855f9bad Constantinos Venetsanopoulos
when we need to keep an external, Ganeti-independent mapping between
178 855f9bad Constantinos Venetsanopoulos
instances and volumes; primarily for recovery reasons. This is provider
179 855f9bad Constantinos Venetsanopoulos
specific and the author of the provider chooses whether/how to implement
180 855f9bad Constantinos Venetsanopoulos
this. You can just exit with ``0``, if you do not want to implement this
181 855f9bad Constantinos Venetsanopoulos
feature, without harming the overall functionality of the provider.
182 855f9bad Constantinos Venetsanopoulos
183 855f9bad Constantinos Venetsanopoulos
The ``VOL_METADATA`` variable contains the metadata of the volume.
184 855f9bad Constantinos Venetsanopoulos
185 855f9bad Constantinos Venetsanopoulos
Currently, Ganeti sets this value to ``originstname+X`` where ``X`` is
186 855f9bad Constantinos Venetsanopoulos
the instance's name.
187 855f9bad Constantinos Venetsanopoulos
188 855f9bad Constantinos Venetsanopoulos
The script returns ``0`` on success.
189 855f9bad Constantinos Venetsanopoulos
190 95b92c34 Constantinos Venetsanopoulos
verify
191 95b92c34 Constantinos Venetsanopoulos
~~~~~~
192 95b92c34 Constantinos Venetsanopoulos
193 95b92c34 Constantinos Venetsanopoulos
The *verify* script is used to verify consistency of the external
194 95b92c34 Constantinos Venetsanopoulos
parameters (ext-params) (see below). The command should take one or more
195 95b92c34 Constantinos Venetsanopoulos
arguments denoting what checks should be performed, and return a proper
196 95b92c34 Constantinos Venetsanopoulos
exit code depending on whether the validation failed or succeeded.
197 95b92c34 Constantinos Venetsanopoulos
198 95b92c34 Constantinos Venetsanopoulos
Currently, the script is not invoked by Ganeti, but should be present
199 95b92c34 Constantinos Venetsanopoulos
for future use and consistency with gnt-os-interface's verify script.
200 95b92c34 Constantinos Venetsanopoulos
201 95b92c34 Constantinos Venetsanopoulos
The script should return ``0`` on success.
202 95b92c34 Constantinos Venetsanopoulos
203 95b92c34 Constantinos Venetsanopoulos
TEXT FILES
204 95b92c34 Constantinos Venetsanopoulos
----------
205 95b92c34 Constantinos Venetsanopoulos
206 95b92c34 Constantinos Venetsanopoulos
parameters.list
207 95b92c34 Constantinos Venetsanopoulos
~~~~~~~~~~~~~~~
208 95b92c34 Constantinos Venetsanopoulos
209 95b92c34 Constantinos Venetsanopoulos
This file declares the parameters supported by the ExtStorage provider,
210 95b92c34 Constantinos Venetsanopoulos
one parameter per line, with name and description (space and/or tab
211 95b92c34 Constantinos Venetsanopoulos
separated). For example::
212 95b92c34 Constantinos Venetsanopoulos
213 95b92c34 Constantinos Venetsanopoulos
    fromsnap Snapshot name to create the volume from
214 95b92c34 Constantinos Venetsanopoulos
    nas_ip The IP of the NAS appliance
215 95b92c34 Constantinos Venetsanopoulos
216 95b92c34 Constantinos Venetsanopoulos
The parameters can then be used during instance add as follows::
217 95b92c34 Constantinos Venetsanopoulos
218 95b92c34 Constantinos Venetsanopoulos
    # gnt-instance add --disk=0:fromsnap="file_name",nas_ip="1.2.3.4" ...
219 95b92c34 Constantinos Venetsanopoulos
220 e19f7095 Constantinos Venetsanopoulos
EXAMPLES
221 e19f7095 Constantinos Venetsanopoulos
--------
222 e19f7095 Constantinos Venetsanopoulos
223 e19f7095 Constantinos Venetsanopoulos
In the following examples we assume that you have already installed
224 e19f7095 Constantinos Venetsanopoulos
successfully two ExtStorage providers: ``pvdr1`` and ``pvdr2``
225 e19f7095 Constantinos Venetsanopoulos
226 e19f7095 Constantinos Venetsanopoulos
Add a new instance with a 10G first disk provided by ``pvdr1`` and a 20G
227 e19f7095 Constantinos Venetsanopoulos
second disk provided by ``pvdr2``::
228 e19f7095 Constantinos Venetsanopoulos
229 e19f7095 Constantinos Venetsanopoulos
    # gnt-instance add -t ext --disk=0:size=10G,provider=pvdr1
230 e19f7095 Constantinos Venetsanopoulos
                              --disk=1:size=20G,provider=pvdr2
231 e19f7095 Constantinos Venetsanopoulos
232 e19f7095 Constantinos Venetsanopoulos
Add a new instance with a 5G first disk provided by provider ``pvdr1``
233 e19f7095 Constantinos Venetsanopoulos
and also pass the ``prm1``, ``prm2`` parameters to the provider, with
234 e19f7095 Constantinos Venetsanopoulos
the corresponding values ``val1``, ``val2``::
235 e19f7095 Constantinos Venetsanopoulos
236 e19f7095 Constantinos Venetsanopoulos
   # gnt-instance add -t ext
237 e19f7095 Constantinos Venetsanopoulos
                      --disk=0:size=5G,provider=pvdr1,prm1=val1,prm2=val2
238 e19f7095 Constantinos Venetsanopoulos
239 e19f7095 Constantinos Venetsanopoulos
Modify an existing instance of disk type ``ext`` by adding a new 30G
240 e19f7095 Constantinos Venetsanopoulos
disk provided by provider ``pvdr2``::
241 e19f7095 Constantinos Venetsanopoulos
242 e19f7095 Constantinos Venetsanopoulos
   # gnt-instance modify --disk 1:add,size=30G,provider=pvdr2 <instance>
243 e19f7095 Constantinos Venetsanopoulos
244 e19f7095 Constantinos Venetsanopoulos
Modify an existing instance of disk type ``ext`` by adding 2 new disks,
245 e19f7095 Constantinos Venetsanopoulos
of different providers, passing one parameter for the first one::
246 e19f7095 Constantinos Venetsanopoulos
247 e19f7095 Constantinos Venetsanopoulos
   # gnt-instance modify --disk 2:add,size=3G,provider=pvdr1,prm1=val1
248 e19f7095 Constantinos Venetsanopoulos
                         --disk 3:add,size=5G,provider=pvdr2
249 e19f7095 Constantinos Venetsanopoulos
                         <instance>
250 e19f7095 Constantinos Venetsanopoulos
251 95b92c34 Constantinos Venetsanopoulos
NOTES
252 95b92c34 Constantinos Venetsanopoulos
-----
253 95b92c34 Constantinos Venetsanopoulos
254 95b92c34 Constantinos Venetsanopoulos
Backwards compatibility
255 95b92c34 Constantinos Venetsanopoulos
~~~~~~~~~~~~~~~~~~~~~~~
256 95b92c34 Constantinos Venetsanopoulos
257 855f9bad Constantinos Venetsanopoulos
The ExtStorage Interface was introduced in Ganeti 2.7.
258 855f9bad Constantinos Venetsanopoulos
Ganeti 2.7 and up is compatible with the ExtStorage Interface.
259 95b92c34 Constantinos Venetsanopoulos
260 95b92c34 Constantinos Venetsanopoulos
Common behaviour
261 95b92c34 Constantinos Venetsanopoulos
~~~~~~~~~~~~~~~~
262 95b92c34 Constantinos Venetsanopoulos
263 95b92c34 Constantinos Venetsanopoulos
All the scripts should display an usage message when called with a wrong
264 95b92c34 Constantinos Venetsanopoulos
number of arguments or when the first argument is ``-h`` or ``--help``.
265 95b92c34 Constantinos Venetsanopoulos
266 95b92c34 Constantinos Venetsanopoulos
.. vim: set textwidth=72 :
267 95b92c34 Constantinos Venetsanopoulos
.. Local Variables:
268 95b92c34 Constantinos Venetsanopoulos
.. mode: rst
269 95b92c34 Constantinos Venetsanopoulos
.. fill-column: 72
270 95b92c34 Constantinos Venetsanopoulos
.. End: