KVM virtual machine live migration

Migration Profile

migrate:

      Migration refers to the system of the operating system and applications on the source host to the destination host moves, and works correctly on the destination host. In no time the virtual machine migration between physical machines rely on the system backup and recovery techniques. In the real-time backup status on the source host operating system and applications, and the storage medium is connected to the target host, the final recovery system on the target host. With the development of virtual machine technology, the migration system more flexible and diverse. (Full backup {} full backup, incremental backup backs up only newly added {contents})

Our ultimate goal is to migrate:

Simplify system maintenance and management

High system load balancing

Augmentation System error tolerance

Optimize system power management (Let's say you have 100 kvm host in the company, which ran above are virtualized, was running a small virtual machine, dictation time you reach the volume of business is not great, some virtual machine do not need to boot, or there is a great host in the resource, it only runs a virtual machine, then I in order to save resources, save power, I will put some other man-made important virtual machines move me the relatively high resource host, make me a host running multiple virtual machines, this is the case, the original host can always such a shutdown, when traffic increases, you can open the host.)

--- Live Migration Live Migration

KVM live migration of virtual machines --- Live Migration:

      Server virtualization technology is the current hot spot, and the "hot migration (Live Migration)" virtual machine technology is among the hot virtualization technology.

Live migration (also known as live migration, live migration), a virtual machine that is saved (save) / restore (restore): The overall state of the virtual machine preserved intact, and can quickly be restored to the original hardware platforms or even different hardware on the platform. After recovery, the virtual machine is still running smoothly, users will not notice any difference.

Migration of species:

P2P: migration between physical machines

V2P: physical machine virtual machine moved

P2V: physical machine move virtual machines

V2V: VM virtual machine moved

Application of heat migration

Heat Transfer Technology, the virtual machine was originally used in the fault-tolerant or load balancing: When the host hardware failure leads to abnormal service, a virtual machine can shift to another host or in a cluster based on the amount of workload size, choose whether or not to replace the host to ensure their good service to provide sexual.

2. System hardware maintenance: the current number of operating systems are able to support the stability of 7 × 24 operation, but the hardware it needs regular maintenance. If a dynamic migration of virtual machine technology, the virtual machine from the need to maintain the physical machine to another master device, Once maintenance is completed, it is moved back to the original physical machine. All system services and applications still run properly after recovery & migration, users will not notice due to the interruption caused by hardware maintenance. Finally achieved our hardware maintenance services from interference 7 * 24 hours of work aspirations.

3. Database Backup: For some large, critical database applications, backup is an important but complex task. Save VM / restore database can be run in a virtual machine, the virtual machine is saved To back up all data in this database, the state has done a backup. If the database crashes, you can recover the entire database by restoring a virtual machine. (What store? What is a database? Storage generally refers to your machine's hard disk space, or block device you insert the back-end database is a software, is a table of information)

4. Environment reproduce: performance testing or debugging, the need to reproduce the complex was huge and fully consistent with real-time network environment, not just restart, configuration software, and often take some time to run. We can install each service to separate each virtual machine, then use the individual virtual machine deployments we need work environment, can greatly shorten the time to reproduce the environment.

5. Computer Sharing: In some public users need to share computers, but due to different system configurations and software need to spend a lot of time configuring and recovery. Then use the virtual machine to save / restore can solve this problem. Alternatively, you can run multiple logical virtual machines assigned to each of us to help those who need an independent, secure, stable environment on the physical machine. When the host because the problems affecting the virtual machine, the virtual machine so that we can shift to another host in order to maintain normal work.

Live Migration advantage

1. The first is scalability strong, IT managers can make some business-critical servers running in a reasonable period of time appropriate to reduce the amount of work in order to update the operating system to the application patching and so on. By the peak of the service, and can be flexibly big load operations. Virtual machine migration process is completely transparent, almost does not affect use.

2. Secondly, data centers are now pursue green energy, a large amount of work load of the application server will certainly give the increase in energy consumption, with the virtual machine live migration technology, when a single physical server load is too large, the system administrator can thereon migrate virtual machines to other servers, which can effectively reduce the overall power consumption of the data center server, and then through the cooling system the temperature of the data center is maintained at normal levels.

Limitations live migration

Live Migration of virtual machines, there are many restrictions. E.g,

      Before performing VMotion migration, management software detects the target server's X86 architecture is compatible with the original server. Includes a storage device and a processor, the virtual machine must be placed in shared storage, but also the same type of CPU, Intel is not only not a one is AMD, or even the same manufacturers of different product lines CPU does not work, such as Intel's Xeon and gallop

A measure of the efficiency of virtual machine migration

 1. The overall migration time: migration time on the destination host client services will be unavailable to start operating from the source host, then the source host client has been out of service, the client has not been restored on the destination host service.

2. server downtime: During the migration process, the client on the source and destination hosts are in a time unavailable at this time on the source host client has been suspended, the purpose of the destination host client has not been restored

Complex services.

3. affect the performance of the service: not only include relatively lower than if somewhat before the performance and application migration client after migration, also including the impact on the performance of other services on the destination host after migration.

Kvm live migration, there are a few precautions and following recommendations:

1. The source host and destination host directly as possible with a network of shared storage system to store a client disk image. For example NFS, ISCSI, Glusterfs like.

2. In order to improve the success rate of live migration, dynamic migration as far as possible above the same type in the host cpu, although kvm also supports live migration to migrate from Intel amd platform to platform. However, the security, stability considerations do not propose to operate! ! !

3.64 client can run the migration between the host computer 64, and client 32 may be migrated between host 32 and host 64.

4. When performing a live migration, the migrated name of the client is unique on the destination host has not migrated with the same name as the source client host client exists.

The object of the host and the source host the same software as much as possible. That is the same as Vmware, KVM, Xen and so on.

Experimental Procedure

The first step, opened two graphical host, who clearly was the Lord, who is the target

Step NFS service structures (third machine can be set up, two of which may be optionally substituted one building)

(1)NFS Server

Installation yum install nfs-utils rpcbind -y

Configure vim / etc / exports

/ Nfsdate * (rw, sync) # * on behalf of all IP can access, rw for read and write, sync representative of real-time synchronization

Open systemctl restart nfs rpcbind

Modify a shared directory permissions chmod 777 nfsdate /

(2)NFS client

Installation yum install nfs-util

Showmount -e server side detection ip

Mount mount -t nfs server side ip: / nfsdate / nfsdate

The third step is to determine the current host machine is migrated virtual machine, the virtual machine disk files to move to the next nfs server side shared directory and copy the virtual machine's configuration files to a shared directory, modify the configuration file

virsh edit virtual machine name

Modify <devices> segment

<Source file = '/ nfsdate / VM name .qcow2' />

The fourth step cancel the original domain and the new domain

virsh undefined virtual machine name

virsh define virtual machine configuration file

The fourth step to modify the virtual machine disk file permissions to 777

chmod 777 virtual machine name .qcow2

The fifth step to open this virtual machine

The sixth step you have to migrate to manage the host you want to migrate to the host

The seventh step you want to migrate to the host can manage the host you can migrate

Openssh-askpass need to download software

Step eight two host set a new host name, and add a host name resolution

hostnamectl set-hostname yunwei1

hostnamectl set-hostname yunwei2

vim /etc/hosts

ip yunwei1

ip yunwei2

The ninth step to open a graphical interface, right-click the virtual machine, select Migrate

Guess you like

Origin www.cnblogs.com/shuaiyin/p/10962497.html