Monday, 3 December 2012

openvz VPS Migration

Install vzdump command if it is not installed in the Node.



There will be some dependency errors while installing vzdump. Please install those also also using rpm.

How to take dump of a vps?

 vzdump vid

While using the vzdump command I got the below given error :

Can’t locate PVE/ in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/sbin/vzdump line 27.
BEGIN failed–compilation aborted at /usr/sbin/vzdump line 27.

Solution :

 ln -s /usr/share/perl5/PVE/ /usr/lib/perl5/5.8.8/PVE

After that take the dump of the vps again using the command vzdump vid. The dump will get created in the /vz/dump partition.

When it gets completed we need to scp the vps dump to the Node were we wants to restore it.

How to restore a vps?

  vzrestore vzdump-777.tar 160, where 160 is the VID of the vps to which we are going to restore.

After migration the VPS was not listing in the Hypervm.

 >> Stop the vps which was migrated.
 >> Move the conf file of the vps from /etc/vz/conf
 >> Move the vps data also from /vz/private to avoid conflicts.
 >> Create vps from hypervm
 >> Move back the data and conf of the vps.
 >> Restart the vps
 >> Migrated vps will appear in the Hypervm.

No comments:

Post a Comment