RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1209802 - Blockcopy for lun device changes disk type=block to file, however, it's unsupported configuration
Summary: Blockcopy for lun device changes disk type=block to file, however, it's unsup...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.2
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-08 09:00 UTC by Yang Yang
Modified: 2016-11-03 18:16 UTC (History)
5 users (show)

Fixed In Version: libvirt-1.3.5-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 18:16:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 12:07:06 UTC

Description Yang Yang 2015-04-08 09:00:37 UTC
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 14:32:05 UTC
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 11:36:00 UTC
Fixed upstream:

commit bd9d7078949ab19fd844926a20196d5533cfdf89
Author: Peter Krempa <pkrempa>
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 Yang Yang 2016-09-22 10:01:09 UTC
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 Yang Yang 2016-09-23 03:25:11 UTC
According to comment#6, move it to verified status

Comment 9 errata-xmlrpc 2016-11-03 18:16:04 UTC
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.