010. Cold migration of KVM VM

Source: Internet
Author: User
I. Lab Environment
  • Original VM name: vm01-centos6.8
  • Original VM host machine: kvm-host-2
  • Post-migration VM name: vm01-cloud-centos6.8
  • Host where the VM is located after migration: kvm-host-2
2. Preparations for migration process 2.1
1 [[email protected] ~] # Virsh shutdown vm01-centos6.8 # Shut down the VM to be migrated 2 [[email protected] ~] # Virsh list -- all # view VM status
 
1 [[email protected] ~] # Virsh dow.klist vm01-centos6.8 # view VM Disk
2.2 migration host environment configuration the migrated host kvm-host-2 VM environment must be available, specific environment deployment refer to 002. KVM environment deployment. 2.3 export the configuration file
  1 [[email protected] ~]# virsh dumpxml vm01-centos6.8 > /tmp/vm01-cloud-centos6.8.xml
2.4 copy the configuration to the target machine
  1 [[email protected] ~]# scp /tmp/vm01-cloud-centos6.8.xml [email protected]:/etc/libvirt/qemu
2.5 copy the disk to the target machine
  1 [[email protected] ~]# scp /data/images/vm01-centos6.8.img [email protected]:/data/images/vm01-cloud-centos6.8.img
2.6 target host Adjustment
1 [[email protected] ~] # Virsh list -- all # view the VM list
1 [[email protected] ~] # Vi/etc/libvirt/qemu/vm01-cloud-centos6.8.xml 2 ...... 3 <Name> vm01-cloud-centos6.8 </Name> 4 <UUID> 5130c447-8f43-4f84-bc90-4f51db2023f8 </UUID> # modify UUID 5 ...... 6 <disk type = 'file' device = 'disk'> 7 <driver name = 'qemu' type = 'qcow2 '/> 8 <source file ='/data/images/ vm01-cloud-centos6.8.img '/> # modify the corresponding disk path and name 9 <target Dev = 'vda' bus = 'virtio'/> 10 <address type = 'pci 'domain = '0x0000' bus = '0x00' slot = '0x04 'function = '0x0'/> 11 </disk> 12 ...... 13 <MAC address = '52: 54: 00: 16: D3: 96 '/> # modify the corresponding MAC address
  Suggestion: Modify the preceding parameters to be different from the original values to prevent conflicts.2.7 register a VM
  1 [[email protected] ~]# virsh define /etc/libvirt/qemu/vm01-cloud-centos6.8.xml
2.8 view Verification
  1 [[email protected] ~]# virsh list --all
3. Start and adjust
  1 [[email protected] ~]# virsh list --all
Change the MAC/IP address in the nic and the MAC address in/etc/udev/rules. d/70-persistent-net.rules to the xml configuration file and restart it.

010. Cold migration of KVM VM

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.