Description of problem: pre-migration hook just cat guest xml file on destination will get error Version-Release number of selected component (if applicable): libvirt-0.9.10-20.el6.x86_64 qemu-kvm-rhev-0.12.1.2-2.292.el6.x86_64 kernel-2.6.32-272.el6.x86_64 How reproducible: 100% Steps to Reproduce: 1. Prepare a nfs server write /etc/exports with /var/lib/libvirt/images *(rw,no_root_squash,async) Then start nfs service # service nfs start Stop iptables # iptables -F 2. Prepare 2 different hosts(my machines are DELL OPTIPLEX 760 and DELL OPTIPLEX 755) and mount nfs dir on both hosts in the same dir, and setting the virt_use_nfs boolean on both sides on host1 # mount $NFS_IP:/var/lib/libvirt/images /mnt/7191nfs -o vers=3 on host2 # mount $NFS_IP:/var/lib/libvirt/images /mnt/7191nfs -o vers=3 # setsebool -P virt_use_nfs 1 and close the iptable on both sides # iptables -F 3. Start guest: # virsh start mig 4. Add hooks in both hosts: source: # cat /etc/libvirt/hooks/qemu #!/bin/bash echo "$0" "$@" >> /tmp/qemu.log exit 0 target: # cat /etc/libvirt/hooks/qemu #!/bin/bash echo "$0" "$@" >> /tmp/qemu.log exit 0 And add execute permission for this file on both sides # chmod +x /etc/libvirt/hooks/qemu Restart libvirtd service on both sides # service libvirtd restart 5. Do migration: # virsh migrate --live mig qemu+ssh://10.66.5.143/system --verbose Succeed without error as expected. 6. But just modified the /etc/libvirt/hooks/qemu file in target host to : # cat /etc/libvirt/hooks/qemu #!/bin/bash echo "$0" "$@" >> /tmp/qemu.log cat /mnt/719nfs/mig.xml exit 0 and dumpxml source guest xml to /mnt/7191nfs/ dir # virsh dumpxml mig > /mnt/7191nfs/mig.xml Restart libvirtd service on both sides # service libvirtd restart Do migration: # virsh migrate --live mig qemu+ssh://10.66.5.143/system --verbose error: unsupported configuration: Target device address type pci does not match source none Actual results: As steps. And target machine's libvirtd get log: # cat /var/log/libvirt/libvirtd.log 2012-05-18 13:47:26.861+0000: 7918: error : virDomainDeviceInfoCheckABIStability:9236 : unsupported configuration: Target device address type pci does not match source none Expected results: Migration succeed without error. Additional info: Two same machines will not get error.
This is most likely not a bug. The pre-migration hook is wrong, the XML you get with virsh dumpxml may be different from the XML used for migration. Within the hook script, you need to use the XML passed to stdin of the script. Anyway, if you attach the XML the script got on its stdin and the XML you got with virsh dumpxml, I can check that the failure is correct.
Hi Jiri, Sorry to tell you that I can not reproduce the bug because I have updated my hosts' OS. And mounting the nfs server to two different dir is alse working well now. I will attach my xml file, and I used the same file in the hooks' configuration, and it works well now. So I will close it as workforme, and I will reopen it if I reproduce it again in the future, how do you think ?
Created attachment 586307 [details] the xml file
I retest this issue with: libvirt-client-0.9.10-21.el6.x86_64 libvirt-python-0.9.10-21.el6.x86_64 libvirt-0.9.10-21.el6.x86_64 qemu-img-rhev-0.12.1.2-2.294.el6.x86_64 qemu-kvm-rhev-tools-0.12.1.2-2.294.el6.x86_64 qemu-kvm-rhev-0.12.1.2-2.294.el6.x86_64 I tested 2 ways, 1, source and target mount the pool to the same location. 2, source and target mount the pool to different location 1,source: mount -o vers=3 10.66.6.209:/virt /var/lib/libvirt/images/ target: mount -o vers=3 10.66.6.209:/virt /var/lib/libvirt/images/ source hook: #!/bin/bash echo "$0" "$@" >> /tmp/qemu.log exit 0 target hook: #!/bin/bash echo "$0" "$@" >> /tmp/qemu.log cat /var/lib/libvirt/images/mig.xml exit 0 virsh # migrate aaa --live qemu+ssh://10.66.7.230/system error: unsupported configuration: Target controller type usb does not match source virtio-serial # tail /var/log/libvirt/libvirtd.log ... 2012-05-29 06:17:59.451+0000: 3027: error : virDomainControllerDefCheckABIStability:9365 : unsupported configuration: Target controller type usb does not match source virtio-serial 2,source: mount -o vers=3 10.66.6.209:/virt /var/lib/libvirt/images/ target: mount -o vers=3 10.66.6.209:/virt /mnt source hook: #!/bin/bash echo "$0" "$@" >> /tmp/qemu.log exit 0 target hook: #!/bin/bash echo "$0" "$@" >> /tmp/qemu.log cat /mnt/mig.xml exit 0 virsh # migrate aaa --live qemu+ssh://10.66.7.230/system error: unsupported configuration: Target controller type usb does not match source virtio-serial # tail /var/log/libvirt/libvirtd.log ... 2012-05-29 06:21:29.659+0000: 3303: error : virDomainControllerDefCheckABIStability:9365 : unsupported configuration: Target controller type usb does not match source virtio-serial next 2 comments are case 1 and 2 guest xml.
Created attachment 587317 [details] case 1 guest xml
Created attachment 587318 [details] case 2 guest xml
According comment 5 - 7, change the status to ASSIGNED
Can you modify the hook so that it looks like the following: #!/bin/bash echo "$0" "$@" >> /tmp/qemu.log if [ "$2" = "migrate" ]; then cat >/tmp/migrated.xml cat /mnt/mig.xml fi exit 0 and attach /tmp/migrated.xml? I expect /mnt/mig.xml would be the same as the "case 2 guest xml" attachment. If it differs, please attach it as well.
Created attachment 588244 [details] case 1 guest xml new
Created attachment 588245 [details] case 1 migrated xml
Created attachment 588246 [details] case 2 guest xml new
Created attachment 588247 [details] case 2 migrated xml
They are different. case 1 xmls are mig-1.xml and migrated-1.xml, case 2 are -2. Pls check the last 4 attachments
Thanks. BTW, the above script may serve as a test for our XML compatibility checker but it's not the right way of doing this... The correct way is to filter the XML send to stdin of the hook script. In other words to change location of the disk image from /var/lib/libvirt/images to /mnt, one would use the following script: #!/bin/bash echo "$0" "$@" >> /tmp/qemu.log if [ "$2" = "migrate" ]; then sed -e 's,/var/lib/libvirt/images,/mnt,' fi exit 0 Anyway, the bad script revealed that our XML compatibility checker is a bit too strict. One of the XMLs has <controller type='usb' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> <controller type='virtio-serial' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </controller> while the other one has <controller type='virtio-serial' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </controller> <controller type='usb' index='0'/> which is perfectly compatible. However, this is a low priority bug since using the correct script, one would never hit this issue.
Given the bug's age and how minor it is, just closing as DEFERRED.