Statistics
| Branch: | Tag: | Revision:

root / man / ganeti-extstorage-interface.rst @ 2ab65a5d

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