Xen Virtual Machine migration Experiment

Source: Internet
Author: User
Tags time 0
You are here: Migration type of home/virtualization technology/xen Virtual Machine

2012 by day · leave
A comment

[Introduction] You are familiar with the installation and use of xen virtual machines, but some are not familiar with xen migrate operations. This xen high-availability Technology ensures uninterrupted services of guest.
The following describes several common xen guest domain migration operations, mainly about dynamic migration. If there are any mistakes in this article, you are welcome to make a brick.
1. for cold static migration, You need to disable the guest domain.
XM save domain/ID checkpointfile saves the VM status checkpoint, and the checkpoint stores the current status information of the guest configuration.
Copy the guest domain configuration file, image, and checkpoint file to the target xen server.
XM create-config XX. xml starts the guest domain.
Restore checkpoint XM restore checkpointfile
 
Ii. Warm static (regular) Migration static migration or regular migration
This migration is only a temporary pause (suspend) Guest domain on the original host without shutting down or restarting, and then the memory and process are resumed on the target host machine (resume.
Example:

XM migrate vmtest 192.168.200.61 # The service of the guest domain is interrupted.

[Root @ vm61 etc] # Ping 192.168.200.40 (the guest domain is suspended at this time)
Ping 192.168.200.40 (192.168.200.40) 56 (84) bytes of data.
From 192.168.200.61 icmp_seq = 1 destination host unreachable
From 192.168.200.61 icmp_seq = 2 destination host unreachable

After the guest migration is complete, the guest domain is running properly.
[Root @ vm61 etc] # Ping 192.168.200.40
Ping 192.168.200.40 (192.168.200.40) 56 (84) bytes of data.
64 bytes from 192.168.200.40: icmp_seq = 1 TTL = 64 time = 2.13 MS

-192.168.200.40 Ping statistics-
1 packets transmitted, 1 received, 0% packet loss, time 0 ms
RTT min/AVG/max/mdev = 2.139/2.139/2.139/0.000 MS
[Root @ vm61 etc] # XM console vmtest

Centos release 5.8 (final)
Kernel 2.6.18-308. el5xen on an x86_64

Localhost. localdomain login:

3. Live migration Dynamic Real-Time Migration
Sometimes it is inappropriate to interrupt the system service to migrate the guest domain. Of course, the ideal thing is that dynamic migration can be migrated to a new physical host with just an instant interruption of system services.
The following describes the migration requirements and dynamic migration operations.

Migration requirements:
1. Two or more physical hosts need to enable the migration Configuration
2. Physical hosts are interconnected in the same LAN
3. shared storage is required between hosts.
4. The Guest configuration files must be the same between hosts.
5. The system resources on the target physical host must meet the requirements of the guest domain.
6. The same version of xen must be used between hosts.

Dynamic migration (two physical hosts, server1dom0 and server2dom0, with xen version 4.1 ):
1. Two physical hosts need to open the following configuration in/etc/xen/xend-config.sxp and then restart the xend service.
(Xend-relocation-server yes)
(Xend-relocation-port 8002)
(Xend-relocation-address ")
(Xend-relocation-hosts-allow ")
2. Set shared storage
Take NFS as an example:
Install NFS server on server1dom0.
* NFS requires the installation of nfs-utils and Portmap (both physical machines must start this service program) services.

[Root @ XM xen] # Cat/etc/exports
# Root permission for NFS configuration read/write
/Mnt 192.168.0.0/16 (RW, no_root_squash)

Then start NFS server:
[Root @ XM xen] #/etc/init. d/nfs start
Start the NFS service: [OK]
Disable NFS quota: [OK]
Start the NFS daemon: [OK]
Start NFS mountd: [OK]

NFS of server2dom0 attached to server1dom0 is shared to the same path:
Mount-t nfs 192.168.200.199:/mnt

3. Migration Operations
Assume that the Service's guest configuration file is:
[Root @ XM xen] # Cat vmtest
Name = "vmtest"
UUID = "3b5c0632-5645-bf41-0092-49485b3c13a1 ″
Maxmem = 512
Memory = 512
Vcpus = 1
Bootloader = "/usr/bin/pygrub"
On_poweroff = "Destroy"
On_reboot = "restart"
On_crash = "restart"
Disk = ["tap: AIO:/mnt/vmtest. IMG, xvda, W"]
VIF = ["Mac = 00: 16: 3E: 7c: 23: A1, bridge = xenbr0, script = VIF-bridge"]

Running status:
[Root @ XM xen] # XM Li
Name ID mem vcpus state time (s)
Domain-0 0 512 2 R -- 82.1
Vmtest 3 512 1-B -- 4.

Migration command:
XM migrate vmtest (guest name/ID)-l 192.168.200.60 (IP address of the target physical host) # Wait for completion.

Target physical Host:
[Root @ vm60 ~] # XM Li
Name ID mem vcpus state time (s)
Domain-0 0 1508 2 R -- 1766.2
Vmtest 9 512 1-B -- 3.7

After the above operations, dynamic migration is completed.

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.