1 include::attributes.txt[]
9 vzdump - Backup Utility for VMs and Containers
15 include::vzdump.1-synopsis.adoc[]
27 'vzdump' is an utility to make consistent snapshots of running virtual
28 machines (VMs). It basically creates an archive of the VM private
29 area, which also includes the VM configuration files. 'vzdump'
30 currently supports LXC containers and QemuServer VMs.
32 There are several ways to provide consistency (option `mode`):
36 Stop the VM during backup. This results in a very long downtime.
40 For containers, this mode uses rsync to copy the VM to a temporary
41 location (see option `--tmpdir`). Then the VM is suspended and a second
42 rsync copies changed files. After that, the VM is started (resume)
43 again. This results in a minimal downtime, but needs additional space
46 For QemuServer, this mode will suspend the VM, start
47 a live backup, and resume the VM.
51 For containers, this mode uses the snapshotting facilities of the
52 underlying storage. A snapshot will be made of the container volume,
53 and the snapshot content will be archived in a tar file.
55 For QemuServer, this mode will do a live backup similar to the
56 `snaphost` mode, but without suspending/resuming the VM.
58 A technical overview of the Proxmox VE live backup for QemuServer can
60 https://git.proxmox.com/?p=pve-qemu-kvm.git;a=blob;f=backup.txt[here],
65 Newer version of vzdump encodes the virtual machine type and the
66 backup time into the filename, for example
68 vzdump-lxc-105-2009_10_09-11_04_43.tar
70 That way it is possible to store several backup into the same
71 directory. The parameter `maxfiles` can be used to specify the
72 maximal number of backups to keep.
77 The resulting archive files can be restored with the following programs.
80 `pct restore`:: Containers restore utility
82 `qmrestore`:: QemuServer restore utility
84 For details see the corresponding manual pages.
89 Global configuration is stored in '/etc/vzdump.conf'.
94 mode: snapshot|suspend|stop
102 exclude-path: PATHLIST
107 You can specify a hook script with option `--script`. This script is
108 called at various phases of the backup process, with parameters
109 accordingly set. You can find an example in the documentation
110 directory ('vzdump-hook-script.pl').
115 First, this option is only available for container backups. 'vzdump'
116 skips the following files with option `--stdexcludes`
123 Or you can manually specify exclude paths, for example:
125 # vzdump 777 --exclude-path '/tmp/.+' --exclude-path '/var/tmp/.+'
127 (only excludes tmp directories)
129 Configuration files are also stored inside the backup archive
130 (`/etc/vzdump/`), and will be correctly restored.
135 Simply dump VM 777 - no snapshot, just archive the VM private area and
136 configuration files to the default dump directory (usually
137 '/var/liv//vz/dump/').
141 Use rsync and suspend/resume to create an snapshot (minimal downtime).
143 # vzdump 777 --mode suspend
145 Backup all VMs and send notification mails to root and admin.
147 # vzdump --all --mode suspend --mailto root --mailto admin
149 Use snapshot mode (no downtime).
151 # vzdump 777 --dumpdir /mnt/backup --mode snapshot
153 Backup more than one VM (selectively)
155 # vzdump 101 102 103 --mailto root
157 Backup all VMs excluding VM 101 and 102
159 # vzdump --mode suspend --exclude 101,102
161 Restore a container to a new VM 600
163 # pct restore 600 /mnt/backup/vzdump-lxc-777.tar
165 Restore a Qemu/KVM machine to VM 601
167 # qmrestore /mnt/backup/vzdump-qemu-888.vma 601
169 Clone an existing container 101 to a new container 300 with a 4GB root
170 file system, using pipes
172 # vzdump 101 --stdout | pct restore --rootfs 4 300 -
176 include::pve-copyright.adoc[]