Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1209802 - Blockcopy for lun device changes disk type=block to file, however, it's unsupported configuration
Blockcopy for lun device changes disk type=block to file, however, it's unsup...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.2
x86_64 Linux
unspecified Severity unspecified
: rc
: ---
Assigned To: Peter Krempa
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-04-08 05:00 EDT by yangyang
Modified: 2016-11-03 14:16 EDT (History)
5 users (show)

See Also:
Fixed In Version: libvirt-1.3.5-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-03 14:16:04 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 08:07:06 EDT

  None (edit)
Description yangyang 2015-04-08 05:00:37 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:
Comment 2 Eric Blake 2015-04-08 10:32:05 EDT
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)
Comment 4 Peter Krempa 2016-05-09 07:36:00 EDT
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.
Comment 6 yangyang 2016-09-22 06:01:09 EDT
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
Comment 7 yangyang 2016-09-22 23:25:11 EDT
According to comment#6, move it to verified status
Comment 9 errata-xmlrpc 2016-11-03 14:16:04 EDT
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

Note You need to log in before you can comment on or make changes to this bug.