1 gnt-backup(8) Ganeti | Version @GANETI_VERSION@
2 ===============================================
7 gnt-backup - Ganeti instance import/export
12 **gnt-backup** {command} [arguments...]
17 The **gnt-backup** is used for importing and exporting instances
18 and their configuration from a Ganeti system. It is useful for
19 backing up instances and also to migrate them between clusters.
27 | **export** {-n *node*} [\--shutdown-timeout=*N*] [\--noshutdown]
28 | [\--remove-instance] [\--ignore-remove-failures] [\--submit]
31 Exports an instance to the target node. All the instance data and
32 its configuration will be exported under the
33 ``@CUSTOM_EXPORT_DIR@/``*instance* directory on the target node.
35 The ``--shutdown-timeout`` is used to specify how much time to wait
36 before forcing the shutdown (xm destroy in xen, killing the kvm
37 process, for kvm). By default two minutes are given to each
40 The ``--noshutdown`` option will create a snapshot disk of the
41 instance without shutting it down first. While this is faster and
42 involves no downtime, it cannot be guaranteed that the instance
43 data will be in a consistent state in the exported dump.
45 The ``--remove`` option can be used to remove the instance after it
46 was exported. This is useful to make one last backup before
47 removing the instance.
49 The exit code of the command is 0 if all disks were backed up
50 successfully, 1 if no data was backed up or if the configuration
51 export failed, and 2 if just some of the disks failed to backup.
52 The exact details of the failures will be shown during the command
53 execution (and will be stored in the job log). It is recommended
54 that for any non-zero exit code, the backup is considered invalid,
57 See **ganeti(7)** for a description of ``--submit`` and other common
62 # gnt-backup export -n node1.example.com instance3.example.com
69 | {-n *node[:secondary-node]* | \--iallocator *name*}
70 | [\--disk *N*:size=*VAL* [,vg=*VG*], [,mode=*ro|rw*]...]
71 | [\--net *N* [:options...] | \--no-nics]
73 | [-H *HYPERVISOR* [: option=*value*... ]]
74 | [\--src-node=*source-node*] [\--src-dir=*source-dir*]
75 | [-t [diskless | plain | drbd | file]]
76 | [\--identify-defaults]
81 Imports a new instance from an export residing on *source-node* in
82 *source-dir*. *instance* must be in DNS and resolve to a IP in the
83 same network as the nodes in the cluster. If the source node and
84 directory are not passed, the last backup in the cluster is used,
85 as visible with the **list** command.
87 The ``disk`` option specifies the parameters for the disks of the
88 instance. The numbering of disks starts at zero. For each disk, at
89 least the size needs to be given, and optionally the access mode
90 (read-only or the default of read-write) and LVM volume group can also
91 be specified. The size is interpreted (when no unit is given) in
92 mebibytes. You can also use one of the suffixes m, g or t to specificy
93 the exact the units used; these suffixes map to mebibytes, gibibytes
96 Alternatively, a single-disk instance can be created via the ``-s``
97 option which takes a single argument, the size of the disk. This is
98 similar to the Ganeti 1.2 version (but will only create one disk).
100 If no disk information is passed, the disk configuration saved at
101 export time will be used.
103 The minimum disk specification is therefore empty (export information
104 will be used), a single disk can be specified as ``--disk 0:size=20G``
105 (or ``-s 20G`` when using the ``-s`` option), and a three-disk
106 instance can be specified as ``--disk 0:size=20G --disk 1:size=4G
107 --disk 2:size=100G``.
109 The NICs of the instances can be specified via the ``--net``
110 option. By default, the NIC configuration of the original
111 (exported) instance will be reused. Each NIC can take up to three
112 parameters (all optional):
115 either a value or ``generate`` to generate a new unique MAC, or
116 ``auto`` to reuse the old MAC
119 specifies the IP address assigned to the instance from the Ganeti
120 side (this is not necessarily what the instance will use, but what
121 the node expects the instance to use)
124 specifies the connection mode for this nic: ``routed`` or
128 in bridged mode specifies the bridge to attach this NIC to, in
129 routed mode it's intended to differentiate between different
130 routing tables/instance groups (but the meaning is dependent on
131 the network script in use, see **gnt-cluster**(8) for more
134 Of these ``mode`` and ``link`` are nic parameters, and inherit their
135 default at cluster level.
137 If no network is desired for the instance, you should create a single
138 empty NIC and delete it afterwards via **gnt-instance modify \--net
141 The ``-B`` option specifies the backend parameters for the
142 instance. If no such parameters are specified, the values are
143 inherited from the export. Possible parameters are:
146 the maximum memory size of the instance; as usual, suffixes can be
147 used to denote the unit, otherwise the value is taken in mebibytes
150 the minimum memory size of the instance; as usual, suffixes can be
151 used to denote the unit, otherwise the value is taken in mebibytes
154 the number of VCPUs to assign to the instance (if this value makes
155 sense for the hypervisor)
158 whether the instance is considered in the N+1 cluster checks
159 (enough redundancy in the cluster to survive a node failure)
162 ``True`` or ``False``, whether the instance must be failed over
163 (shut down and rebooted) always or it may be migrated (briefly
167 The ``-t`` options specifies the disk layout type for the instance.
168 If not passed, the configuration of the original instance is used.
169 The available choices are:
172 This creates an instance with no disks. Its useful for testing only
173 (or other special cases).
176 Disk devices will be logical volumes.
179 Disk devices will be drbd (version 8.x) on top of lvm volumes.
182 Disk devices will be backed up by files, under the directory
183 ``@RPL_FILE_STORAGE_DIR@``. By default, each instance will get a
184 directory (as its own name) under this path, and each disk is
185 stored as individual files in this (instance-specific) directory.
188 The ``--iallocator`` option specifies the instance allocator plugin
189 to use. If you pass in this option the allocator will select nodes
190 for this instance automatically, so you don't need to pass them
191 with the ``-n`` option. For more information please refer to the
192 instance allocator documentation.
194 The optional second value of the ``--node`` is used for the drbd
195 template and specifies the remote node.
197 The ``--src-dir`` option allows importing instances from a directory
198 below ``@CUSTOM_EXPORT_DIR@``.
200 If ``--ignore-ipolicy`` is given any instance policy violations occuring
201 during this operation are ignored.
203 Since many of the parameters are by default read from the exported
204 instance information and used as such, the new instance will have
205 all parameters explicitly specified, the opposite of a newly added
206 instance which has most parameters specified via cluster defaults.
207 To change the import behaviour to recognize parameters whose saved
208 value matches the current cluster default and mark it as such
209 (default value), pass the ``--identify-defaults`` option. This will
210 affect the hypervisor, backend and NIC parameters, both read from
211 the export file and passed in via the command line.
213 See **ganeti(7)** for a description of ``--submit`` and other common
216 Example for identical instance import::
218 # gnt-backup import -n node1.example.com instance3.example.com
221 Explicit configuration example::
223 # gnt-backup import -t plain --disk 0:size=1G -B memory=512 \
224 > -n node1.example.com \
225 > instance3.example.com
231 | **list** [\--node=*NODE*] [\--no-headers] [\--separator=*SEPARATOR*]
232 | [-o *[+]FIELD,...*]
234 Lists the exports currently available in the default directory in
235 all the nodes of the current cluster, or optionally only a subset
236 of them specified using the ``--node`` option (which can be used
239 The ``--no-headers`` option will skip the initial header line. The
240 ``--separator`` option takes an argument which denotes what will be
241 used between the output fields. Both these options are to help
244 The ``-o`` option takes a comma-separated list of output fields.
245 The available fields and their meaning are:
247 @QUERY_FIELDS_EXPORT@
249 If the value of the option starts with the character ``+``, the new
250 fields will be added to the default list. This allows one to quickly
251 see the default list plus a few other fields, instead of retyping
252 the entire list of fields.
256 # gnt-backup list --node node1 --node node2
262 **list-fields** [field...]
264 Lists available fields for exports.
270 **remove** {instance_name}
272 Removes the backup for the given instance name, if any. If the backup
273 was for a deleted instance, it is needed to pass the FQDN of the
274 instance, and not only the short hostname.
276 .. vim: set textwidth=72 :