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 1873925 - rbd image cannot be listed when it is create by qemu-img with a non-exsit rbd namespace
Summary: rbd image cannot be listed when it is create by qemu-img with a non-exsit rbd...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: qemu-kvm
Version: 9.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Stefano Garzarella
QA Contact: Tingting Mao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-31 03:46 UTC by Han Han
Modified: 2022-05-17 02:49 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-17 02:49:41 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Han Han 2020-08-31 03:46:38 UTC
Description of problem:
As subject

Version-Release number of selected component (if applicable):
qemu-img-5.1.0-4.module+el8.3.0+7846+ae9b566f.x86_64
librbd1-12.2.7-9.el8.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Create the image with path rbd/aa/new3(aa is a non-exist namespace):
➜  ~ qemu-img create 'rbd:rbd/aa/new3:conf=/root/.ceph/ceph.conf:id=admin:key=XXXX' 1M
Formatting 'rbd:rbd/aa/new3:conf=/root/.ceph/ceph.conf:id=admin:key=XXXX', fmt=raw size=1048576
➜  ~ qemu-img create 'rbd:rbd/aa/new3:conf=/root/.ceph/ceph.conf:id=admin:key=XXXX' 1M
Formatting 'rbd:rbd/aa/new3:conf=/root/.ceph/ceph.conf:id=admin:key=XXXX', fmt=raw size=1048576
qemu-img: rbd:rbd/aa/new3:conf=/root/.ceph/ceph.conf:id=admin:key=XXXX: error rbd create: File exist

Check if new3 in aa or default rbd namespace
➜ rbd -c ~/.ceph/ceph.conf -k ~/.ceph/ceph.client.admin.keyring -p rbd namespace ls
NAME 
hhan 
test 

➜  ~ rbd -c ~/.ceph/ceph.conf -k ~/.ceph/ceph.client.admin.keyring -p rbd ls|grep new3

The image is neither in aa or default rbd namespace. However it can be listed by   qemu-img:
➜  ~ qemu-img info 'rbd:rbd/aa/new3:conf=/root/.ceph/ceph.conf:id=admin:key=XXXX'   
image: json:{"driver": "raw", "file": {"pool": "rbd", "image": "new3", "conf": "/root/.ceph/ceph.conf", "driver": "rbd", "user": "admin"}}
file format: raw
virtual size: 1 MiB (1048576 bytes)
disk size: unavailable
cluster_size: 4194304


Actual results:
As above

Expected results:
Referring to the info provide by Jason Dillaman in https://www.redhat.com/archives/libvir-list/2020-August/msg00904.html , qemu should refuse to create a image for a non-exsit namespace.

Additional info:

Comment 2 John Ferlan 2021-09-08 22:01:06 UTC
Bulk update: Move RHEL-AV bugs to RHEL9. If necessary to resolve in RHEL8, then clone to the current RHEL8 release.

Comment 4 RHEL Program Management 2022-03-03 07:27:20 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 5 Tingting Mao 2022-03-04 03:14:09 UTC
Reopen the issue for still hitting the issue. 

And one thing I want to highlight is that I can not delete the image from server side for I can not find the image.

Comment 7 Stefano Garzarella 2022-05-13 15:42:27 UTC
@timao I'm not able to replicate on CentOS Stream 8 and 9.

In both cases, I have the following behavior (note: 'aa' namespace not exists)

$ qemu-img create rbd:rbd/aa/new3 1M
Formatting 'rbd:rbd/aa/new3', fmt=raw size=1048576
qemu-img: rbd:rbd/aa/new3: error rbd create: No such file or directory


c8s packages:
qemu-img-15:6.2.0-12.module_el8.7.0+1140+ff0772f9.x86_64
librbd1-2:14.2.22-2.el8s.x86_64

c9s packages:
qemu-img-17:7.0.0-1.el9.x86_64
librbd1-2:16.2.7-1.el9s.x86_64


Are you able to replicate with the latest RHEL versions?

Comment 9 Tingting Mao 2022-05-16 02:13:21 UTC
Yes, in latest qemu, there is no the issue. 
But the error info is 'No such file or directory', maybe we could give it a more clear error hint info like "No a namespace named 'aa'"?



In rhel8.7 tested with:
qemu-kvm-6.2.0-13.module+el8.7.0+15131+941fbd8d
librbd1-14.2.11-208.el8cp.x86_64

Steps:
# qemu-img create 'rbd:rbd/aa/new3:conf=/etc/ceph/ceph.conf:id=admin:key=AQBwUmlfB9VwKhAA0HwqNhKCfarcItKtCR9ulg==' 1M
Formatting 'rbd:rbd/aa/new3:conf=/etc/ceph/ceph.conf:id=admin:key=AQBwUmlfB9VwKhAA0HwqNhKCfarcItKtCR9ulg==', fmt=raw size=1048576
qemu-img: rbd:rbd/aa/new3:conf=/etc/ceph/ceph.conf:id=admin:key=AQBwUmlfB9VwKhAA0HwqNhKCfarcItKtCR9ulg==: error rbd create: No such file or directory

Results:
As above, created failed with ' No such file or directory'.



In latest rhel9.1 tested with:
qemu-kvm-7.0.0-3.el9
librbd1-16.2.4-5.el9.x86_64

Steps:
# qemu-img create 'rbd:rbd/aa/new3:conf=/etc/ceph/ceph.conf:id=admin:key=AQBwUmlfB9VwKhAA0HwqNhKCfarcItKtCR9ulg==' 1M
Formatting 'rbd:rbd/aa/new3:conf=/etc/ceph/ceph.conf:id=admin:key=AQBwUmlfB9VwKhAA0HwqNhKCfarcItKtCR9ulg==', fmt=raw size=1048576
qemu-img: rbd:rbd/aa/new3:conf=/etc/ceph/ceph.conf:id=admin:key=AQBwUmlfB9VwKhAA0HwqNhKCfarcItKtCR9ulg==: error rbd create: No such file or directory

# qemu-img create rbd:rbd/aa/testtt.img 1G
Formatting 'rbd:rbd/aa/testtt.img', fmt=raw size=1073741824
qemu-img: rbd:rbd/aa/testtt.img: error rbd create: No such file or directory

Results:
As above, created failed with ' No such file or directory'.

Comment 10 Stefano Garzarella 2022-05-16 10:10:32 UTC
(In reply to Tingting Mao from comment #9)
> Yes, in latest qemu, there is no the issue. 

Thanks for checking!
Do you think it would be better to close this BZ and open another one for the error message?

QEMU simply reports the error returned by rbd_create() (-ENOENT), so it makes me think that this problem was in librbd and not in QEMU.

> But the error info is 'No such file or directory', maybe we could give it a
> more clear error hint info like "No a namespace named 'aa'"?

Yep, maybe that would be better. 
I just posted an upstream patch here: https://lore.kernel.org/qemu-devel/20220516100324.61122-1-sgarzare@redhat.com/T/#u


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