Red Hat Bugzilla – Bug 1209802
Blockcopy for lun device changes disk type=block to file, however, it's unsupported configuration
Last modified: 2016-11-03 14:16:04 EDT
Description of problem: Blockcopy for lun device changes disk type=block to file, however, it's unsupported configuration, disk device='lun' is only valid for block type disk source. It's better provide error message when issuing blockcopy, OR specify that when doing blockcopy with lun device, must specify --blockdev in manual page Version-Release number of selected component (if applicable): libvirt-1.2.14-1.el7.x86_64 qemu-kvm-rhev-2.2.0-8.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1. Prepare a transient domain specifying block as disk type, lun as device type <disk type='block' device='lun'> <driver name='qemu' type='qcow2'/> <source dev='/dev/HostVG/vol1'/> <backingStore/> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/> </disk> 2. blockcopy and pivot # virsh blockcopy vm3 vda /tmp/vm3.copy --wait --verbose Block Copy: [100 %] Now in mirroring phase # virsh blockjob vm3 vda --pivot 3. check domain xml # virsh dumpxml vm3 | grep disk -a6 <disk type='file' device='lun'> <driver name='qemu' type='qcow2'/> <source file='/tmp/vm3.copy'/> <backingStore/> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/> </disk> 4. edit domain xml to make it persistent and destroy/start domain # virsh edit vm3 Domain vm3 XML configuration edited. # virsh destroy vm3; virsh start vm3 Domain vm3 destroyed error: Failed to start domain vm3 error: unsupported configuration: disk device='lun' is only valid for block type disk source Actual results: Expected results: It's better provide error message when issuing blockcopy, OR specify that when doing blockcopy with lun device, must specify --blockdev in manual page Additional info:
We could also be nice and automatically imply the --blockdev flag when copying a lun source (that is, you are correct that the destination of a block copy of a lun device must be another block device, and we should error out if the destination is a regular file; and this behavior is what you would get if supplying the --blockdev flag)
Fixed upstream: commit bd9d7078949ab19fd844926a20196d5533cfdf89 Author: Peter Krempa <pkrempa@redhat.com> Date: Mon May 2 15:26:51 2016 +0200 qemu: Reject invalid block copy targets for <disk device='lun'> Extract the relevant parts of the existing checker and reuse them for blockcopy since copying to a non-block device creates an invalid configuration.
Verified with libvirt-2.0.0-10.el7.x86_64 and qemu-kvm-rhev-2.6.0-26.el7.x86_64 As virtio lun does not work currently, test it using lun device + raw format + scsi bus. Libvirt provides proper error message Steps: 1. create a vm with scsi-block <disk type='block' device='lun'> <driver name='qemu' type='raw'/> <source dev='/dev/sdl'/> <target dev='sda' bus='scsi'/> </disk> 2. blockcopy to a file # virsh blockcopy vm1 sda /tmp/vm1.copy --wait --verbose error: unsupported configuration: disk device='lun' is only valid for block type disk source
According to comment#6, move it to verified status
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. https://rhn.redhat.com/errata/RHSA-2016-2577.html