Statistics
| Branch: | Tag: | Revision:

root / man / gnt-backup.sgml @ e0897adf

History | View | Annotate | Download (14.8 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>June 08, 2010</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.2</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 up instances 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>--remove-instance</arg>
70
        <arg>--ignore-remove-failures</arg>
71
        <arg choice="req"><replaceable>instance</replaceable></arg>
72

    
73
      </cmdsynopsis>
74

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

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

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

    
97
      <para>
98
        The <option>--remove</option> option can be used to remove the
99
        instance after it was exported. This is useful to make one last
100
        backup before removing the instance.
101
      </para>
102

    
103
      <para>
104
        The exit code of the command is 0 if all disks were backed up
105
        successfully, 1 if no data was backed up or if the
106
        configuration export failed, and 2 if just some of the disks
107
        failed to backup. The exact details of the failures will be
108
        shown during the command execution (and will be stored in the
109
        job log). It is recommended that for any non-zero exit code,
110
        the backup is considered invalid, and retried.
111
      </para>
112

    
113
      <para>
114
        Example:
115
        <screen>
116
# gnt-backup export -n node1.example.com instance3.example.com
117
        </screen>
118
      </para>
119
    </refsect2>
120

    
121
    <refsect2>
122
      <title>IMPORT</title>
123
      <cmdsynopsis>
124
        <command>import</command>
125
        <sbr>
126
        <group choice="req">
127
          <arg>-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg> <arg>--iallocator
128
          <replaceable>name</replaceable></arg>
129
        </group>
130
        <sbr>
131

    
132
        <arg rep="repeat">--disk <replaceable>N</replaceable>:size=<replaceable>VAL</replaceable><arg>,mode=<replaceable>ro|rw</replaceable></arg></arg>
133
        <sbr>
134
        <group>
135
          <arg rep="repeat">--net <replaceable>N</replaceable><arg rep="repeat">:options</arg></arg>
136
          <arg>--no-nics</arg>
137
        </group>
138
        <sbr>
139
        <arg>-B <replaceable>BEPARAMS</replaceable></arg>
140
        <sbr>
141
        <arg>-H <replaceable>HYPERVISOR</replaceable><arg>:<arg choice="plain" rep="repeat">option=<replaceable>value</replaceable></arg></arg></arg>
142
        <sbr>
143
        <arg>--src-node=<replaceable>source-node</replaceable></arg>
144
        <arg>--src-dir=<replaceable>source-dir</replaceable></arg>
145
        <sbr>
146

    
147
        <arg choice="opt">-t<group>
148
            <arg>diskless</arg>
149
            <arg>plain</arg>
150
            <arg>drbd</arg>
151
            <arg>file</arg>
152
          </group></arg>
153
        <sbr>
154

    
155
        <arg choice="opt">--identify-defaults</arg>
156
        <sbr>
157

    
158
        <arg choice="req"><replaceable>instance</replaceable></arg>
159
      </cmdsynopsis>
160

    
161
      <para>
162
        Imports a new instance from an export residing on
163
        <replaceable>source-node</replaceable> in
164
        <replaceable>source-dir</replaceable>.
165
        <replaceable>instance</replaceable> must be in DNS and resolve
166
        to a IP in the same network as the nodes in the cluster. If
167
        the source node and directory are not passed, the last backup
168
        in the cluster is used, as visible with the
169
        <command>list</command> command.
170
      </para>
171

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

    
185
      <para>
186
        Alternatively, a single-disk instance can be created via the
187
        <option>-s</option> option which takes a single argument,
188
        the size of the disk. This is similar to the Ganeti 1.2
189
        version (but will only create one disk).
190
      </para>
191

    
192
      <para>
193
        If no disk information is passed, the disk configuration saved
194
        at export time will be used.
195
      </para>
196

    
197
      <para>
198
        The minimum disk specification is therefore empty (export
199
        information will be used), a single disk can be specified as
200
        <userinput>--disk 0:size=20G</userinput> (or <userinput>-s
201
          20G</userinput> when using the <option>-s</option> option),
202
        and a three-disk instance can be specified as
203
        <userinput>--disk 0:size=20G --disk 1:size=4G --disk
204
          2:size=100G</userinput>.
205
      </para>
206

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

    
253
      <para>
254
        If no network is desired for the instance, you should create a
255
        single empty NIC and delete it afterwards
256
        via <command>gnt-instance modify --net delete</command>.
257
      </para>
258

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

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

    
335
      <para>
336
        The <option>--iallocator</option> option specifies the instance
337
        allocator plugin to use. If you pass in this option the allocator will
338
        select nodes for this instance automatically, so you don't need to pass
339
        them with the <option>-n</option> option. For more information please
340
        refer to the instance allocator documentation.
341
      </para>
342

    
343
      <para>
344
        The optional second value of the <option>--node</option> is used for
345
        the drbd template and specifies the remote node.
346
      </para>
347

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

    
361
      <para>
362
        Example for identical instance import:
363
        <screen>
364
# gnt-backup import -n node1.example.com instance3.example.com
365
        </screen>
366
      </para>
367
      <para>
368
        Explicit configuration example:
369
        <screen>
370
# gnt-backup import -t plain --disk 0:size=1G -B memory=512 \
371
> -n node1.example.com \
372
> instance3.example.com
373
        </screen>
374
      </para>
375

    
376
    </refsect2>
377

    
378
    <refsect2>
379
      <title>LIST</title>
380

    
381
      <cmdsynopsis>
382
        <command>list</command>
383
        <arg>--node=<replaceable>NODE</replaceable></arg>
384
      </cmdsynopsis>
385

    
386
      <para>
387
        Lists the exports currently available in the default directory
388
        in all the nodes of the current cluster, or optionally only a
389
        subset of them specified using the <option>--node</option>
390
        option (which can be used multiple times)
391
      </para>
392

    
393
      <para>
394
      Example:
395
<screen>
396
# gnt-backup list --nodes node1 --nodes node2
397
</screen>
398
      </para>
399
    </refsect2>
400

    
401
    <refsect2>
402
      <title>REMOVE</title>
403
      <cmdsynopsis>
404
        <command>remove</command>
405
        <arg choice="req">instance_name</arg>
406
      </cmdsynopsis>
407

    
408
      <para>
409
        Removes the backup for the given instance name, if any. If the
410
        backup was for a deleted instances, it is needed to pass the
411
        <acronym>FQDN</acronym> of the instance, and not only the
412
        short hostname.
413
      </para>
414

    
415
    </refsect2>
416

    
417
  </refsect1>
418

    
419
  &footer;
420

    
421
</refentry>
422

    
423
<!-- Keep this comment at the end of the file
424
Local variables:
425
mode: sgml
426
sgml-omittag:t
427
sgml-shorttag:t
428
sgml-minimize-attributes:nil
429
sgml-always-quote-attributes:t
430
sgml-indent-step:2
431
sgml-indent-data:t
432
sgml-parent-document:nil
433
sgml-default-dtd-file:nil
434
sgml-exposed-tags:nil
435
sgml-local-catalogs:nil
436
sgml-local-ecat-files:nil
437
End:
438
-->