Online KVM migration (dynamic migration)

Source: Internet
Author: User

Static migration
Static migration: it is also called conventional migration and offline migration (offlinemigration ). Is to shut down or suspend a virtual machine from a physical machine
Migrate to another physical machine. Because the Virtual Machine file system is built on the virtual machine image, when the virtual machine is shut down, you only need to migrate the virtual machine image and the corresponding configuration file to another physical
Host; if you want to save the status before migration, pause the VM before migration, copy the status to the target host, and then recreate the status of the VM on the target host to resume execution. This migration method
The process needs to explicitly stop the running of the virtual machine. From the user's perspective, there is a clear period of downtime, and services on the virtual machine are unavailable. This migration method is simple and applicable to scenarios where the service availability requirements are not strict.
.

Dynamic migration of shared storage
Live
Migration): Also called onlinemigration ). While ensuring the normal operation of services on virtual machines
The process of another physical host. This process does not significantly affect the end user, so that the administrator can perform offline repair or upgrade on the physical server without affecting the normal use of the user. And Jing
In order to ensure the availability of Virtual Machine services during the migration process, the migration process has only a very short downtime. In the first phase of migration, the service runs on the VM of the source host.
Stage, the target host already has the necessary resources to run the virtual machine system. After a very short switchover, the source host transfers control to the target host, and the virtual machine system continues to run on the target host. For virtual
Server service itself, because the switching time is very short, the user does not feel the service interruption, so the migration process is transparent to the user. Dynamic migration is suitable for scenarios where high availability of Virtual Machine services is required.
Contents
Previous mainstream dynamic migration tools, VMWare vmotion, Citrix
Xenmotion, all of which depend on the San (Storage Area Network) or
NAS (Network-attachedstorage) and other centralized shared external storage devices. Therefore, during migration, you only need to migrate the execution status of the VM system memory to obtain
Good migration performance.

The Red Hat KVM dynamic migration support list is as follows:

This article mainly introduces the dynamic migration based on the NFS shared storage pool, as shown in the following Architecture diagram (image conversion from click to open the link)

Environment: rhel6.1 x64
Vmm1: 10.1.1.116
Vmm2: 10.1.1.117
NFS server: 10.1.1.183

NFS storage pool
############################### Create an NFS storage pool #### ############################
The NFS server operation is as follows:
NFS shared directory to vmm1 and vmm2
==================================== Nfsserver ====== ======================================
#CAT/etc/exports
/Vm 10.1.1.116 (RW, sync, no_root_squash)
/Vm 10.1.1.117 (RW, sync, no_root_squash)
#/Etc/init. d/nfs restart
==================================== Nfsserver ====== ======================================

Add vmm to the NFS storage pool
================================== Vmm1 ======== ====================================
Open the KVM Virtual Machine Manager

The host details are displayed after double-clicking:


Click the Add button in the lower-left corner of the storage to add a storage pool and enter a name. Here, select netfs as the type (network export directory ):

After you click forward, the target path is the NFS mount path, select the NFS format, fill in the NFS server address and mount directory, and click Finish to create successfully:

After the storage pool is complete, the created NFS shared storage pool will appear:
(NFS shared storage will be automatically mounted to the corresponding directory after it is added. You do not need to manually mount it here)

================================== Vmm1 ======== ====================================

================================== Vmm2 ======== ====================================
Vmm2 is added to the NFS shared storage pool and vmm1 is the same
================================== Vmm2 ======== ====================================
############################### Create an NFS storage pool #### ############################

Install vmm1 on KVM
================================== Vmm1 ======== ====================================
Click Create volume create storage:

Adjust the storage volume size as needed

After installation, create a new virtual machine:

Select Local installation media

Select the corresponding system and version

The installation steps are not described here.
================================== Vmm1 ======== ====================================

After completing the preceding steps, you can achieve dynamic migration:
Connect to vmm2 on vmm1, as shown below:

Select the KVM virtual machine to be migrated, right-click migration, and the following migration options are displayed. Expand the advanced options. Enter 10.1.1.117 as the Migration host address.

After completing the settings, click "migrate!

After the migration is complete, the virtual machine status remains unchanged on vmm2 and runs normally.

Reference: http://www.ibm.com/developerworks/cn/linux/l-cn-mgrtvm2/index.html
Red Hat Virtualization official manual

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.