Migration is the process of importing a virtual machine between cluster nodes. VMmanager migrates machines using libvirt. For successful completion of the operation, the same QEMU-KVM and virsh versions must be installed on both the source and target cluster nodes.
If you migrate a virtual machine with local storage, its RAM and disk will be copied. The format of the source and target servers must be the same (RAW or Qcow2).
If you migrate a virtual machine with network storage, only its RAM will be copied. The disk will be connected to the cluster node the machine is migrated to. Normally, in case of common or "Suspended" migration the virtual machine with network disk will be migrated during a few minutes.
Migration types
- Live migration — (the "Live migration" option is enabled) VMmanager supports live migration of running virtual machines. A virtual machine will be up and running during migration. Live migration can be used to migrate small amounts of data on virtual machines that are not actively used, otherwise, some data may be lost.
- Migration of suspended virtual machine — this type of migration is performed when a virtual machine gets suspended before the migration process.
Live migration:
- The system copies the XML-description of the virtual machine to the target server;
- Imports the VM disk:
- If the disk is located in a local storage, it will be copied to the target server;
- If the disk is located in a network storage, it will be connected to the target server.
- QEMU periodically checks the current state of a virtual machine, and if the state changes during migration (data are changed), the process will continue, and modified data will be overwritten. If the virtual machine is in use, and its data are constantly changed causing the migration to fail, the virtual machine will be turned off, and the migration process will be completed;
- Deletes the virtual machine on the old server;
- Starts the virtual machine on the new server
Migration of a suspended virtual machine:
- The system copies the XML-description of the virtual machine to the target server;
- Imports the VM disk:
- If the disk is located in a local storage, it will be copied to the target server;
- If the disk is located in a network storage, it will be connected to the target server.
- Deletes the virtual machine on the old server;
- Starts the virtual machine on the new server
If you run the live migration of the actively used virtual machine, the process may take a long time and the data may get lost.
The live migration can be interrupted if the virtual machine is rebooted during the process. Therefore, the migration terminates, and the virtual machine will remain on the source cluster node.
Migration procedure
To migrate a virtual machine, navigate to "Management" --> "Virtual machines".
- Destination server — select a cluster node to which this virtual machine will be migrated. The default value is "Select automatically". In case of the automatic selection, a node with the largest amount of RAM will be selected among all available nodes. A cluster node can be used for VM migration if there are no connection, libvirt, or NFS issues. If the node with the largest amount of RAM, is the one that the virtual machine is migrated from, the migration process won't start.;
- Live migration — select the checkbox to enable live migration.
Migration status
When the migration process starts, in the virtual machine status you will see the icon:
Click on this button to cancel migration of the virtual machine.