Previous page

Next page

Locate page in Contents

Print this page

Standard Migration

Using the standard migration technology, you can move

  • stopped, running, and suspended Containers
  • stopped and suspended virtual machines

Standard migration includes copying all files of a virtual machine or Container from one host to another and does not differ from copying a number of files from one server to another over the network. For a running Container, the migration procedure is a bit more complicated and is described below:

  1. Once you start the migration, all Container data are copied to the destination server. During this time, the Container on the source server continues running.
  2. The Container on the source server is suspended.
  3. The Container data copied to the destination server are compared with those on the source server, and if any files were changed during the first migration step, they are copied to the destination server again and rewrite the outdated versions.
  4. The Container on the destination server is resumed.

There is a short downtime needed to stop the Container on the source server, copy the changed data to the destination server, and start the Container on the destination server.

Migrating Containers

The following session moves Container 101 from the source server to the destination server ts7.test.com:

# pmigrate c 101 c root:XXXXXXXXX@ts7.test.com/101

The c option in the command above tells pmigrate that you are moving a Container to a Container. If you do not indicate the credentials to log in to the destination server, you will need to do so during the migration.

Important! For the command to be successful, a direct SSH connection (on port 22) must be allowed between the source and destination servers.

By default, after the migration process is completed, the Container private area and configuration file are renamed on the source server by receiving the .migrated suffix. However, if you want the Container private area on the source server to be removed after the successful Container migration, you can override the default pmigrate behavior by changing the value of the REMOVEMIGRATED variable in the Virtuozzo global configuration file (/etc/vz/vz.conf) to yes or by using the –r yes switch with the pmigrate command.

Migrating Virtual Machines

In turn, to migrate a virtual machine from the source server to ts7.test.com, you need just to specify v instead of c and the name of the resulting virtual machine instead of Container ID 101:

# pmigrate v MyVM v root:XXXXXXXXX@ts7.test.com/MyVM

This command moves the MyVM virtual machine from the local server to the destination server ts7.test.com. Once the migration is complete, the original virtual machine is removed from the source server. However, you can use the --keep-src option to leave the original virtual machine intact.

For virtual machines, pmigrate also supports the migration from a remote host to the local one:

# pmigrate v ts7.test.com/MyVM v localhost

This command moves the MyVM virtual machine from the ts7.test.com server to the local server.

Note: For more information on options that you can pass to pmigrate, refer to the Virtuozzo 6 Command Line Reference.