Statistics
| Branch: | Tag: | Revision:

root / man / gnt-backup.sgml @ 41b10cf6

History | View | Annotate | Download (14.5 kB)

1
<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
2

    
3
  <!-- Fill in your name for FIRSTNAME and SURNAME. -->
4
  <!-- Please adjust the date whenever revising the manpage. -->
5
  <!ENTITY dhdate      "<date>February 11, 2009</date>">
6
  <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
7
       allowed: see man(7), man(1). -->
8
  <!ENTITY dhsection   "<manvolnum>8</manvolnum>">
9
  <!ENTITY dhucpackage "<refentrytitle>gnt-backup</refentrytitle>">
10
  <!ENTITY dhpackage   "gnt-backup">
11

    
12
  <!ENTITY debian      "<productname>Debian</productname>">
13
  <!ENTITY gnu         "<acronym>GNU</acronym>">
14
  <!ENTITY gpl         "&gnu; <acronym>GPL</acronym>">
15
  <!ENTITY footer SYSTEM "footer.sgml">
16
]>
17

    
18
<refentry>
19
  <refentryinfo>
20
    <copyright>
21
      <year>2007</year>
22
      <year>2008</year>
23
      <year>2009</year>
24
      <year>2010</year>
25
      <holder>Google Inc.</holder>
26
    </copyright>
27
    &dhdate;
28
  </refentryinfo>
29
  <refmeta>
30
    &dhucpackage;
31

    
32
    &dhsection;
33
    <refmiscinfo>ganeti 2.1</refmiscinfo>
34
  </refmeta>
35
  <refnamediv>
36
    <refname>&dhpackage;</refname>
37

    
38
    <refpurpose>ganeti instance import/export</refpurpose>
39
  </refnamediv>
40
  <refsynopsisdiv>
41
    <cmdsynopsis>
42
      <command>&dhpackage; </command>
43

    
44
      <arg choice="req">command</arg>
45
      <arg>arguments...</arg>
46
    </cmdsynopsis>
47
  </refsynopsisdiv>
48
  <refsect1>
49
    <title>DESCRIPTION</title>
50

    
51
    <para>
52
      The <command>&dhpackage;</command> is used for importing and exporting
53
      instances and their configuration from a ganeti system. It is useful for
54
      backing instances up and also to migrate them between clusters.
55
    </para>
56

    
57
  </refsect1>
58
  <refsect1>
59
    <title>COMMANDS</title>
60

    
61
    <refsect2>
62
      <title>EXPORT</title>
63

    
64
      <cmdsynopsis>
65
        <command>export</command>
66
        <arg choice="req">-n <replaceable>node</replaceable></arg>
67
        <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
68
        <arg>--noshutdown</arg>
69
        <arg choice="req"><replaceable>instance</replaceable></arg>
70

    
71
      </cmdsynopsis>
72

    
73
      <para>
74
        Exports an instance to the target node. All the instance data
75
        and its configuration will be exported under the
76
        /srv/ganeti/export/<replaceable>instance</replaceable>
77
        directory on the target node.
78
      </para>
79

    
80
      <para>
81
        The <option>--shutdown-timeout</option> is used to specify how
82
        much time to wait before forcing the shutdown (xm destroy in xen,
83
        killing the kvm process, for kvm). By default two minutes are
84
        given to each instance to stop.
85
      </para>
86

    
87
      <para>
88
        The <option>--noshutdown</option> option will create a
89
        snapshot disk of the instance without shutting it down first.
90
        While this is faster and involves no downtime, it cannot be
91
        guaranteed that the instance data will be in a consistent state
92
        in the exported dump.
93
      </para>
94

    
95
      <para>
96
        The exit code of the command is 0 if all disks were backed up
97
        successfully, 1 if no data was backed up or if the
98
        configuration export failed, and 2 if just some of the disks
99
        failed to backup. The exact details of the failures will be
100
        shown during the command execution (and will be stored in the
101
        job log). It is recommended that for any non-zero exit code,
102
        the backup is considered invalid, and retried.
103
      </para>
104

    
105
      <para>
106
        Example:
107
        <screen>
108
# gnt-backup export -n node1.example.com instance3.example.com
109
        </screen>
110
      </para>
111
    </refsect2>
112

    
113
    <refsect2>
114
      <title>IMPORT</title>
115
      <cmdsynopsis>
116
        <command>import</command>
117
        <sbr>
118
        <group choice="req">
119
          <arg>-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg> <arg>--iallocator
120
          <replaceable>name</replaceable></arg>
121
        </group>
122
        <sbr>
123

    
124
        <arg rep="repeat">--disk <replaceable>N</replaceable>:size=<replaceable>VAL</replaceable><arg>,mode=<replaceable>ro|rw</replaceable></arg></arg>
125
        <sbr>
126
        <group>
127
          <arg rep="repeat">--net <replaceable>N</replaceable><arg rep="repeat">:options</arg></arg>
128
          <arg>--no-nics</arg>
129
        </group>
130
        <sbr>
131
        <arg>-B <replaceable>BEPARAMS</replaceable></arg>
132
        <sbr>
133
        <arg>-H <replaceable>HYPERVISOR</replaceable><arg>:<arg choice="plain" rep="repeat">option=<replaceable>value</replaceable></arg></arg></arg>
134
        <sbr>
135
        <arg>--src-node=<replaceable>source-node</replaceable></arg>
136
        <arg>--src-dir=<replaceable>source-dir</replaceable></arg>
137
        <sbr>
138

    
139
        <arg choice="opt">-t<group>
140
            <arg>diskless</arg>
141
            <arg>plain</arg>
142
            <arg>drbd</arg>
143
            <arg>file</arg>
144
          </group></arg>
145
        <sbr>
146

    
147
        <arg choice="opt">--identify-defaults</arg>
148
        <sbr>
149

    
150
        <arg choice="req"><replaceable>instance</replaceable></arg>
151
      </cmdsynopsis>
152

    
153
      <para>
154
        Imports a new instance from an export residing on
155
        <replaceable>source-node</replaceable> in
156
        <replaceable>source-dir</replaceable>.
157
        <replaceable>instance</replaceable> must be in DNS and resolve
158
        to a IP in the same network as the nodes in the cluster. If
159
        the source node and directory are not passed, the last backup
160
        in the cluster is used, as visible with the
161
        <command>list</command> command.
162
      </para>
163

    
164
      <para>
165
        The <option>disk</option> option specifies the parameters for
166
        the disks of the instance. The numbering of disks starts at
167
        zero. For each disk, at least the size needs to be given, and
168
        optionally the access mode (read-only or the default of
169
        read-write) can also be specified.  The size is interpreted
170
        (when no unit is given) in mebibytes. You can also use one of
171
        the suffixes
172
        <literal>m</literal>, <literal>g</literal> or
173
        <literal>t</literal> to specificy the exact the units used;
174
        these suffixes map to mebibytes, gibibytes and tebibytes.
175
      </para>
176

    
177
      <para>
178
        Alternatively, a single-disk instance can be created via the
179
        <option>-s</option> option which takes a single argument,
180
        the size of the disk. This is similar to the Ganeti 1.2
181
        version (but will only create one disk).
182
      </para>
183

    
184
      <para>
185
        If no disk information is passed, the disk configuration saved
186
        at export time will be used.
187
      </para>
188

    
189
      <para>
190
        The minimum disk specification is therefore empty (export
191
        information will be used), a single disk can be specified as
192
        <userinput>--disk 0:size=20G</userinput> (or <userinput>-s
193
          20G</userinput> when using the <option>-s</option> option),
194
        and a three-disk instance can be specified as
195
        <userinput>--disk 0:size=20G --disk 1:size=4G --disk
196
          2:size=100G</userinput>.
197
      </para>
198

    
199
      <para>
200
        The NICs of the instances can be specified via the
201
        <option>--net</option> option. By default, the NIC
202
        configuration of the original (exported) instance will be
203
        reused. Each NIC can take up to three parameters (all
204
        optional):
205
        <variablelist>
206
          <varlistentry>
207
            <term>mac</term>
208
            <listitem>
209
              <simpara>either a value or <constant>GENERATE</constant>
210
              to generate a new unique MAC, or
211
              <constant>AUTO</constant> to reuse the old MAC</simpara>
212
            </listitem>
213
          </varlistentry>
214
          <varlistentry>
215
            <term>ip</term>
216
            <listitem>
217
              <simpara>specifies the IP address assigned to the
218
              instance from the Ganeti side (this is not necessarily
219
              what the instance will use, but what the node expects
220
              the instance to use)</simpara>
221
            </listitem>
222
          </varlistentry>
223
            <varlistentry>
224
              <term>mode</term>
225
              <listitem>
226
                <simpara>specifies the connection mode for this nic:
227
                  routed or bridged.</simpara>
228
              </listitem>
229
            </varlistentry>
230
            <varlistentry>
231
              <term>link</term>
232
              <listitem>
233
                <simpara>in bridged mode specifies the bridge to attach
234
                  this NIC to, in routed mode it's intended to
235
                  differentiate between different routing tables/instance
236
                  groups (but the meaning is dependent on the network
237
                  script, see gnt-cluster(8) for more details)</simpara>
238
              </listitem>
239
            </varlistentry>
240
          </variablelist>
241
          Of these "mode" and "link" are nic parameters, and inherit their
242
          default at cluster level.
243
      </para>
244

    
245
      <para>
246
        If no network is desired for the instance, you should create a
247
        single empty NIC and delete it afterwards
248
        via <command>gnt-instance modify --net delete</command>.
249
      </para>
250

    
251
      <para>
252
        The <option>-B</option> option specifies the backend
253
        parameters for the instance. If no such parameters are
254
        specified, the values are inherited from the export. Possible
255
        parameters are:
256
        <variablelist>
257
          <varlistentry>
258
            <term>memory</term>
259
            <listitem>
260
              <simpara>the memory size of the instance; as usual,
261
              suffixes can be used to denote the unit, otherwise the
262
              value is taken in mebibites</simpara>
263
            </listitem>
264
          </varlistentry>
265
          <varlistentry>
266
            <term>vcpus</term>
267
            <listitem>
268
              <simpara>the number of VCPUs to assign to the instance
269
              (if this value makes sense for the hypervisor)</simpara>
270
            </listitem>
271
          </varlistentry>
272
          <varlistentry>
273
            <term>auto_balance</term>
274
            <listitem>
275
              <simpara>whether the instance is considered in the N+1
276
              cluster checks (enough redundancy in the cluster to
277
              survive a node failure)</simpara>
278
            </listitem>
279
          </varlistentry>
280
        </variablelist>
281
      </para>
282

    
283
      <para>
284
        The <option>-t</option> options specifies the disk layout type
285
        for the instance. If not passed, the configuration of the
286
        original instance is used. The available choices are:
287
        <variablelist>
288
          <varlistentry>
289
            <term>diskless</term>
290
            <listitem>
291
              <para>
292
                This creates an instance with no disks. Its useful for
293
                testing only (or other special cases).
294
              </para>
295
            </listitem>
296
          </varlistentry>
297
          <varlistentry>
298
            <term>plain</term>
299
            <listitem>
300
              <para>Disk devices will be logical volumes.</para>
301
            </listitem>
302
          </varlistentry>
303
          <varlistentry>
304
            <term>drbd</term>
305
            <listitem>
306
              <para>
307
                Disk devices will be drbd (version 8.x) on top of lvm
308
                volumes.
309
              </para>
310
            </listitem>
311
          </varlistentry>
312
          <varlistentry>
313
            <term>file</term>
314
            <listitem>
315
              <para>Disk devices will be backed up by files, under the
316
              <filename
317
              class="directory">@RPL_FILE_STORAGE_DIR@</filename>. By
318
              default, each instance will get a directory (as its own
319
              name) under this path, and each disk is stored as
320
              individual files in this (instance-specific)
321
              directory.</para>
322
            </listitem>
323
          </varlistentry>
324
        </variablelist>
325
      </para>
326

    
327
      <para>
328
        The <option>--iallocator</option> option specifies the instance
329
        allocator plugin to use. If you pass in this option the allocator will
330
        select nodes for this instance automatically, so you don't need to pass
331
        them with the <option>-n</option> option. For more information please
332
        refer to the instance allocator documentation.
333
      </para>
334

    
335
      <para>
336
        The optional second value of the <option>--node</option> is used for
337
        the drbd template and specifies the remote node.
338
      </para>
339

    
340
      <para>
341
        Since many of the parameters are by default read from the
342
        exported instance information and used as such, the new
343
        instance will have all parameters explicitly specified, the
344
        opposite of a newly added instance which has most parameters
345
        specified via cluster defaults. To change the import behaviour
346
        to recognize parameters whose saved value matches the current
347
        cluster default and mark it as such (default value), pass
348
        the <option>--identify-defaults</option> option. This will
349
        affect the hypervisor, backend and NIC parameters, both read
350
        from the export file and passed in via the command line.
351
      </para>
352

    
353
      <para>
354
        Example for identical instance import:
355
        <screen>
356
# gnt-backup import -n node1.example.com instance3.example.com
357
        </screen>
358
      </para>
359
      <para>
360
        Explicit configuration example:
361
        <screen>
362
# gnt-backup import -t plain --disk 0:size=1G -B memory=512 \
363
> -n node1.example.com \
364
> instance3.example.com
365
        </screen>
366
      </para>
367

    
368
    </refsect2>
369

    
370
    <refsect2>
371
      <title>LIST</title>
372

    
373
      <cmdsynopsis>
374
        <command>list</command>
375
        <arg>--node=<replaceable>NODE</replaceable></arg>
376
      </cmdsynopsis>
377

    
378
      <para>
379
        Lists the exports currently available in the default directory
380
        in all the nodes of the current cluster, or optionally only a
381
        subset of them specified using the <option>--node</option>
382
        option (which can be used multiple times)
383
      </para>
384

    
385
      <para>
386
      Example:
387
<screen>
388
# gnt-backup list --nodes node1 --nodes node2
389
</screen>
390
      </para>
391
    </refsect2>
392

    
393
    <refsect2>
394
      <title>REMOVE</title>
395
      <cmdsynopsis>
396
        <command>remove</command>
397
        <arg choice="req">instance_name</arg>
398
      </cmdsynopsis>
399

    
400
      <para>
401
        Removes the backup for the given instance name, if any. If the
402
        backup was for a deleted instances, it is needed to pass the
403
        <acronym>FQDN</acronym> of the instance, and not only the
404
        short hostname.
405
      </para>
406

    
407
    </refsect2>
408

    
409
  </refsect1>
410

    
411
  &footer;
412

    
413
</refentry>
414

    
415
<!-- Keep this comment at the end of the file
416
Local variables:
417
mode: sgml
418
sgml-omittag:t
419
sgml-shorttag:t
420
sgml-minimize-attributes:nil
421
sgml-always-quote-attributes:t
422
sgml-indent-step:2
423
sgml-indent-data:t
424
sgml-parent-document:nil
425
sgml-default-dtd-file:nil
426
sgml-exposed-tags:nil
427
sgml-local-catalogs:nil
428
sgml-local-ecat-files:nil
429
End:
430
-->