What is live migration?
Live migration is the process of moving a virtual machine (VM) from one host to another without interrupting access to the VM. The time between suspending the old VM and starting the new one is brief, making it possible to avoid service interruptions during migrations. Live migration is used in situations like planned maintenance or to balance workload resources. Live migration involves the transfer of VM memory, network connectivity, and storage to a new destination within the cluster.
What are the types of VM migration?
When it comes to migrating virtual machines, there are multiple types of migration with the two most common being live migration and cold migration.
Live (hot) migration
This is when a VM continues to run on the source host machine while its memory pages are being transferred to the destination host. When the migration is almost complete, the VM will briefly pause then resume on the destination host. Because live migration doesn’t involve shutting down VMs, your downtime is kept to a minimum or imperceptible. This is a good option for VMs that require constant uptime. However, if a VM can modify memory pages faster than they can be transferred, like VMs under heavy input-out (I/O load), then cold migration must be used instead.
Cold migration
This type of migration is also considered non-live migration. It involves shutting down a running VM before transitioning from the source host to the destination host. While the VM is shutdown, its configuration and memory is copied to the destination host, and then the VM resumes on the new host. This creates downtime resulting in your system being temporarily unavailable or inoperative. However, it is a reliable migration process and a good option for VMs under heavy memory load.
Warm migration
This type of migration reduces downtime by copying most of the VM data during a precopy stage while the VMs are running. During the cutover stage, the VMs are stopped and the rest of the data is copied.
Red Hat resources
What are the reasons for migrating VMs?
Migrating VMs can be useful for:
- Load balancing: VMs can be moved to host machines with lower usage if their host becomes overloaded or if another host is under-utilized. Through load balancing, you can improve VMs capacity and network performance.
- Hardware independence: Hardware independence is facilitated by the hypervisor, which isolates the operating system (OS) and resources from the VMs. Because they run as isolated environments, VMs aren't dependent on any specific hardware. In many situations, you can migrate a VM from one piece of hardware to another without experiencing any downtime. (There are some limitations to this however, such as when switching from one CPU architecture to another.)
- Energy saving: VMs can be redistributed to other hosts, and the unloaded host systems can thus be powered off to save energy and cut costs during low usage periods.
- Geographic migration: VMs can be moved to another physical location for lower latency or when required for other reasons, like balancing for fault tolerance or disaster recovery.
What are some well known VM live migration tools?
All popular virtualization platforms include live migration tools. Some of these technologies include:
Red Hat® OpenShift® Virtualization live migration: Based on the KubeVirt project, OpenShift Virtualization includes a live migration tool built in. Live migration moves a virtual machine from one node to another in the OpenShift cluster.
VMware vSphere vMotion: vSphere vMotion is VMware’s live migration process that eliminates downtime while enabling a running VM to be moved from one physical server to another.
Hyper-V from Microsoft Windows Server: As a Hyper-V feature in Windows Server, live migration allows VMs to move from one Hyper-V host to another.
Nutanix: Nutanix AHV’s live migration feature lets a guest VM move from one AHV host to another AHV host or cluster if the chosen host has available resources.
The step-by-step process of live migration
Live migration takes place in several steps. The steps can vary based on the platform and use cases, but the goal of live migration remains the same. Below are the steps on how OpenShift Virtualization achieves live migration.
Step 1: Preparation
The source node prepares the VM for migration, and the scheduler that exists at the cluster level (which in this case is OpenShift scheduler) chooses the desired destination node. Because live migration depends on shared storage, both the source and destination mount, or access, the same storage at the same time when the VM image is stored.
Step 2: Request
Next, the source node initiates a migration request to the destination node. The destination node starts loading the VM image and reserves the correct container size. This step also requires a virtualization platform to allow the VMs resources to be distributed between the two environments and run without interruption. If there are no resources available, the VM continues running in the source node with no impact.
Step 3: Transfer
The hypervisor, a software that creates and runs VMs, copies the memory from the source node to the destination. In both nodes, there is a paused copy of the VM, but the source node is considered the main node to allow migration to continue in the event of a failure.
Step 4: Finalize
Once the transfer has taken place, the destination node signals to the source node that it has received the OS image and executed the migration transaction. Now, the destination node becomes the primary node. The source node can now terminate the original VM.
Step 5: Completion
With a new primary node, live migration is done. The migrated VM runs on the destination node, and operations can continue as usual.
Why choose Red Hat to support live migration?
Red Hat’s portfolio of solutions for VMs and virtualization can support you in your live migration process.
Red Hat® OpenShift® Virtualization offers a unified, scalable platform for migrating traditional virtual machines. A feature of Red Hat OpenShift, Red Hat OpenShift Virtualization allows you to run and manage virtual machine workloads alongside container workloads. With Red Hat OpenShift Virtualization, you can continue using the virtualized technologies you’re invested in and modernize at your own pace through Red Hat OpenShift’s cloud-native tools. Teams can deploy and manage VMs along with containers on a single platform. Additionally, the migration toolkit for virtualization allows you to migrate existing workloads from your current virtualization solution. The migration toolkit for virtualization gives access to workloads running on virtual machines, while allowing the development of new cloud-native applications.
For at-scale migration acceleration, Red Hat Ansible Automation Platform can automate the orchestration of VMs and surrounding IT infrastructure. Red Hat OpenShift Virtualization used with Red Hat Ansible Automation Platform accelerates the migration of VMs and aids in the management, operation, and modernization of virtual environments. It also reduces the potential for human error and improves consistency throughout migration and ongoing VM workload management.
The official Red Hat blog
Get the latest information about our ecosystem of customers, partners, and communities.