.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "vzdump 1" .TH vzdump 1 "2012-04-07" "1.2" "Proxmox Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" vzdump \- backup utility for virtual machine .SH "SYNOPSIS" .IX Header "SYNOPSIS" vzdump \s-1OPTIONS\s0 [\-\-all | <\s-1VMID\s0>] .PP \&\-\-exclude \s-1VMID\s0 exclude \s-1VMID\s0 (assumes \-\-all) .PP \&\-\-exclude\-path \s-1REGEX\s0 exclude certain files/directories. You can use this option more than once to specify multiple exclude paths .PP \&\-\-stdexcludes exclude temporary files and logs .PP \&\-\-compress compress dump file (gzip) .PP \&\-\-storage \s-1STORAGE_ID\s0 store resulting files to \s-1STORAGE_ID\s0 (\s-1PVE\s0 only) .PP \&\-\-script execute hook script .PP \&\-\-dumpdir \s-1DIR\s0 store resulting files in \s-1DIR\s0 .PP \&\-\-maxfiles N maximal number of backup files per \s-1VM\s0. .PP \&\-\-tmpdir \s-1DIR\s0 store temporary files in \s-1DIR\s0. \-\-suspend and \-\-stop are using this directory to store a copy of the \s-1VM\s0. .PP \&\-\-mailto \s-1EMAIL\s0 send notification mail to \s-1EMAIL\s0. You can use this option more than once to specify multiple receivers .PP \&\-\-stop stop/start \s-1VM\s0 if running .PP \&\-\-suspend suspend/resume \s-1VM\s0 when running .PP \&\-\-snapshot use \s-1LVM\s0 snapshot when running .PP \&\-\-size \s-1MB\s0 \s-1LVM\s0 snapshot size (default 1024) .PP \&\-\-bwlimit \s-1KBPS\s0 limit I/O bandwidth; KBytes per second .PP \&\-\-lockwait \s-1MINUTES\s0 maximal time to wait for the global lock. vzdump uses a global lock file to make sure that only one instance is running (running several instance puts too much load on a server). Default is 180 (3 hours). .PP \&\-\-stopwait \s-1MINUTES\s0 maximal time to wait until a \s-1VM\s0 is stopped. .SH "DESCRIPTION" .IX Header "DESCRIPTION" vzdump is an utility to make consistent snapshots of running virtual machines (VMs). It basically creates a tar archive of the \s-1VM\s0 private area, which also includes the \s-1VM\s0 configuration files. vzdump currently supports OpenVZ and QemuServer VMs. .PP There are several ways to provide consistency: .ie n .IP """stop"" mode" 2 .el .IP "\f(CWstop\fR mode" 2 .IX Item "stop mode" Stop the \s-1VM\s0 during backup. This results in a very long downtime. .ie n .IP """suspend"" mode" 2 .el .IP "\f(CWsuspend\fR mode" 2 .IX Item "suspend mode" For OpenVZ, this mode uses rsync to copy the \s-1VM\s0 to a temporary location (see option \-\-tmpdir). Then the \s-1VM\s0 is suspended and a second rsync copies changed files. After that, the \s-1VM\s0 is started (resume) again. This results in a minimal downtime, but needs additional space to hold the \s-1VM\s0 copy. .Sp For QemuServer, this mode work like \f(CW\*(C`stop\*(C'\fR mode, but uses suspend/resume instead of stop/start. .ie n .IP """snapshot"" mode" 2 .el .IP "\f(CWsnapshot\fR mode" 2 .IX Item "snapshot mode" This mode uses \s-1LVM2\s0 snapshots. There is no downtime, but snapshot mode needs \s-1LVM2\s0 and some free space on the corresponding volume group to create the \s-1LVM\s0 snapshot. .SH "BACKUP FILE NAMES" .IX Header "BACKUP FILE NAMES" Newer version of vzdump encodes the virtual machine type and the backup time into the filename, for example .PP .Vb 1 \& vzdump\-openvz\-105\-2009_10_09\-11_04_43.tar .Ve .PP That way it is possible to store several backup into the same directory. The parameter \f(CW\*(C`maxfiles\*(C'\fR can be used to specify the maximal number of backups to keep. .SH "RESTORE" .IX Header "RESTORE" The resulting tar files can be restored with the following programs. .IP "vzrestore: OpenVZ restore utility" 1 .IX Item "vzrestore: OpenVZ restore utility" .PD 0 .IP "qmrestore: QemuServer restore utility" 1 .IX Item "qmrestore: QemuServer restore utility" .PD .PP For details see the corresponding manual pages. .SH "CONFIGURATION" .IX Header "CONFIGURATION" Global configuration is stored in /etc/vzdump.conf. .PP .Vb 10 \& tmpdir: DIR \& dumpdir: DIR \& storage: STORAGE_ID \& mode: snapshot|suspend|stop \& bwlimit: KBPS \& lockwait: MINUTES \& stopwait: MINUTES \& size: MB \& maxfiles: N \& script: FILENAME .Ve .SH "HOOK SCRIPT" .IX Header "HOOK SCRIPT" You can specify a hook script with option \f(CW\*(C`\-\-script\*(C'\fR. This script is called at various phases of the backup process, with parameters accordingly set. You can find an example in the documentation directory (\f(CW\*(C`hook\-script.pl\*(C'\fR). .SH "EXCLUSIONS (OpenVZ only)" .IX Header "EXCLUSIONS (OpenVZ only)" vzdump skips the following files wit option \-\-stdexcludes .PP .Vb 4 \& /var/log/.+ \& /tmp/.+ \& /var/tmp/.+ \& /var/run/.+pid .Ve .PP You can manually specify exclude paths, for example: .PP > vzdump \-\-exclude\-path \f(CW\*(C`/tmp/.+\*(C'\fR \-\-exclude\-path \f(CW\*(C`/var/tmp/.+\*(C'\fR 777 .PP (only excludes tmp directories) .PP Configuration files are also stored inside the backup archive (/etc/vzdump), and will be correctly restored. .SH "LIMITATIONS" .IX Header "LIMITATIONS" VZDump does not save ACLs. .SH "EXAMPLES" .IX Header "EXAMPLES" Simply dump \s-1VM\s0 777 \- no snapshot, just archive the \s-1VM\s0 private area and configuration files to the default dump directory (usually /vz/dump/). .PP > vzdump 777 .PP Use rsync and suspend/resume to create an snapshot (minimal downtime). .PP > vzdump \-\-suspend 777 .PP Backup all VMs and send notification mails to root. .PP > vzdump \-\-suspend \-\-all \-\-mailto root .PP Use \s-1LVM2\s0 to create snapshots (no downtime). .PP > vzdump \-\-dumpdir /mnt/backup \-\-snapshot 777 .PP Backup all VMs excluding \s-1VM\s0 101 and 102 .PP > vzdump \-\-suspend \-\-exclude 101 \-\-exclude 102 .PP Restore an OpenVZ machine to \s-1VM\s0 600 .PP > vzrestore /mnt/backup/vzdump\-openvz\-777.tar 600 .PP Restore an Qemu/KVM machine to \s-1VM\s0 601 .PP > qmrestore /mnt/backup/vzdump\-qemu\-888.tar 601 .SH "SEE ALSO" .IX Header "SEE ALSO" .Vb 1 \& vzrestore(1) qmrestore(1) .Ve .SH "AUTHOR" .IX Header "AUTHOR" Dietmar Maurer .PP Many thanks to Proxmox Server Solutions (www.proxmox.com) for sponsoring this work. .SH "COPYRIGHT AND DISCLAIMER" .IX Header "COPYRIGHT AND DISCLAIMER" Copyright (C) 2007\-2009 Proxmox Server Solutions GmbH .PP Copyright: vzdump is under \s-1GNU\s0 \s-1GPL\s0, the \s-1GNU\s0 General Public License. .PP This program is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation; version 2 dated June, 1991. .PP This program is distributed in the hope that it will be useful, but \s-1WITHOUT\s0 \s-1ANY\s0 \s-1WARRANTY\s0; without even the implied warranty of \&\s-1MERCHANTABILITY\s0 or \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0. See the \&\s-1GNU\s0 General Public License for more details. .PP You should have received a copy of the \s-1GNU\s0 General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, \&\s-1MA\s0 02110\-1301, \s-1USA\s0.