Bug 1741893

Summary: uploading raw image to cow disk fails on verify volume
Product: [oVirt] ovirt-engine Reporter: Daniel Erez <derez>
Component: BLL.StorageAssignee: Daniel Erez <derez>
Status: CLOSED CURRENTRELEASE QA Contact: Yosi Ben Shimon <ybenshim>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.3.6CC: bugs, nsoffer
Target Milestone: ovirt-4.3.6Keywords: ZStream
Target Release: 4.3.6.4Flags: pm-rhel: ovirt-4.3+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.3.6.4 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-09-26 19:43:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Daniel Erez 2019-08-16 10:59:59 UTC
Description of problem:
When uploading a raw image into a qcow2 disk, the transfer fails by qemu-img
upon invoking VerifyUntrustedVolume:
err='qemu-img: Could not open \'/rhev/data-center/mnt/.../images/...\': 
Failed to get shared "write" lock\nIs another process using the image

Since uploading a raw image is done using an NBD server, StopNbdServer should
be invoked *before* verifying untrusted volume - as it takes a lock on the image.

Note: uploading into raw disk does not fail due to a bug 1741620 in qemu.

Version-Release number of selected component (if applicable):
4.3.6

How reproducible:
100%

Steps to Reproduce:
Upload a raw image into a cow disk using image transfer api.
E.g. using upload_disk script: https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/upload_disk.py

$ ./upload_disk.py --engine-url <engine_url> --username admin@internal --password-file pass --sd-name data1 <raw_image> --disk-format cow

Actual results:
Fails on verify untrusted volume phase.

Expected results:
Should complete successfully.

Comment 1 Yosi Ben Shimon 2019-09-01 11:59:35 UTC
Tested on:
ovirt-engine-4.3.6.4-0.1.el7.noarch

Actual result:
The image was uploaded successfully.

2019-09-01 14:54:18,617+03 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (EE-ManagedThreadFactory-engineScheduled-Thread-31) [a131fa43-d1ab-4c4c-8651-b32a18aae2b4] EVENT_ID: TRANSFER_IMAGE_SUCCEEDED(1,032), Image Upload with disk test.raw succeeded.

* Tested on 4.3.6-2 and 4.3.6-3 as well - failed as expected.
** Tested on file and block domains

Moving to VERIFIED

Comment 2 Sandro Bonazzola 2019-09-26 19:43:29 UTC
This bugzilla is included in oVirt 4.3.6 release, published on September 26th 2019.

Since the problem described in this bug report should be
resolved in oVirt 4.3.6 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.