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 2020993 - 'qemu-img convert' to Qcow2 Images over RBD Failed
Summary: 'qemu-img convert' to Qcow2 Images over RBD Failed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: qemu-kvm
Version: 9.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Stefano Garzarella
QA Contact: Tingting Mao
URL:
Whiteboard:
Depends On: 2044155
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-08 03:06 UTC by Tingting Mao
Modified: 2022-11-15 10:15 UTC (History)
10 users (show)

Fixed In Version: qemu-kvm-7.0.0-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-15 09:53:29 UTC
Type: ---
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-101921 0 None None None 2021-11-08 03:08:16 UTC
Red Hat Product Errata RHSA-2022:7967 0 None None None 2022-11-15 09:54:15 UTC

Description Tingting Mao 2021-11-08 03:06:45 UTC
Description of problem:
As the subject, and 'qemu-img convert' to Raw images over RBD works well.


Version-Release number of selected component (if applicable):
qemu-kvm-6.1.0-6.el9
kernel-5.14.0-11.el9.x86_64


How reproducible:
100%


Steps to Reproduce:
1. Configure the RBD server info in the client end.
# cat > /etc/ceph/ceph.conf<<EOF
[global]
	cluster = testcluster
	fsid = d5ce4d4d-6a72-40e8-b59e-57a5b075a50a
 
	mon initial members = ibm-x3650m4-06
	mon host = ${rbd_server_ip}
 
	public network = 10.73.114.0/24
	cluster network = 10.73.114.0/24
 
	auth cluster required = cephx
	auth service required = cephx
	auth client required = cephx
	osd journal size = 1024
	osd pool default size = 1
	osd pool default min size = 1
	osd pool default pg num = 33
	osd pool default pgp num = 33
	osd crush chooseleaf type = 1
EOF

# cat > /etc/ceph/ceph.client.admin.keyring<<EOF
[client.admin]
    key = ${key}
    caps mds = "allow *"
    caps mgr = "allow *"
    caps mon = "allow *"
    caps osd = "allow *"
EOF

2. Prepare a source image to convert.
# qemu-img create -f raw test.img 5g
# qemu-io -f raw -c 'write -P 1 0 1.9G' test.img
# qemu-img info test.img 
image: test.img
file format: raw
virtual size: 5 GiB (5368709120 bytes)
disk size: 1.9 GiB

3. Convert the source image to a qcow2 image over RBD
# qemu-img convert -f raw -O qcow2 test.img rbd:rbd/image_convert_remote.qcow2 -p
qemu-img: rbd request failed: cmd 4 offset 2038956032 bytes 1703936 flags 256 task.ret -22 (Invalid argument)
qemu-img: error while writing at byte 2038431744: Invalid argument


Actual results:
As above, converting failed.


Expected results:
Converting successes with no error.


Additional info:
Converting the source raw image to a raw image over RBD works fine.
# qemu-img convert -f raw -O raw test.img rbd:rbd/image_convert_remote.img -p
    (100.00/100%)

Comment 2 Tingting Mao 2021-12-21 07:31:03 UTC
Still hit the issue in qemu-kvm-6.2.0-1.el9. And change the priority to Medium.

Comment 3 Stefano Garzarella 2022-03-15 14:23:25 UTC
This issue seems similar to what we fixed here: https://gitlab.com/qemu-project/qemu/-/commit/d24f80234b39d2d5c0d91e63b5e4569d37b2399e

Since QEMU 6.1 supports write_zeroes, I think we have the same problem: rbd doesn't support write beyond the current file size.

So we should do the same workaround and resize the file before requesting a write_zeroes that exceeds its current size.

Comment 8 Stefano Garzarella 2022-03-17 16:43:07 UTC
Fix posted upstream: https://lore.kernel.org/qemu-devel/20220317162638.41192-1-sgarzare@redhat.com/T/#u

Comment 9 Stefano Garzarella 2022-03-25 10:36:38 UTC
Fix merged upstream and released with QEMU v7.0.0-rc1

https://gitlab.com/qemu-project/qemu/-/commit/cc5387a544325c26dcf124ac7d3999389c24e5c6

Comment 11 Yanan Fu 2022-04-25 12:37:41 UTC
QE bot(pre verify): Set 'Verified:Tested,SanityOnly' as gating/tier1 test pass.

Comment 14 Tingting Mao 2022-04-27 03:14:53 UTC
Verified this bug as below.


Tested with:
qemu-kvm-7.0.0-1.el9
kernel-5.14.0-80.el9.x86_64


Steps:
1. Create a source local image.
# qemu-img create -f raw test.img 5g
# qemu-io -f raw -c 'write -P 1 0 1.9G' test.img

2. Convert the local image to a qcow2 image over RBD.
# qemu-img convert -f raw -O qcow2 test.img rbd:rbd/image_convert_remote.qcow2 -p
    (100.00/100%)


Results:
As above, converting successfully.

Comment 16 errata-xmlrpc 2022-11-15 09:53:29 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 (Moderate: qemu-kvm security, bug fix, and enhancement update), 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://access.redhat.com/errata/RHSA-2022:7967


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