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.
58 For containers, this mode uses the snapshotting facilities of the
59 underlying storage. A snapshot will be made of the container volume,
60 and the snapshot content will be archived in a tar file.
62 For QemuServer, this mode will do a live backup similar to the
63 `suspend` mode, but without suspending/resuming the VM.
65 A technical overview of the Proxmox VE live backup for QemuServer can
67 https://git.proxmox.com/?p=pve-qemu-kvm.git;a=blob;f=backup.txt[here],
72 Newer versions of vzdump encode the virtual machine type and the
73 backup time into the filename, for example
75 vzdump-lxc-105-2009_10_09-11_04_43.tar
77 That way it is possible to store several backup in the same
78 directory. The parameter `maxfiles` can be used to specify the
79 maximum number of backups to keep.
84 The resulting archive files can be restored with the following programs.
87 `pct restore`:: Container restore utility
89 `qmrestore`:: QemuServer restore utility
91 For details see the corresponding manual pages.
96 Global configuration is stored in '/etc/vzdump.conf'.
101 mode: snapshot|suspend|stop
109 exclude-path: PATHLIST
114 You can specify a hook script with option `--script`. This script is
115 called at various phases of the backup process, with parameters
116 accordingly set. You can find an example in the documentation
117 directory ('vzdump-hook-script.pl').
122 First, this option is only available for container backups. 'vzdump'
123 skips the following files with option `--stdexcludes`
130 Or you can manually specify exclude paths, for example:
132 # vzdump 777 --exclude-path /tmp/ --exclude-path '/var/foo*'
134 (only excludes tmp directories)
136 Configuration files are also stored inside the backup archive
137 (`/etc/vzdump/`), and will be correctly restored.
142 Simply dump VM 777 - no snapshot, just archive the VM private area and
143 configuration files to the default dump directory (usually
144 '/var/liv//vz/dump/').
148 Use rsync and suspend/resume to create a snapshot (minimal downtime).
150 # vzdump 777 --mode suspend
152 Backup all VMs and send notification mails to root and admin.
154 # vzdump --all --mode suspend --mailto root --mailto admin
156 Use snapshot mode (no downtime).
158 # vzdump 777 --dumpdir /mnt/backup --mode snapshot
160 Backup more than one VM (selectively)
162 # vzdump 101 102 103 --mailto root
164 Backup all VMs excluding VM 101 and 102
166 # vzdump --mode suspend --exclude 101,102
168 Restore a container to a new VM 600
170 # pct restore 600 /mnt/backup/vzdump-lxc-777.tar
172 Restore a Qemu/KVM machine to VM 601
174 # qmrestore /mnt/backup/vzdump-qemu-888.vma 601
176 Clone an existing container 101 to a new container 300 with a 4GB root
177 file system, using pipes
179 # vzdump 101 --stdout | pct restore --rootfs 4 300 -
183 include::pve-copyright.adoc[]