Backing up and Restore OpenVZ Virtual Vachines with vzdump

Valic —  January 17, 2012 — Leave a comment

Vzdump is a utility to make consistent snapshots of OpenVZ containers (and KVM virtual machines in case you are using Proxmox VE).

It fundamentally creates a tar archive of the container’s private area which also includes the CT configuration files.

The following steps are for Debian Squeeze Linux but vzdump can be used on all other linux distributions

1. Install Vzdump on Deian Squeeze:

apt-get install vzdump

You can also download and install vzdump from the follwing link:


and install it:

dpkg -i vzdump_1.2-4_all.deb

2. How to use Vzdump:

a. Create backups:

You can create a backup of ALL virtual machines as tar.gz  archive and send a email report when finished.

root@deb# vzdump –dumpdir /root/test/ –suspend –compress –mailto –all
INFO: starting new backup job: vzdump –dumpdir /root/test/ –suspend –compress –mailto –all
INFO: Starting Backup of VM 101 (openvz)
INFO: CTID 101 exist unmounted down
INFO: status = CTID 101 exist unmounted down
INFO: backup mode: stop
INFO: bandwidth limit: 10240 KB/s
INFO: creating archive ‘/root/test/vzdump-openvz-101.tgz’
INFO: Total bytes written: 540753920 (516MiB, 5.2MiB/s)
INFO: archive file size: 249MB
INFO: Finished Backup of VM 101(00:01:52)
INFO: Backup job finished successfuly

b.Restore a backup:
The utility for restoring is called vzrestore.

root@deb# vzrestore vzdump-openvz-101.tgz 101
INFO: restore openvz backup ‘vzdump-openvz-101.tgz’ using ID 101
INFO: extracting archive ‘vzdump-openvz-101.tgz’
INFO: Total bytes read: 1136957440 (1.1GiB, 16MiB/s)
INFO: extracting configuration to ‘/etc/vz/conf/101.conf’
INFO: restore openvz backup ‘vzdump-openvz-101.tgz’ successful



Posts Twitter Facebook

Editor in Chief at Debian-Tutorials, Linux enthusiast.

No Comments

Be the first to start the conversation.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.