KVM Virtual Machine Migration

Source: Internet
Author: User

KVM Virtual Machine Migration

Description: The test is used from local to local, remote method similar, SCP copy configuration file and virtual disk, if more than one disk, have to copy, remote copy does not need to modify the configuration file, unless there is the same virtual machine, this example is local, so you must modify the configuration file, otherwise the name, UUID, directory and other conflicts


1. Close the daixuan2 virtual machine

[Email protected] ~]# Virsh shutdown daixuan2

Domain daixuan2 is closed


2. Copy the configuration file

[Email protected] ~]# Virsh dumpxml daixuan2 >/etc/libvirt/qemu/daixuan9.xml

[Email protected] ~]# Virsh domblklist daixuan2

Target Source

------------------------------------------------

Vda/data/daixuan2.qcow2


3, copy the virtual disk file, if it is two disks, you have to copy, the configuration file two disk daixuan1 are modified Daixuan9

[Email protected] ~]# Rsync-avp/data/daixuan2.qcow2/data/daixuan9.qcow2

Sending incremental file list

Daixuan2.qcow2

10829037568 100% 72.72mb/s 0:02:22 (xfer#1, TO-CHECK=0/1)


Sent 10830359552 bytes received bytes 76002523.39 bytes/sec

Total size was 10829037568 speedup is 1.00



4. Modify the configuration file

[Email protected] ~]# Vi/etc/libvirt/qemu/daixuan8.xml

<name>daixuan2</name>

<UUID>82C8EDA7-C875-18BB-34E3-3478C038CD</uuid>

<source file= '/data/daixuan2. Qcow2 '/>


<name>daixuan9</name>

<uuid>82c8eda7-c875-18bb-34e3-3478c038bc38</uuid>

<source file= '/data/daixuan9. Qcow2 '/>


5. Define DAIXUAN9 Domain

[Email protected] ~]# Virsh define/etc/libvirt/qemu/daixuan9.xml

Define domain Daixuan9 (from/etc/libvirt/qemu/daixuan9.xml)

[Email protected] ~]# Virsh list--all

Id Name Status

----------------------------------------------------

Daixuan4 Running

-Daixuan1 off

-Daixuan2 off

-Daixuan3 off

-Daixuan5 off

-Daixuan9 off


6. Login to Daixuan9 virtual machine

[Email protected] ~]# Virsh start daixuan9--console



This article is from the "Daixuan" blog, make sure to keep this source http://daixuan.blog.51cto.com/5426657/1743492

KVM Virtual Machine Migration

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.