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

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.


  • Centos 6.6/6.9 KVM VM Kernel Panic On Boot - Kernel panic - not syncing: Attempted to kill init!
  • Cannot allocate TUN/TAP dev dynamically - FreeBSD/OpenBSD OpenVPN Client error Solution
  • Linux Mint/Ubuntu/Debian apt how to downgrade a package
  • Ubuntu Linux Mint How To Exclude Stop Package from being Upgraded or Installed
  • Intel NUC Lower Power Green Computing Boxes Review/Comparison of J3160 and J3455 Models
  • How to backup entire computer Linux Mint Ubuntu with tar
  • tar how to ignore failed reads and not exit
  • kdenlive titles/text renders as white screen when using .sh script
  • [1035724.274610] [drm:intel_pipe_update_end [i915_bpo]] *ERROR* Atomic update failure on pipe A (start=62076478 end=62076479) time 102 us, min 894, max 899, scanline start 893, end 900 W: Possible missing firmware /lib/firmware/i915/kbl_dmc_ver1.bin
  • ffmpeg how to watermark and concatenate in one command
  • /usr/bin/ld: cannot find -lboost_system-mt-s /usr/bin/ld: cannot find -lboost_filesystem-mt-s /usr/bin/ld: cannot find -lboost_program_options-mt-s /usr/bin/ld: cannot find -lboost_thread-mt-s collect2: error: ld returned 1 exit status make: *** [cag
  • Wine uninstalled broken on Linux Mint
  • ffmpeg trouble concatenating similar but different files
  • ffmpeg Unable to Use Hardware Encoding with Nvidia 3.40 Driver and GT210 card
  • Linux Mint USB Kernel Tainted and Locked Port/Dev File
  • ffmpeg Linux Mint download, compile and install howto
  • OpenVZ error : Container start failed (try to check kernel messages, e.g. "dmesg | tail") Locked by: pid 166638, cmdline vzctl start 888171
  • How to extract view contents of initramfs image gzip'd
  • Linux how to copy GPT partition table with dd
  • Centos 7 How To Change Hostname