I. Implementation notes
Company many services are soaked in Microsoft's Hpyerv virtual machine, it is to gradually migrate to the KVM, many domestic sites are for the migration of VMware, it is difficult to find the migration for Hyperv, in fact, the steps are almost simple, the following is the operation of the steps.
Note: If you have a snapshot, note that to merge the original virtual machine snapshot into a single VHD file, there might be a better way to keep the snapshot, but I haven't studied it yet.
Ii. Steps of implementation
In order to better explain, run Hyperv the source machine called H, run the KVM target machine called K
1. The static IP of the Hyperv virtual machine that will be migrated on H is changed to automatic acquisition, then shut down, and the VHD hard drive is copied to the target machine K via SCP or otherwise. "If you have a snapshot, you need to merge the snapshot, and then there is only one VHD hard file on the left." 】
2. Get Windows Driver for Virtio "This driver is used primarily for Windows NICs and hard drives"
Cd/var/lib/libvirt/imagewget Https://alt.fedoraproject.org/pub/alt/virtiowin/latest/images/bin/virtio-win-0.1-81.iso
3. Image format conversion on target machine K and create a new disk file "This disk file is used primarily for Windows to install a new Virtio driver by identifying the new hard drive, otherwise the built-in IDE driver is not able to install the new driver."
Qemu-img convert-o qcow2/root/hyperv.vhd/mnt/storage/kvm.qcow2# Convert VHD format to QCOW2 format qemu-img create/mnt/storage/ Disk.img 1g# to create a new disk
4. Use Virt-manager or Virt-install to mirror the import and put the drive image in CDROM recommended Virt-install
Virt-install--name Server--ram--os-type=windows--vcpus 1--disk path=/mnt/storage/kvm.qcow2,device=disk,bus=ide , Format=qcow2--disk path=/mnt/storage/disk.img,format=qcow2,bus=virtio--disk path=/var/lib/libvirt/image/ Virt-win-0.1-81.iso,device=cdrom--network bridge=br0,model=virtio--graphics vnc--noautoconsole--import--noreboot --debug
5. Start the virtual machine into Windows, install the network card through the mirror in the CDROM and the hard drive "the person who installed the Windows driver should be", and then shut down the virtual machine.
6. By Virt-manager or modifying the/etc/libvirt/qemu/server.xml file of the KVM virtual machine, the new disk is deleted, and the original drive bus mode is changed to Virtio,xml mode as follows:
<disk type= ' block ' device= ' disk ' ><driver name= ' server ' type= ' qcow '/><source dev= '/mnt/storage/ Kvm.qcow2 '/><target dev= ' VDA ' bus= ' virtio '/><address type= ' PCI ' domain= ' 0x0000 ' bus= ' 0x00 ' slot= ' 0x04 ' function= ' 0x0 '/></disk>
"It's more convenient to pass the Virt-manager."
7. Start the virtual machine for IP configuration, verify IP connectivity, and complete the migration.
Hyperv of Linux virtualization applications to KVM migration