Hide Forgot
Description of problem: When converting a XML guest configuration from XEN to KVM, the driver tag in the disc section lacks the "cache='none'" attribute. This leads to an error when trying to live migrate the guest on KVM. Version-Release number of selected component (if applicable): current virt-v2v on 6.3 How reproducible: Convert a XEN domain to a KVM guest Actual results: # virsh migrate --live guest01 qemu+ssh://host02/system error: Unsafe migration: Migration may lead to data corruption if disks use cache != none Expected results: live migration should work without error Additional info: Adding the attribute prevents the error from occurring, change the disk section in the xml like shown: remove: <driver name='qemu' type='raw'/> add: <driver name='qemu' type='raw' cache='none'/>
I can reproduce this issue with virt-v2v-0.8.7-6.el6.x86_64. virt-v2v convert all guests,whatever from xen or kvm,to kvm,the disk drive doesn't have cache='none'. <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/rhel6u1-64b-hv.img'/> <target dev='vda' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </disk> When do migration,it will fail. # virsh migrate --live xen-hvm-rhel6.2-x86_64 qemu+ssh://10.66.7.56/system xen-hvm-rhel6.2-x86_64 error: Unsafe migration: Migration may lead to data corruption if disks use cache != none
More test steps: 1.Xen guest xml,before conversion: <disk type='file' device='disk'> <driver name='file'/> <source file='/var/lib/xen/images/rhel6u1-64b-hv.img'/> <target dev='hda' bus='ide'/> </disk> 2.Xen guest,after conversion <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/rhel6u1-64b-hv.img'/> <target dev='vda' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </disk> 3.KVM guest,before conversion: <disk type='file' device='disk'> <driver name='qemu' type='raw' cache='none'/> <source file='/var/lib/libvirt/images/kvm-rhel/kvm-rhel6.2-i386.img'/> <target dev='hda' bus='ide'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> 4.KVM guest,after conversion: <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/kvm-rhel6.2-i386.img'/> <target dev='vda' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </disk> For xen guest,before conversion,the guest disk driver didn't have cache='none',I think it's reasonable that v2v doesn't add cache='none' to it.Added --safe when migrate the guest use virsh. For KVM guest,before conversion,the guest disk drive had cache='none',but after conversion,the guest doesn't have cache='none'. I think this should be a bug,the xml should keep the same.
isk> > > For xen guest,before conversion,the guest disk driver didn't have > cache='none',I think it's reasonable that v2v doesn't add cache='none' to > it.Added --safe when migrate the guest use virsh. Typo,it should be add --unsafe parameter,not --safe. #virsh help migrate --unsafe force migration even if it may be unsafe
This is fixed upstream in commit d907c8a260daa0be5347bccea404d8977edd830c
Tested the bug with: virt-v2v-0.8.9-2.el6.x86_64 libguestfs-1.16.32-2.el6.x86_64 libvirt-0.10.2-5.el6.x86_64 1.Prepare a xen guest. # virsh dumpxml xen-hvm-rhel6.3-x86_64 <disk type='file' device='disk'> <driver name='file'/> <source file='/var/lib/xen/images/xen-hvm-rhel6.3-x86_64.img'/> <target dev='hda' bus='ide'/> </disk> 2.Use virt-v2v to convert the guest to libvirt. # virt-v2v -ic xen+ssh://10.66.72.23 -os default -b breth0 xen-hvm-rhel6.3-x86_64xen-hvm-rhel6.3-x86_64.img: 100% [=====================================================================]D 0h02m15s virt-v2v: WARNING: The connected hypervisor does not support feature pae. virt-v2v: xen-hvm-rhel6.3-x86_64 configured with virtio drivers. 3.After conversion,check the xml file of the guest,there is cache='none' added. # virsh dumpxml xen-hvm-rhel6.3-x86_64 <disk type='file' device='disk'> <driver name='qemu' type='raw' cache='none'/> <source file='/var/lib/libvirt/images/xen-hvm-rhel6.3-x86_64.img'/> <target dev='vda' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </disk> So change the bug to VERIFIED.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-0477.html