-
What are the types of VM migration?
-
Virtual machine migration techniques
-
Some requirements for virtual machine hot migration
-
Convenient VM migration solution for multiple virtualization platforms
-
Sum Up
What are the types of VM migration?
Generally speaking, there are two types of VM migration methods, cold migration and hot migration.
Cold migration, also called offline migration, is the traditional VM migration solution, which means moving VM from one physical server to another when it is suspended or closed. VM file system is built in VM image so clold migration just requires moving VM image and the corresponding configuration file to another physical server. If the VM status needs to be preserved during the migration process, VM should be suspended before being copied to the destination server.
For example, IT administrators can move ESXi VM by exporting it as OVF template from the source host and then importing it to another host via vCenter.
Cold migration will interrupt the operating system so the services on the VM will be temporarily unavailable but the requirements are relatively simple so it is often used in common scenarios.
Hot migration, also called live migration or online migration, which means moving VM from one physical server to another without suspending or shutting it down. Because the services on the VM run normally so the experience of visitors will not be badly influenced. IT administrators can repair, maintain, or upgrade the physical server without stopping the related services in this way.
You can see the used techniques and how hot migration works in this post: What is Live Migration of Virtual machine?
Compared with cold migration, hot migration process is shorter and makes the services on VM available during the progress. During the early stage, the services rely on the VM on the source server, but in the middle stage, the destination server has obtained the necessary resources for running the VM file system, so with a short switch, VM start running on the destination server. For the services, the progress of switch is very short so users can feel that the services are interrupted. Hot migration is often used in high-requirement scenarios.
Virtual machine migration techniques
For mature virtualization solutions, there will be the management tools to let users easily move VM like vCenter, Hyper-V Manager, etc. If you would like to know the migration techniques of VMware and Hyper-V, you can refer to the posts below:
For VMware: How to use vMotion to migrate VMware ESXi VM?
For Hyper-V: How to move Hyper-V VM to another host?
The following content will focus on using Virsh command to hot migrate VM managed by libvirt
1. Use Virsh command to create the shared pool
[root@co5013 ~]# virsh pool-autostart virsh_pool
Pool virsh_pool marked as autostarted
[root@co5013 ~]# mkdir -p /var/lib/libvirt/images/virsh_pool
[root@co5013 ~]# virsh pool-start virsh_pool
Pool virsh_pool started
2. Use the command below to create a volume
[root@co5013 images]# virsh vol-create-as virsh_pool virsh_test.img 8G --format raw
Vol virsh test.img created
3. Create new VM in the shared storage pool:
A). Create new VM on the newly-created volume in the shared storeage pool
Use virt-install command to create VM:
[root@co5013 root]#virt-install --name virsh_test --ram 1024 --location /home/rhel-server-6.0-x86_64-dvd.iso --disk=/var/lib/libvirt/images/virsh_pool/virsh_test.img pool=virsh_pool vol=virsh_test.img bridge br0 --virt-type=qemu
B). Create new VM by importing the image in the shared storage pool
[root@co5013 root]#vir-install name virsh_test ram 1024 import /var/lib/libvirt/images/virsh_pool/virsh_test.img disk /var/lib/libvirt/images/virsh_pool/virsh_test.img
4. Start hot migration
Make sure SELinux (Security-Enhanced Linux) is disabled on both the source and destination server and then start hot migration.
[root@co5013 ~]# virsh migrate --live virsh_test qemu+ssh://168.171.5.28/system
<p>root@168.171.5.28’s password:
After that, check whether VM virsh-test is running on the new server.
Some requirements for virtual machine hot migration
To make sure VM is successfully moved to the new server, there are some requirements:
The shared storage should be in the same directory, which means the image directory should not be changed but the names of storage pools can be different.
The operating systems of the source server and destination server should be the same.
The name of the bridge should not be changed.
SELinux should be disabled on both the source and destination server.
Firewall should be configured to allow hot migration between the source server and destination server.
Name resolution is workable on both the source and destination server.
Convenient VM migration solution for multiple virtualization platforms
With the traditional VM migration technique, you need different tools or commands to move VM between hosts but this progress can be simplified with Vinchin Backup & Recovery, a professional VM backup and disaster recovery solution.
Vinchin Backup & Recovery supports VM backup on multiple virtualization platforms like VMware vSphere, Red Hat Virtualization, oVirt, XenServer, XCP-ng, OpenStack, Oracle Linux KVM, etc.
You can backup VM agentlessly on a user-friendly web-console and then use the VM backup to recover VM on another host in the backup system. Compared with the traditional VM migration technique, the process is greatly simplified and you don’t have to convert the VM before performing cross-platform migration.
Vinchin Backup & Recovery has been selected by thousands of companies and you can also start to use this powerful system with a 60-day full-featured free trial. Just click the button to get the installation package.
Sum Up
Virtual machine migration means moving VM from one host to another and there are two types of migration methods, cold migration and hot migration. There are different techniques used for different migration progresses. For example, you can use vCenter to move ESXi VM or use Virsh command to move KVM VM.
There is also a more convenient migration solution for you. Don’t miss the free trial of Vinchin Backup & Recovery.
Share on: