5

From this article: Virtualization: What is KVM? and other resources, I learned that it is possible to migrate a Live VM from one host to another?

Live migration
KVM supports live migration, which is the ability to move a running VM between physical hosts with no service interruption. The VM remains powered on, network connections remain active, and applications continue to run while the VM is relocated.

Can some one eloborate on how this is made possible?
In general, A running VM is tied to some hardware (real or virtual) like memory, cpus, disks, graphics, network etc. And it's tied to the Host OS (in case of type-2 hypervisors) or Hypervisor/KVM(in case of type-1 hypervisors). On the new host, the VM has to rebind itself with the above said resources/drivers etc - which could indicate a downtime (might be short).
So how is a live migration with zero service disruption made possible.

Thanks for any responses in advance.

samshers
  • 228
  • 1
  • 4

1 Answers1

7

For the live migration to be possible there are some prerequisites regarding the host operating systems and their hardware. First, they need to have a shared storage, mounted similarly. They also need to have same OS versions and identical network configurations.

Once these requirements are met, the live migration is about copying the contents of the memory of the guest system from a host to another. This is explained in detail e.g. in the Fedora documentation, Chapter 20. KVM live migration.

Esa Jokinen
  • 43,252
  • 2
  • 75
  • 122
  • 1
    +1, from the link - `the amount of pause time allowed for the guest` - so there is still a brief interruption which of-course is acceptable to the application. – samshers Sep 13 '20 at 12:45
  • 2
    Just to add, I am not sure about KVM, but both vMotion (vSphere) and Live Migration (Hyper-V) both support the migration without shared storage. Haven't found official information about this on KVM. The following article shows that it is possible: https://hgj.hu/live-migrating-a-virtual-machine-with-libvirt-without-a-shared-storage/ I worked with Live Migrations on Hyper-V a lot.The following article is helpful: https://www.hyper-v.io/hyper-v-live-migrations-settings-ensure-best-performance/ – Stuka Sep 13 '20 at 15:48
  • 1
    KVM has had storage migration for several years now. As for the service interruption, from the VM it should be pretty much instantaneous, but there might be a small fraction of a second of network connectivity loss where the switch is updating its idea of where the VM's NIC is (e.g. CAM table); as it starts up, the destination VM sends a gratuitous ARP to tell the switch about the move. – Michael Hampton Sep 13 '20 at 20:23
  • Would you believe I saw somebody advertising live migration of a VM as a response to hardware failure of the VM host? – joshudson Sep 13 '20 at 20:42
  • @joshudson Depends on the failure... from the link, `Hardware failover - when hardware devices on the host start to fail, guests can be safely relocated so the host can be powered down and repaired.` – Neil Sep 13 '20 at 21:03