Vzdump is a tool to backup and restore OpenVZ container. It is easy and flexible to use, but VZdump is not included in the openvz repository for CentOS. If you need to use vzdump, you have to download its source and compile it yourself.


How to install VZdump

Running command as following

rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
wget http://download.openvz.org/contrib/utils/vzdump/vzdump-1.2-4.noarch.rpm
yum install cstream perl-LockFile-Simple
rpm -ivh vzdump-1.2-4.noarch.rpm

How to backup OpenVZ container

In example the container has ID 101 and to backup, type command

vzdump --compress --suspend 101
Or backup all container
vzdump --compress --suspend --all

How to restore OpenVZ container

In example restore the container has ID 102

vzrestore /vz/dump/vzdump-openvz-101-2014_03_27.tgz 102
And if success, the screen look likes

INFO: restore openvz backup ‘/vz/dump/vzdump-openvz-101-2014_03_27.tgz’ using ID 102
INFO: extracting archive ‘/vz/dump/vzdump-openvz-101-2014_03_27.tgz’
INFO: Total bytes read: 346787840 (331MiB, 70MiB/s)
INFO: extracting configuration to ‘/etc/vz/conf/102.conf’
INFO: restore openvz backup ‘/vz/dump/vzdump-openvz-101-2014_03_27.tgz’ successful

Post a Comment

Silahkan anda tulis komentar di bawah ini !