Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
Use one local bootable disk image as backing_file, and then create one snapshot with iSCSI backend will fail.
Version-Release number of selected component (if applicable):
Host:
kernel: 3.10.0-663.el7.ppc64le
qemu-kvm-rhev-2.9.0-3.el7.ppc64le
SLOF-20170303-3.git66d250e.el7.noarch
Guest:
3.10.0-663.el7.ppc64le
How reproducible:
100%
Steps to Reproduce:
1. Create one disk image on local filesystem
# qemu-img create -f qcow2 rhel.qcow2 20G
2. Install guest
-drive file=rhel.qcow2,if=none,id=drive-data-disk1,format=qcow2,cache=none,aio=native,serial=sluo-disk1 \
-device scsi-hd,drive=drive-data-disk1,bus=virtio.0,bootindex=0 \
3. Boot up the guest and it works well, then shutdown it
4. Use the above disk image as backing_file, create one snapshot with iSCSI backend
# qemu-img create -f qcow2 -F qcow2 -b rhel.qcow2 iscsi://10.16.67.19:3260/iqn.2015-05.com.example:t1/0
Actual results:
Step4 fails, that is, creating snapshot with iSCSI backend fails.
# qemu-img info rhel.qcow2
image: rhel.qcow2
file format: qcow2
virtual size: 20G (21474836480 bytes)
disk size: 1.7G
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
refcount bits: 16
corrupt: false
# qemu-img check rhel.qcow2
No errors were found on the image.
27104/327680 = 8.27% allocated, 16.77% fragmented, 0.00% compressed clusters
Image end offset: 1777205248
# qemu-img create -f qcow2 -F qcow2 -b rhel.qcow2 iscsi://10.16.67.19:3260/iqn.2017-05.com.example:t1/0
qemu-img: iscsi://10.16.67.19:3260/iqn.2017-05.com.example:t1/0: Failed to parse URL : iscsi://10.16.67.19:3260/iqn.2017-05.com.example:t1/rhel.qcow2
Expected results:
Creating snapshot with iSCSI backend succeeds.
Additional info:
But if we use one iSCSI disk image as backing_file, then create one snapshot on local filesystem will succeed.
The following case succeeds:
[... Shutdown Guest ...]
Host# qemu-img create -f qcow2 -F qcow2 -b iscsi://10.16.67.19:3260/iqn.2017-05.com.example:t1/0 local-sp
Formatting 'local-sp', fmt=qcow2 size=21474836480 backing_file=iscsi://10.16.67.19:3260/iqn.2017-05.com.example:t1/0 backing_fmt=qcow2 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
Host# qemu-img info local-sp
image: local-sp
file format: qcow2
virtual size: 20G (21474836480 bytes)
disk size: 196K
cluster_size: 65536
backing file: iscsi://10.16.67.19:3260/iqn.2017-05.com.example:t1/0
backing file format: qcow2
Format specific information:
compat: 1.1
lazy refcounts: false
refcount bits: 16
corrupt: false
I find that this bug is related with the path name of backing_file:
If using absolute path for backing_file, creating snapshot with iSCSI backend will succeed; otherwise, if using relative path, creating snapshot with iSCSI backend will fail.
[host]# qemu-img create -f qcow2 -F qcow2 -b ../dataimage/rhel.qcow2 iscsi://129.40.28.33:3260/iqn.2017-04.com.example:t1/3
qemu-img: iscsi://129.40.28.33:3260/iqn.2017-04.com.example:t1/3: Failed to parse URL : iscsi://129.40.28.33:3260/iqn.2017-04.com.example:t1/../dataimage/rhel.qcow2
[host]# qemu-img create -f qcow2 -F qcow2 -b /home/yilzhang/dataimage/rhel.qcow2 iscsi://129.40.28.33:3260/iqn.2017-04.com.example:t1/3
Formatting 'iscsi://129.40.28.33:3260/iqn.2017-04.com.example:t1/3', fmt=qcow2 size=31138512896 backing_file=/home/yilzhang/dataimage/rhel.qcow2 backing_fmt=qcow2 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
pingl, please help to check, thank you.
Change the summary to "Fail to create snapshot on iscsi backend when specifying backing file with relative path on local filesystem" according to comment 7.
The relative filename is "relative to the created image", not relative to the working directory. Verify this with a small example:
fam@lemon:/var/tmp$ mkdir a
fam@lemon:/var/tmp$ cd a
fam@lemon:/var/tmp/a$ qemu-img create x 1G
Formatting 'x', fmt=raw size=1073741824
fam@lemon:/var/tmp/a$ cd ..
fam@lemon:/var/tmp$ qemu-img create a/y -b x -f qcow2
Formatting 'a/y', fmt=qcow2 size=1073741824 backing_file=x cluster_size=65536 lazy_refcounts=off refcount_bits=16
fam@lemon:/var/tmp$ qemu-img info a/y
image: a/y
file format: qcow2
virtual size: 1.0G (1073741824 bytes)
disk size: 196K
cluster_size: 65536
backing file: x (actual path: a/x)
Format specific information:
compat: 1.1
lazy refcounts: false
refcount bits: 16
corrupt: false
fam@lemon:/var/tmp$ cd
fam@lemon:~$ qemu-img info /var/tmp/a/y
image: /var/tmp/a/y
file format: qcow2
virtual size: 1.0G (1073741824 bytes)
disk size: 196K
cluster_size: 65536
backing file: x (actual path: /var/tmp/a/x)
Format specific information:
compat: 1.1
lazy refcounts: false
refcount bits: 16
corrupt: false
So expecting a relative path to work against an iscsi URI doesn't make sense, and I don't see a reason why a user would think that could work. The only thing that is missing is to clarify that "if the backing file path is relative, it is looked up based on the newly created image, rather than the current working directory of the qemu-img command." in documentation.
commit a16efd53406bc8d89f87253ab10290f8d1b145a7
Author: Fam Zheng <famz>
Date: Fri Aug 4 22:36:58 2017 +0800
qemu-img: Clarify about relative backing file options
It's not too surprising when a user specifies the backing file relative
to the current working directory instead of the top layer image. This
causes error when they differ. Though the error message has enough
information to infer the fact about the misunderstanding, it is better
if we document this explicitly, so that users don't have to learn from
mistakes.
Signed-off-by: Fam Zheng <famz>
Reviewed-by: Eric Blake <eblake>
Reviewed-by: Jeff Cody <jcody>
Reviewed-by: Stefan Hajnoczi <stefanha>
Signed-off-by: Kevin Wolf <kwolf>
Comment 14Miroslav Rezanina
2017-12-19 16:21:15 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://access.redhat.com/errata/RHSA-2018:1104
Description of problem: Use one local bootable disk image as backing_file, and then create one snapshot with iSCSI backend will fail. Version-Release number of selected component (if applicable): Host: kernel: 3.10.0-663.el7.ppc64le qemu-kvm-rhev-2.9.0-3.el7.ppc64le SLOF-20170303-3.git66d250e.el7.noarch Guest: 3.10.0-663.el7.ppc64le How reproducible: 100% Steps to Reproduce: 1. Create one disk image on local filesystem # qemu-img create -f qcow2 rhel.qcow2 20G 2. Install guest -drive file=rhel.qcow2,if=none,id=drive-data-disk1,format=qcow2,cache=none,aio=native,serial=sluo-disk1 \ -device scsi-hd,drive=drive-data-disk1,bus=virtio.0,bootindex=0 \ 3. Boot up the guest and it works well, then shutdown it 4. Use the above disk image as backing_file, create one snapshot with iSCSI backend # qemu-img create -f qcow2 -F qcow2 -b rhel.qcow2 iscsi://10.16.67.19:3260/iqn.2015-05.com.example:t1/0 Actual results: Step4 fails, that is, creating snapshot with iSCSI backend fails. # qemu-img info rhel.qcow2 image: rhel.qcow2 file format: qcow2 virtual size: 20G (21474836480 bytes) disk size: 1.7G cluster_size: 65536 Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false # qemu-img check rhel.qcow2 No errors were found on the image. 27104/327680 = 8.27% allocated, 16.77% fragmented, 0.00% compressed clusters Image end offset: 1777205248 # qemu-img create -f qcow2 -F qcow2 -b rhel.qcow2 iscsi://10.16.67.19:3260/iqn.2017-05.com.example:t1/0 qemu-img: iscsi://10.16.67.19:3260/iqn.2017-05.com.example:t1/0: Failed to parse URL : iscsi://10.16.67.19:3260/iqn.2017-05.com.example:t1/rhel.qcow2 Expected results: Creating snapshot with iSCSI backend succeeds. Additional info: But if we use one iSCSI disk image as backing_file, then create one snapshot on local filesystem will succeed. The following case succeeds: [... Shutdown Guest ...] Host# qemu-img create -f qcow2 -F qcow2 -b iscsi://10.16.67.19:3260/iqn.2017-05.com.example:t1/0 local-sp Formatting 'local-sp', fmt=qcow2 size=21474836480 backing_file=iscsi://10.16.67.19:3260/iqn.2017-05.com.example:t1/0 backing_fmt=qcow2 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16 Host# qemu-img info local-sp image: local-sp file format: qcow2 virtual size: 20G (21474836480 bytes) disk size: 196K cluster_size: 65536 backing file: iscsi://10.16.67.19:3260/iqn.2017-05.com.example:t1/0 backing file format: qcow2 Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false