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 snapshots of running virtual
29 machines (VMs). It basically creates an archive of the VM private
30 area, which also includes the VM configuration files. 'vzdump'
31 currently supports LXC containers and QemuServer VMs.
33 There are several ways to provide consistency (option `mode`):
37 Stop the VM during backup. This results in a very long downtime.
41 For containers, this mode uses rsync to copy the container data to a temporary
42 location (see option `--tmpdir`). Then the container is suspended and a second
43 rsync copies changed files. After that, the container is started (resumed)
44 again. This results in minimal downtime, but needs additional space
45 to hold the container copy.
47 When the container is on a local filesystem and the target storage of the backup
48 is an NFS server, you should set `--tmpdir` to reside on a local filesystem too,
49 as this will result in a many fold performance improvement.
50 Use of a local `tmpdir` is also required if you want to backup in `suspend`
51 mode a local container using ACLs to an NFS server.
53 For QemuServer, this mode will suspend the VM, start
54 a live backup, and resume the VM. This does not require a temporary
59 For containers, this mode uses the snapshotting facilities of the
60 underlying storage. A snapshot will be made of the container volume,
61 and the snapshot content will be archived in a tar file.
63 For QemuServer, this mode will do a live backup similar to the
64 `suspend` mode, but without suspending/resuming the VM.
66 A technical overview of the Proxmox VE live backup for QemuServer can
68 https://git.proxmox.com/?p=pve-qemu-kvm.git;a=blob;f=backup.txt[here],
73 Newer versions of vzdump encode the virtual machine type and the
74 backup time into the filename, for example
76 vzdump-lxc-105-2009_10_09-11_04_43.tar
78 That way it is possible to store several backup in the same
79 directory. The parameter `maxfiles` can be used to specify the
80 maximum number of backups to keep.
85 The resulting archive files can be restored with the following programs.
88 `pct restore`:: Container restore utility
90 `qmrestore`:: QemuServer restore utility
92 For details see the corresponding manual pages.
97 Global configuration is stored in '/etc/vzdump.conf'.
102 mode: snapshot|suspend|stop
110 exclude-path: PATHLIST
115 You can specify a hook script with option `--script`. This script is
116 called at various phases of the backup process, with parameters
117 accordingly set. You can find an example in the documentation
118 directory ('vzdump-hook-script.pl').
123 First, this option is only available for container backups. 'vzdump'
124 skips the following files with option `--stdexcludes`
131 Or you can manually specify exclude paths, for example:
133 # vzdump 777 --exclude-path /tmp/ --exclude-path '/var/foo*'
135 (only excludes tmp directories)
137 Configuration files are also stored inside the backup archive
138 (`/etc/vzdump/`), and will be correctly restored.
143 Simply dump VM 777 - no snapshot, just archive the VM private area and
144 configuration files to the default dump directory (usually
145 '/var/liv//vz/dump/').
149 Use rsync and suspend/resume to create a snapshot (minimal downtime).
151 # vzdump 777 --mode suspend
153 Backup all VMs and send notification mails to root and admin.
155 # vzdump --all --mode suspend --mailto root --mailto admin
157 Use snapshot mode (no downtime).
159 # vzdump 777 --dumpdir /mnt/backup --mode snapshot
161 Backup more than one VM (selectively)
163 # vzdump 101 102 103 --mailto root
165 Backup all VMs excluding VM 101 and 102
167 # vzdump --mode suspend --exclude 101,102
169 Restore a container to a new VM 600
171 # pct restore 600 /mnt/backup/vzdump-lxc-777.tar
173 Restore a Qemu/KVM machine to VM 601
175 # qmrestore /mnt/backup/vzdump-qemu-888.vma 601
177 Clone an existing container 101 to a new container 300 with a 4GB root
178 file system, using pipes
180 # vzdump 101 --stdout | pct restore --rootfs 4 300 -
184 include::pve-copyright.adoc[]