4 include::attributes.txt[]
9 vzdump - Backup Utility for VMs and Containers
15 include::vzdump.1-synopsis.adoc[]
25 include::attributes.txt[]
28 Backups are a requirements for any sensible IT deployment, and {pve}
29 provides a fully integrated solution, using the capabilities of each storage
30 and each guest system type. This allows the system administrator to fine tune via
31 the `mode` option between consistency of the backups and downtime of the guest
32 system. Proxmox VE backups are always full backups - containing the VM/CT
33 configuration and all data.
34 Backups can be started via the GUI or via the `vzdump` command line tool.
38 Before a backup can run, a backup storage must be defined.
39 Refer to the Storage documentation on how to add a storage. A backup storage
40 must be a file level storage, as backups are stored as regular files.
41 In most situations, using a NFS server is a good way to store backups.
42 You can save those backups later to a tape drive, for off-site archive.
46 Backup jobs can be scheduled so that they are executed automatically on
47 specific days and times, for selectable nodes and guest systems.
48 Configuration of scheduled backups is done at the Datacenter level in the GUI,
49 which will generate a cron entry in /etc/cron.d/vzdump.
51 There are several ways to provide consistency (option `mode`),
52 depending on the guest type.
54 .Backup `mode` for VMs:
58 This first performns a clean shutdown of the VM to make sure it is
59 stopped. It then starts the VM in suspended mode and uses the qemu
60 backup feature to dump all data. If the VM was running, we start
61 (resume) it immediately after starting the qemu backup task. This
62 keeps the downtime as low as possible.
66 This mode does not really make sense for qemu. Please use snapshot
71 This mode simply starts a qemu live backup task. If the guest agent
72 is enabled (`agent: 1`) and running, it calls 'guest-fsfreeze-freeze'
73 and 'guest-fsfreeze-thaw' to improve consistency.
75 A technical overview of the Proxmox VE live backup for QemuServer can
77 https://git.proxmox.com/?p=pve-qemu-kvm.git;a=blob;f=backup.txt[here].
79 NOTE: Qemu backup provides snapshots on any storage type. It does
80 not require that the underlying storage supports snapshots.
83 .Backup `mode` for Containers:
87 Stop the container for the duration of the backup. This potentially results in
92 This mode uses rsync to copy the container data to a temporary
93 location (see option `--tmpdir`). Then the container is suspended and a second
94 rsync copies changed files. After that, the container is started (resumed)
95 again. This results in minimal downtime, but needs additional space
96 to hold the container copy.
98 When the container is on a local filesystem and the target storage of the backup
99 is an NFS server, you should set `--tmpdir` to reside on a local filesystem too,
100 as this will result in a many fold performance improvement.
101 Use of a local `tmpdir` is also required if you want to backup a local container
102 using ACLs in suspend mode if the backup storage is an NFS server.
106 This mode uses the snapshotting facilities of the underlying
107 storage. First, the container will be suspended to ensure data consistency.
108 A temporary snapshot of the container's volumes will be made and the
109 snapshot content will be archived in a tar file. Finally, the temporary
110 snapshot is deleted again.
112 NOTE: `snapshot` mode requires that all backed up volumes are on a storage that
113 supports snapshots. Using the `backup=no` mountpoint option individual volumes
114 can be excluded from the backup (and thus this requirement).
116 NOTE: bind and device mountpoints are skipped during backup operations, like
117 volume mountpoints with the backup option disabled.
123 Newer versions of vzdump encode the guest type and the
124 backup time into the filename, for example
126 vzdump-lxc-105-2009_10_09-11_04_43.tar
128 That way it is possible to store several backup in the same
129 directory. The parameter `maxfiles` can be used to specify the
130 maximum number of backups to keep.
135 The resulting archive files can be restored with the following programs.
138 `pct restore`:: Container restore utility
140 `qmrestore`:: QemuServer restore utility
142 For details see the corresponding manual pages.
147 Global configuration is stored in '/etc/vzdump.conf'. The file uses a
148 simple colon separated key/value format. Each line has the following
153 Blank lines in the file are ignored, and lines starting with a '#'
154 character are treated as comments and are also ignored. Values from
155 this file are used as default, and can be overwritten on the command
158 We currently support the following options:
160 include::vzdump.conf.5-opts.adoc[]
163 .Example 'vzdump.conf' Configuration
165 tmpdir: /mnt/fast_local_disk
166 storage: my_backup_storage
174 You can specify a hook script with option `--script`. This script is
175 called at various phases of the backup process, with parameters
176 accordingly set. You can find an example in the documentation
177 directory ('vzdump-hook-script.pl').
182 NOTE: this option is only available for container backups.
184 'vzdump' skips the following files by default (disable with the option
191 You can also manually specify (additional) exclude paths, for example:
193 # vzdump 777 --exclude-path /tmp/ --exclude-path '/var/foo*'
195 (only excludes tmp directories)
197 Configuration files are also stored inside the backup archive
198 (in `./etc/vzdump/`) and will be correctly restored.
203 Simply dump guest 777 - no snapshot, just archive the guest private area and
204 configuration files to the default dump directory (usually
205 '/var/lib/vz/dump/').
209 Use rsync and suspend/resume to create a snapshot (minimal downtime).
211 # vzdump 777 --mode suspend
213 Backup all guest systems and send notification mails to root and admin.
215 # vzdump --all --mode suspend --mailto root --mailto admin
217 Use snapshot mode (no downtime) and non-default dump directory.
219 # vzdump 777 --dumpdir /mnt/backup --mode snapshot
221 Backup more than one guest (selectively)
223 # vzdump 101 102 103 --mailto root
225 Backup all guests excluding 101 and 102
227 # vzdump --mode suspend --exclude 101,102
229 Restore a container to a new CT 600
231 # pct restore 600 /mnt/backup/vzdump-lxc-777.tar
233 Restore a QemuServer VM to VM 601
235 # qmrestore /mnt/backup/vzdump-qemu-888.vma 601
237 Clone an existing container 101 to a new container 300 with a 4GB root
238 file system, using pipes
240 # vzdump 101 --stdout | pct restore --rootfs 4 300 -
244 include::pve-copyright.adoc[]