Skip to content

Live migrating OVZ mainstream container

efiop edited this page Oct 11, 2014 · 26 revisions

This page describes how to create and live migrate and OVZ container on Fedora 20. Hopefully, the same is true for some other distros.

The p.haul needs this software to work

After cloning the p.haul repository make sure that p.haul/*.proto links point to respective files in CRIU sources. Then run make to compile CRIU images reading modules for p.haul.

Also make sure, that source node has keys-based ssh access to the destination one, or the FS on which containers are located is shared between these two nodes. The former requirement is to make sure rsync can successfully copy container's private from source node to destination one.

P.Haul assumes, that private and root directories as /vz/private and /vz/root respectively (this is to be fixed some time soon though).

Table of Contents

Create and start a container

Checked and known to work are the templates below

  • Centos-6-x86_64
  • Ubuntu-10.04-x86_64
Check the known issues page for potential problems you might have while migrating a container. If you want your container to be accessible via network while being migrated, check this page

Migrate it

Migrating is done using the p.haul script with the help of p.haul service on destination node. Both, p.haul command and service use CRIU service to dump and restore container.

  • Start CRIU service on both nodes
 # criu service -v4 -o $log_file --daemon
  • Start P.Haul service on destination node
 # p.haul-service
  • Do live migration
 # p.haul ovz $id $dst_node_ip

Troubleshooting

  • P.Haul makes criu keep log files and images in the /var/local/p.haul-fs/$temp-name/ directory. When migration fails, this directory is not removed.
  • If you want to keep the images after successful migration, use the --keep-images option for P.Haul.
  • By default the log-level 2 is used by CRIU. To increase verbosity use the -v$N option for P.Haul.

Report BUGs

Feel free to contact us on xemul (at) parallels (dot) com and criu (at) openvz (dot) org