KVM Clone Virtual Machine

Source: Internet
Author: User

Two steps: First step export xml:[[email protected] ~]# virsh dumpxml centos02 >12c.xml Second Step disk file [[email protected] virhost]# CP Centos02.img 12c.img Look at the differences between the two files: [[email protected] ~]# diff/etc/libvirt/qemu/centos02.xml ~/12c.xml 1,10c1,3< <!--< Warning:this is an auto-generated FILE. Changes to IT is likely to be < overwritten and LOST. Changes to this XML configuration should is made using:< Virsh edit centos02< or other application using the LIBVI RT api.<-->< < <domain type= ' KVM ' >< <name>centos02</name>< <uuid>e6852c4a- c0a8-cbcc-d556-768e93d4167c</uuid>---> <domain type= ' KVM ' id= ' 2 ' >> <name>12c</name> > <uuid>e6852c4a-c0a8-cbcc-d556-768e93d4168c</uuid>31c24< <source file= '/home/virhost/centos 02.img '/>---> <source file= '/home/virhost/12c.img '/>32a26> <alias name= ' Virtio-disk0 '/>38 a33> <alias name= ' ide0-1-0 '/>41a37>       <alias name= ' usb0 '/>44a41> <alias name= ' usb0 '/>48a46> <alias name= ' usb0 '/>52a51 > <alias name= ' usb0 '/>56a56> <alias name= ' ide0 '/>60c60< <mac address= ' 52:54:00:1       9:77:7c '/>---> <mac address= ' 52:54:00:19:77:8c '/>61a62,63> <target dev= ' Vnet1 '/>> <alias name= ' net0 '/>64a67> <source path= '/dev/pts/2 '/>65a69> <alias name= ' serial0 '/> 67c71,72< <console type= ' pty ' >---> <console type= ' pty ' tty= '/DEV/PTS/2 ' >> <source pa Th= '/DEV/PTS/2 '/>68a74> <alias name= ' serial0 '/>71c77< <graphics type= ' vnc ' port= ' 6002 ' Autopor       t= ' no ' listen= ' 0.0.0.0 ' >---> <graphics type= ' vnc ' port= ' 6012 ' autoport= ' no ' listen= ' 0.0.0.0 ' >75a82> <alias name= ' video0 '/>78a86> <alias name= ' balloon0 '/>81a90,93> <seclabel type= ' dynamic ' mo Del= ' SELinux ' relabel= ' YEs ' >> <label>system_u:system_r:svirt_t:s0:c355,c689</label>> <imagelabel>system_u:o  Bject_r:svirt_image_t:s0:c355,c689</imagelabel>> </seclabel>82a95>

[[email protected] ~]# Virsh define 12c.xml Domain 12c defined from 12c.xml[email protected] ~]# Virsh start 12cDomain 12c Started[[email protected] ~]# virsh list Id    Name State                           ----------------------------------------------------1     Win7                           running 2     centos02                       running 3     12c                            running

You can remove the Mac uuid from the/etc/sysconfig/network-script/ifcfg-eth0.

#pwd #/etc/udev/rules.d#rm-  f 70-persistent-net.rules and then reboot [[email protected] virhost]# Virsh list Id    Name State                           ----------------------------------------------------1     win7                           running 2     centos02                       Running 3     12c                            running

KVM Clone Virtual machine

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.