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 VM data to a temporary
42 location (see option `--tmpdir`). Then the VM is suspended and a second
43 rsync copies changed files. After that, the VM is started (resumed)
44 again. This results in minimal downtime, but needs additional space
47 For QemuServer, this mode will suspend the VM, start
48 a live backup, and resume the VM.
52 For containers, this mode uses the snapshotting facilities of the
53 underlying storage. A snapshot will be made of the container volume,
54 and the snapshot content will be archived in a tar file.
56 For QemuServer, this mode will do a live backup similar to the
57 `suspend` mode, but without suspending/resuming the VM.
59 A technical overview of the Proxmox VE live backup for QemuServer can
61 https://git.proxmox.com/?p=pve-qemu-kvm.git;a=blob;f=backup.txt[here],
66 Newer versions of vzdump encode the virtual machine type and the
67 backup time into the filename, for example
69 vzdump-lxc-105-2009_10_09-11_04_43.tar
71 That way it is possible to store several backup in the same
72 directory. The parameter `maxfiles` can be used to specify the
73 maximum number of backups to keep.
78 The resulting archive files can be restored with the following programs.
81 `pct restore`:: Container restore utility
83 `qmrestore`:: QemuServer restore utility
85 For details see the corresponding manual pages.
90 Global configuration is stored in '/etc/vzdump.conf'.
95 mode: snapshot|suspend|stop
103 exclude-path: PATHLIST
108 You can specify a hook script with option `--script`. This script is
109 called at various phases of the backup process, with parameters
110 accordingly set. You can find an example in the documentation
111 directory ('vzdump-hook-script.pl').
116 First, this option is only available for container backups. 'vzdump'
117 skips the following files with option `--stdexcludes`
124 Or you can manually specify exclude paths, for example:
126 # vzdump 777 --exclude-path /tmp/ --exclude-path '/var/foo*'
128 (only excludes tmp directories)
130 Configuration files are also stored inside the backup archive
131 (`/etc/vzdump/`), and will be correctly restored.
136 Simply dump VM 777 - no snapshot, just archive the VM private area and
137 configuration files to the default dump directory (usually
138 '/var/liv//vz/dump/').
142 Use rsync and suspend/resume to create a snapshot (minimal downtime).
144 # vzdump 777 --mode suspend
146 Backup all VMs and send notification mails to root and admin.
148 # vzdump --all --mode suspend --mailto root --mailto admin
150 Use snapshot mode (no downtime).
152 # vzdump 777 --dumpdir /mnt/backup --mode snapshot
154 Backup more than one VM (selectively)
156 # vzdump 101 102 103 --mailto root
158 Backup all VMs excluding VM 101 and 102
160 # vzdump --mode suspend --exclude 101,102
162 Restore a container to a new VM 600
164 # pct restore 600 /mnt/backup/vzdump-lxc-777.tar
166 Restore a Qemu/KVM machine to VM 601
168 # qmrestore /mnt/backup/vzdump-qemu-888.vma 601
170 Clone an existing container 101 to a new container 300 with a 4GB root
171 file system, using pipes
173 # vzdump 101 --stdout | pct restore --rootfs 4 300 -
177 include::pve-copyright.adoc[]