Virtual Machine Live Migration – How it works ?

Virtualization’s revolution has pushed many technical challenges from “impossible” category to the “possible” category. Live Guest OS Migration can be considered as one of the major benefits of the OS virtualization. Migrating the virtual machine from one host to another host without downtime facilitates fault management, load-balancing, and low-level system maintenance. It has eliminated all difficulties faced by process-level migration by just moving the whole virtual machine with running operating system.

Migrating the whole virtual means that in-memory state of VM can be transferred in a  consistent and efficient fashion during the live OS migration. It includes the kernel state, active TCP/IP connections, application state, and sockets. In the practical world, You can migrate the live database server without recycling the application to re-connect to the database. If you are migrating the web server, you no need to re-establish the session since your old sessions are still valid if you do the live migration.


Live OS migration :

Is it possible to migrate VM without downtime? No. There is a downtime required to migrate the VM in live migration too but without impacting the end user. The operating system has a timeout value for each process. For an example, to write the data to the disk have a certain amount of timeout value. Within this time-out time period, if we are able to migrate the VM from host to another host, all the TCP/IP connections will be valid & end users will not be impacted due to this migration. But how can you migrate the VM within the timeout period?  Looks impossible.

Live Migration addresses all of these concerns by using the pre-copy approach.  In which pages of memory are frequently copied from the source host to the destination host without stopping the execution of the virtual machine that is migrated.


Live Migration Timeline:

Stage 0:

Pre-Migration stage – A target host will be preselected where the resources required to receive migration will be guaranteed.


Stage 1:

Reservation – A request is submitted to migrate a VM from Host-A to Host-B. If the request is not fulfilled, then VM will continue to run on Host-A.


Stage 2:

Repetitive Pre-Copy: During the first iteration, all memory pages are transferred from Host-A to Host-B. Subsequent iterations copy are only those pages dirtied during the previous transfer.


Stage 3:

Stop (suspend)-and-Copy:  In this phase, VM will be suspended on Host-A and redirect its network traffic to Host-B. CPU state and any remaining inconsistent memory pages are then transferred like a final sync. This process will reach a consistent suspended copy of the VM at both Host-A and Host-B. Host-A will remain primary and it will be resumed in case of failure at this stage.


Stage 4:

Commitment to the hosts:  Host-B sends the signal to Host-A that it has successfully received a consistent VM OS image. Host-A acknowledges the signal and destroys the VM. Host-B becomes the primary host for migrated VM.


Stage 5:

Activation of VM:  The migrated VM on Host-B is now activated. Post-migration code connects to the local resources and resumes the operation.


VM Live Migration timelines
VM Live Migration timelines


Here is the list of hypervisor products which supports the Guest OS Live Migration.

  • VMware vSphere – vMotion
  • Xen – Live Migration
  • Oracle VM for x86 – Live Migration
  • RHEV – Live Migration.
  • Oracle LDOM – Live Migration
  • AIX – LPAR – Live Migraiton
  • Microsoft Hyper-V


VMware vMotion
VMware vMotion


Hope this article is informative to you. Share it! Comment it !! Be Sociable !!!