Bug 1745885 - 'qemu-img create' an overlay over RBD should look up the directory containing the overlay to find it's backing file
Summary: 'qemu-img create' an overlay over RBD should look up the directory containin...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: qemu-kvm
Version: 8.1
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: rc
: ---
Assignee: Virtualization Maintenance
QA Contact: zixchen
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-27 07:05 UTC by Tingting Mao
Modified: 2021-03-08 01:16 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-03-04 09:42:35 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Tingting Mao 2019-08-27 07:05:27 UTC
Description of problem:
From https://qemu.weilnetz.de/doc/qemu-doc.html#qemu_005fimg_005finvocation, we get info "If a relative path name is given, the backing file is looked up relative to the directory containing output_filename.". However, while practising this over RBD, it does not work now. 

Version-Release number of selected component (if applicable):
qemu-kvm-4.1.0-4.module+el8.1.0+4020+16089f93
kernel-4.18.0-135.el8


How reproducible:
100%


Steps to Reproduce:
1. Create a base image locally
# qemu-img create -f qcow2 base.qcow2 2G

2. Create overlay over RBD based on base.qcow2
# qemu-img create -f qcow2 -b base.qcow2 rbd:kvmtest-pool/sn.qcow2

# qemu-img info rbd:kvmtest-pool/sn.qcow2
image: json:{"driver": "qcow2", "file": {"pool": "kvmtest-pool", "image": "sn.qcow2", "driver": "rbd"}}
file format: qcow2
virtual size: 20 GiB (21474836480 bytes)
disk size: unavailable
cluster_size: 65536
backing file: base.qcow2 (cannot determine actual path)
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false


Actual results:
As above, created with no error.


Expected results:
Create image fails, and give info like below:

qemu-img: rbd:kvmtest-pool/sn.qcow2: Could not open 'rbd:kvmtest-pool/base.qcow2': No such file or directory


Additional info:
Doing more tests(Check/rebase) will failed.
# qemu-img check rbd:kvmtest-pool/sn.qcow2
qemu-img: Could not open 'rbd:kvmtest-pool/sn.qcow2': Cannot generate a base directory for rbd nodes

# qemu-img rebase -b /home/test/ceph_qcow2/new_base.qcow2 rbd:kvmtest-pool/sn.qcow2 -p
qemu-img: Could not open 'rbd:kvmtest-pool/sn.qcow2': Cannot generate a base directory for rbd nodes

Comment 1 Tingting Mao 2019-08-27 07:42:54 UTC
For 'qemu-img rebase', will hit below error.

Steps:
1. Create a qcow2 image over rbd
# qemu-img create -f qcow2 rbd:kvmtest-pool/tttt.qcow2 2G

2. Create a base.qcow2 locally
# qemu-img create -f qcow2 new_base.qcow2 2G

3. Rebase 
# qemu-img rebase -b new_base.qcow2 -f qcow2 rbd:kvmtest-pool/tttt.qcow2 -p
qemu-img: Could not resolve backing filename: Cannot use relative backing file names for 'json:{"driver": "qcow2", "file": {"pool": "kvmtest-pool", "image": "tttt.qcow2", "driver": "rbd"}}'

Comment 3 Ademar Reis 2020-02-05 23:04:02 UTC
QEMU has been recently split into sub-components and as a one-time operation to avoid breakage of tools, we are setting the QEMU sub-component of this BZ to "General". Please review and change the sub-component if necessary the next time you review this BZ. Thanks

Comment 7 Stefano Garzarella 2021-03-04 09:42:35 UTC
As discussed upstream [1], QCOW2 on RBD is not really well supported and it is expected to be removed.
This is also because there doesn't seem to be much advantage to using QCOW2 on RBD.

If there is a specific use case where it is useful to use QCOW2 on RBD, please open a new BZ where the requirements are explained.

AFAIK layered products, such as OpenStack, do not use QCOW2 with in-QEMU RBD.

[1] https://lists.gnu.org/archive/html/qemu-devel/2021-03/msg01045.html

Comment 8 zixchen 2021-03-08 01:16:35 UTC
As qcow2 on rbd is not really well supported and it is expected to be removed. QA agrees to close this bug.


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