4 include::attributes.txt[]
9 vzdump - Backup Utility for VMs and Containers
15 include::vzdump.1-synopsis.adoc[]
25 include::attributes.txt[]
28 'vzdump' is a utility to make consistent backups of running guest
29 systems. It basically creates an archive of the guest private area,
30 which also includes the guest configuration files. 'vzdump' currently
31 supports LXC containers and QemuServer VMs. There are several ways to
32 provide consistency (option `mode`), depending on the guest type.
34 .Backup `mode` for VMs:
38 This first performns a clean shutdown of the VM to make sure it is
39 stopped. It then starts the VM in suspended mode and uses the qemu
40 backup feature to dump all data. If the VM was running, we start
41 (resume) it immediately after starting the qemu backup task. This
42 keeps the downtime as low as possible.
46 This mode does not really make sense for qemu. Please use snapshot
51 This mode simply starts a qemu live backup task. If the guest agent
52 is enabled (`agent: 1`) and running, it calls 'guest-fsfreeze-freeze'
53 and 'guest-fsfreeze-thaw' to improve consistency.
55 A technical overview of the Proxmox VE live backup for QemuServer can
57 https://git.proxmox.com/?p=pve-qemu-kvm.git;a=blob;f=backup.txt[here].
59 NOTE: Qemu backup provides snapshots on any storage type. It does
60 not require that the underlying storage supports snapshots.
63 .Backup `mode` for Containers:
67 Stop the container for the duration of the backup. This potentially results in
72 This mode uses rsync to copy the container data to a temporary
73 location (see option `--tmpdir`). Then the container is suspended and a second
74 rsync copies changed files. After that, the container is started (resumed)
75 again. This results in minimal downtime, but needs additional space
76 to hold the container copy.
78 When the container is on a local filesystem and the target storage of the backup
79 is an NFS server, you should set `--tmpdir` to reside on a local filesystem too,
80 as this will result in a many fold performance improvement.
81 Use of a local `tmpdir` is also required if you want to backup a local container
82 using ACLs in suspend mode if the backup storage is an NFS server.
86 This mode uses the snapshotting facilities of the underlying
87 storage. First, the container will be suspended to ensure data consistency.
88 A temporary snapshot of the container's volumes will be made and the
89 snapshot content will be archived in a tar file. Finally, the temporary
90 snapshot is deleted again.
92 NOTE: `snapshot` mode requires that all backed up volumes are on a storage that
93 supports snapshots. Using the `backup=no` mountpoint option individual volumes
94 can be excluded from the backup (and thus this requirement).
96 NOTE: bind and device mountpoints are skipped during backup operations, like
97 volume mountpoints with the backup option disabled.
103 Newer versions of vzdump encode the guest type and the
104 backup time into the filename, for example
106 vzdump-lxc-105-2009_10_09-11_04_43.tar
108 That way it is possible to store several backup in the same
109 directory. The parameter `maxfiles` can be used to specify the
110 maximum number of backups to keep.
115 The resulting archive files can be restored with the following programs.
118 `pct restore`:: Container restore utility
120 `qmrestore`:: QemuServer restore utility
122 For details see the corresponding manual pages.
127 Global configuration is stored in '/etc/vzdump.conf'. The file uses a
128 simple colon separated key/value format. Each line has the following
133 Blank lines in the file are ignored, and lines starting with a '#'
134 character are treated as comments and are also ignored. Values from
135 this file are used as default, and can be overwritten on the command
138 We currently support the following options:
140 include::vzdump.conf.5-opts.adoc[]
143 .Example 'vzdump.conf' Configuration
145 tmpdir: /mnt/fast_local_disk
146 storage: my_backup_storage
154 You can specify a hook script with option `--script`. This script is
155 called at various phases of the backup process, with parameters
156 accordingly set. You can find an example in the documentation
157 directory ('vzdump-hook-script.pl').
162 NOTE: this option is only available for container backups.
164 'vzdump' skips the following files by default (disable with the option
171 You can also manually specify (additional) exclude paths, for example:
173 # vzdump 777 --exclude-path /tmp/ --exclude-path '/var/foo*'
175 (only excludes tmp directories)
177 Configuration files are also stored inside the backup archive
178 (in `./etc/vzdump/`) and will be correctly restored.
183 Simply dump guest 777 - no snapshot, just archive the guest private area and
184 configuration files to the default dump directory (usually
185 '/var/lib/vz/dump/').
189 Use rsync and suspend/resume to create a snapshot (minimal downtime).
191 # vzdump 777 --mode suspend
193 Backup all guest systems and send notification mails to root and admin.
195 # vzdump --all --mode suspend --mailto root --mailto admin
197 Use snapshot mode (no downtime) and non-default dump directory.
199 # vzdump 777 --dumpdir /mnt/backup --mode snapshot
201 Backup more than one guest (selectively)
203 # vzdump 101 102 103 --mailto root
205 Backup all guests excluding 101 and 102
207 # vzdump --mode suspend --exclude 101,102
209 Restore a container to a new CT 600
211 # pct restore 600 /mnt/backup/vzdump-lxc-777.tar
213 Restore a QemuServer VM to VM 601
215 # qmrestore /mnt/backup/vzdump-qemu-888.vma 601
217 Clone an existing container 101 to a new container 300 with a 4GB root
218 file system, using pipes
220 # vzdump 101 --stdout | pct restore --rootfs 4 300 -
224 include::pve-copyright.adoc[]