KVM live migration for non shared lvm storage

Ash asked:

I am trying to live migrate my KVM based VM from one host to another for non shared storage using virsh migrate. I have set both the hostnames at /etc/hosts on each of the host. Also I have set passwordless SSH between the hosts. Still i am not able to live migrate my VM.

Steps I followed:

  1. Created a vm on host1 with a lv
  2. Created a dummy lv on host2
  3. symlink the host2 lv with host1 vm disk
  4. executed command: virsh migrate --live --persistent --verbose --copy-storage-all --dname test_1 --desturi qemu+ssh://[email protected]/system v1007

I get error:

error: internal error: cannot precreate storage for disk type ‘block’

Can anyone help to sort this issue? Is anything that I might be missing out?
Thank you

My answer:

This sounds like a known bug in early versions of qemu.

I don’t think this bug was ever fixed in the ancient version of qemu-kvm shipped with base CentoS 7.

However, AFAIK it is fixed in the CentOS Virt SIG’s release of qemu-kvm-ev, which is much newer, and tracks the source code for the enterprise Red Hat Virtualization product. I use this on some CentOS 7 hypervisors and live migration works well.

You can update to the Virt SIG builds by simply enabling their repo and then updating your system:

yum install centos-release-qemu-ev
yum distro-sync

After this update you should reboot the computer to ensure that everything is started with the new packages.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.