OpenVZ backup container to a single file while it's running using "vzdump"

Proxmox has made this free utility to backup running OpenVZ containers.  It's a great program which is actually just a PERL script but gets the job done.  This program is not 100% required because all it really does is cp -a from your container's path as far as I know but it is still good to have uniformity to how you backup your containers.


For RPM distros such as Centos/RHEL/Fedora etc.. download and install this:

wget http://www.proxmox.com/cms_proxmox/cms/upload/vzdump/vzdump-1.1-2.noarch.rpm; rpm -ivh vzdump-1.1-2.noarch.rpm

For Debian based distros like Ubuntu etc.. download and install this:


wget http://www.proxmox.com/cms_proxmox/cms/upload/vzdump/vzdump_1.1-2_all.deb; dpkg -i vzdump_1.1-2_all.deb

vzdump options

 vzdump --help
Unknown option: help
usage: /usr/sbin/vzdump OPTIONS [--all | VPSID]

        --exclude VPSID         exclude VPSID (assumes --all)
        --exclude-path REGEX    exclude certain files/directories
        --stdexcludes           exclude temorary files and logs

        --compress              compress dump file (gzip)
        --dumpdir DIR           store resulting files in DIR
        --tmpdir DIR            store temporary files in DIR

        --mailto EMAIL          send notification mail to EMAIL.
        --quiet                 be quiet.
        --stop                  stop/start VPS if running
        --suspend               suspend/resume VPS when running
        --snapshot              use LVM snapshot when running
        --size MB               LVM snapshot size

        --node CID              only run on pve cluster node CID
        --lockwait MINUTES      maximal time to wait for the global lock
        --stopwait MINUTES      maximal time to wait until a VM is stopped
        --bwlimit KBPS          limit I/O bandwidth; KBytes per second

        --restore FILENAME      restore FILENAME

 

Real Life Usage To Dump/Backup an OpenVZ Container

*note that since I chose --compress (why not compress right?) that the file will actually be:

vzdump-5000.tgz

vzdump --compress 5000
INFO: Starting new backup job - vzdump --compress 5000
INFO: Starting Backup of VM 2000 (openvz)
INFO: status = CTID 5000 exist mounted running
WARN: online backup without stop/suspend/snapshot
WARN: this can lead to inconsistent data
INFO: creating archive '/vz/dump/vzdump-5000.dat' (/vz/private/5000)

To Restore The OpenVZ Backup

vzrestore /vz/dump/vzdump-5000.tgz 5000

*note that if you specify something different eg. 10000 as the VPSID it will restore to that container.


Tags:

openvz, container, vzdump, proxmox, utility, containers, perl, cp, uniformity, rpm, distros, centos, rhel, fedora, etc, download, install, wget, http, www, cms_proxmox, cms, upload, noarch, ivh, debian, ubuntu, vzdump_, _all, deb, dpkg, usage, usr, sbin, vpsid, exclude, assumes, regex, directories, stdexcludes, temorary, logs, compress, gzip, dumpdir, dir, resulting, tmpdir, mailto, email, notification, vps, suspend, resume, snapshot, lvm, mb, node, cid, pve, cluster, lockwait, maximal, global, stopwait, vm, bwlimit, kbps, bandwidth, kbytes, restore, filename, tgz, info, ctid, mounted, online, inconsistent, creating, archive, vz, dat, vzrestore, specify, eg,

Latest Articles

  • Cloned VM/Server/Computer in Linux won't boot and goes to initramfs busybox Solution
  • How To Add Windows 7 8 10 11 to GRUB Boot List Dual Booting
  • How to configure OpenDKIM on Linux with Postfix and setup bind zonefile
  • Debian Ubuntu 10/11/12 Linux how to get tftpd-hpa server setup tutorial
  • efibootmgr: option requires an argument -- 'd' efibootmgr version 15 grub-install.real: error: efibootmgr failed to register the boot entry: Operation not permitted.
  • Apache Error Won't start SSL Cert Issue Solution Unable to configure verify locations for client authentication SSL Library Error: 151441510 error:0906D066:PEM routines:PEM_read_bio:bad end line SSL Library Error: 185090057 error:0B084009:x509 certif
  • Linux Debian Mint Ubuntu Bridge br0 gets random IP
  • redis requirements
  • How to kill a docker swarm
  • docker swarm silly issues
  • isc-dhcp-server dhcpd how to get longer lease
  • nvidia cannot resume from sleep Comm: nvidia-sleep.sh Tainted: Linux Ubuntu Mint Debian
  • zfs and LUKS how to recover in Linux
  • [error] (28)No space left on device: Cannot create SSLMutex Apache Solution Linux CentOS Ubuntu Debian Mint
  • Save money on bandwidth by disabling reflective rpc queries in Linux CentOS RHEL Ubuntu Debian
  • How to access a disk with bad superblock Linux Ubuntu Debian Redhat CentOS ext3 ext4
  • ImageMagick error convert solution - convert-im6.q16: cache resources exhausted
  • PTY allocation request failed on channel 0 solution
  • docker error not supported as upperdir failed to start daemon: error initializing graphdriver: driver not supported
  • Migrated Linux Ubuntu Mint not starting services due to broken /var/run and dbus - Failed to connect to bus: No such file or directory solution