Requirements to Migrate Virtual Machine

The following requirements must be met before performing a live migration of a virtual machine to another KVM host.
  • The source and destination hosts are running.
  • Ensure the following ports are open on the destination host.

    • Port 22 is needed for connecting to the destination host by using SSH.
    • Port 16509 is needed for connecting to the destination host by using TLS.
    • Port 16514 is needed for connecting to the destination host by using TCP.
    • Ports 49152-49215 are needed by QEMU for transferring the memory and disk migration data.
  • The VM must be compatible with the CPU features of the destination host.
  • The VM's disk image is accessible to the source host and the destination host.
  • When migrating a running VM, the network bandwidth rate must be higher than the rate in which the VM generates dirty memory pages.

    To obtain the VM dirty page rate before you start the live migration, using the terminal CLI perform the following:

    1. Monitor memory generation rate for a short duration.

      sudo virsh domdirtyrate-calc vm-name 30
    2. After the monitoring process completes, obtain its results:

      sudo virsh domstats vm-name --dirtyrate
      Domain: 'vm-name'
        dirtyrate.calc_status=2
        dirtyrate.calc_start_time=200942
        dirtyrate.calc_period=30
        dirtyrate.megabytes_per_second=2

      In this example, the VM is generating 2 MB of dirty memory pages per second. A live-migration of this VM on a network with a bandwidth of 2 MB/s or less prohibits the migration to proceed unless you pause the VM or decrease the VM's workload.

      To ensure that the live migration completes successfully, the network bandwidth must be much greater than the VM's dirty page generation rate.

      WARNING:

      For VM instances with processing tasks that changes memory pages faster than the KVM can transfer them, such as heavy I/O load tasks, the recommendation is to avoid performing a live migration on these type of VM instances.