I recently built two servers that I plan on using for a sandbox with various technologies (Infiniband, ZFS, RDMA, GlusterFS, Btrfs, Ceph, LXC, KVM, etc, etc, etc). So, getting everything installed and running, I ran into a rather interesting bug. I installed KVM and libvirt, and started rolling out some virtual machines. I wanted to test live migration using a GlusterFS+ZFS shared storage, however, I was met with the following warning:
(kvm1) # virsh migrate --live --unsafe --verbose www-dev qemu+ssh://firstname.lastname@example.org/system email@example.com's password: error: internal error Attempt to migrate guest to the same host 00020003-0004-0005-0006-000700080009
Curious, I checked out the board system UUID through DMI on both servers, and sure enough, they had the same UUID!:
(kvm1) # dmidecode -s system-uuid 00020003-0004-0005-0006-000700080009 (kvm2) # dmidecode -s system-uuid 00020003-0004-0005-0006-000700080009
Apparently, this is a known issue with Tyan motherboards. I have the Tyan Thunder n3600b (S2927-E). Digging through the BIOS, there is no option to change it. Short of flashing the BIOS, which may or may not support assigning new UUIDs, or replacing the chip, I didn't know what to do. So, I started digging deeper, and I found that libvirt actually supports changing what UUID is reported (even though it's not actually changed in tho BIOS). This can be done by editing the /etc/libvirt/libvirtd.conf file (notice it is the libvirtd.conf, and not the libvirt.conf file). So, you just need to generate a random UUID, and edit the config:
(kvm1) # cat /proc/sys/kernel/random/uuid c0118352-aceb-4632-b0fa-014264e85fe0 (kvm2) # cat /proc/sys/kernel/random/uuid 2bce9972-dd6a-4318-a2b0-9f93706decdc
The line you need to modify is the "host_uuid" line. Something like this:
host_uuid = "c0118352-aceb-4632-b0fa-014264e85fe0"
host_uuid = "2bce9972-dd6a-4318-a2b0-9f93706decdc"
At this point, restart the libvirt-bin service, and you should be good to go:
# /etc/init.d/libvirt-bin restart Restarting libvirt management daemon: /usr/sbin/libvirtd. # virsh capabilities | grep uuid c0118352-aceb-4632-b0fa-014264e85fe0
I can now successfully migrate my virtual machines with no error. However, it's unfortunate that motherboard vendors are not properly generating unique UUIDs for their boards, especially ones marked as "server" motherboards.