Product SiteDocumentation Site

Chapter 18. KVM live migration

18.1. Live migration requirements
18.2. Shared storage example: NFS for a simple migration
18.3. Live KVM migration with virsh
18.4. Migrating with virt-manager
This chapter covers migrating guests running on a KVM hypervisor to another KVM host.
Migration is the term for the process of moving a virtualized guest from one host to another. Migration is a key feature of virtualization as software is completely separated from hardware. Migration is useful for:
Migrations can be performed live or offline. To migrate guests the storage must be shared. Migration works by sending the guests memory to the destination host. The shared storage stores the guest's default file system. The file system image is not sent over the network from the source host to the destination host.
An offline migration suspends the guest then moves an image of the guests memory to the destination host. The guest is resumed on the destination host and the memory the guest used on the source host is freed.
The time an offline migration takes depends on network bandwidth and latency. If the network is experiencing heavy use or low bandwidth the migration will take much longer.
A live migration keeps the guest running on the source host and begins moving the memory without stopping the guest. All modified memory pages are monitored for changes and sent to the destination while the image is sent. The memory is updated with the changed pages. The process continues until the amount of pause time allowed for the guest equals the predicted time for the final few pages to be transferred. KVM estimates the time remaining and attempts to transfer the maximum amount of page files from the source to the destination until KVM predicts the amount of remaining pages can be transferred during a very brief time while the virtualized guest is paused. The registers are loaded on the new host and the guest is then resumed on the destination host. If the guest cannot be merged (which happens when guests are under extreme loads) the guest is paused and then an offline migration is started instead.

18.1. Live migration requirements

Migrating guests requires the following:
Migration requirements
  • A virtualized guest installed on shared networked storage using one of the following protocols:
    • Fibre Channel
    • iSCSI
    • NFS
    • GFS2
  • Two or more Red Hat Enterprise Linux systems of the same version with the same updates.
  • Both systems must have the appropriate ports open.
  • Both systems must have identical network configurations. All bridging and network configurations must be exactly the same on both hosts.
  • Shared storage must mount at the same location on source and destination systems. The mounted directory name must be identical.
Configuring network storage
Configure shared storage and install a guest on the shared storage. For shared storage instructions, refer to Part V, “Virtualization storage topics”.