How to Manually Migrate a VZ Container

Posted by Vanessa | Tagged under | Posted on Nov 11, 2011

0

Have a tricky VPS that vzmigrate just can’t move? Luckily, Virtuozzo (and OpenVZ for that matter) are pretty simple in terms of how the containers are set up. You’re mainly dealing with two locations that data for the container is stored:

/vz/private/$VEID
/etc/vz/conf/$VEID.conf

To manually move a container to another node, all you need to do is copy those folders:

rsync -av /vz/private/$VEID $newserver:/vz/private
rsync -av /etc/vz/conf/$VEID $newserver:/etc/vz/conf

Then on the server server, just start it right up. You do need to have the container’s OS template installed on the new node, as referenced in the container’s config file.

This same process also applies to cloning a VPS, which is particularly useful on an OpenVZ server where the vzmlocal command isn’t available. All you have to do is use similar commands to rsync the container’s private folder to a new VEID:

rsync -av /vz/private/$VEID /vz/private/$NEWVEID
rsync -av /etc/vz/conf/$VEID /etc/vz/conf/$NEWVEID

Then just change the hostname and ip variables in the new container’s config file.

Liking this article? Share it and spread the word!
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • DZone
  • LinkedIn
  • Live
  • MySpace
  • PDF
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Tumblr
  • Twitter

Related posts:

  1. Upgrading from VZ 4.0 to VZ 4.6   If your server already has VZ 4.0, it’s very...

Related posts brought to you by Yet Another Related Posts Plugin.

Write a comment