Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1037584 - downloadImage fails getting size from file:// protocol using method http.
Summary: downloadImage fails getting size from file:// protocol using method http.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: vdsm
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: 3.3.0
Assignee: Federico Simoncelli
QA Contact: Aharon Canan
URL:
Whiteboard: storage
Depends On:
Blocks: 1034777
TreeView+ depends on / blocked
 
Reported: 2013-12-03 12:14 UTC by Sandro Bonazzola
Modified: 2016-02-10 16:44 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-12-03 20:04:58 UTC
oVirt Team: Storage
Target Upstream Version:


Attachments (Terms of Use)

Description Sandro Bonazzola 2013-12-03 12:14:33 UTC
vdsClient -s localhost downloadImage "{'url': 'file:///var/tmp/tmpnhXPRe', 'method': 'http'}" 288cf8b3-13e5-4b17-87bf-17882591115b f1ba6631-4ee6-4667-9fe5-a7de06a10b43 e6ccdabd-0109-40ad-94a0-a5d4aad6ee15 defac5f2-36b3-495d-a98c-cd13efbd98fc


Traceback (most recent call last):
File "/usr/share/vdsm/storage/task.py", line 857, in _run
return fn(*args, **kargs)
File "/usr/share/vdsm/storage/task.py", line 318, in run
return self.cmd(*self.argslist, **self.argsdict)
File "/usr/share/vdsm/storage/securable.py", line 68, in wrapper
return f(self, *args, **kwargs)
File "/usr/share/vdsm/storage/sp.py", line 1790, in downloadImage
.download(methodArgs, sdUUID, imgUUID, volUUID)
File "/usr/share/vdsm/storage/image.py", line 1172, in download
vol.extend(imageSharing.getSize(methodArgs) / volume.BLOCK_SIZE)
File "/usr/share/vdsm/storage/imageSharing.py", line 78, in getSize
return getSizeImpl(methodArgs)
File "/usr/share/vdsm/storage/imageSharing.py", line 44, in httpGetSize
raise RuntimeError("Unable to determine image size")
RuntimeError: Unable to determine image size

The command causing that error is:
# /usr/bin/curl -q --silent --fail --show-error --head file:///var/tmp/tmpnhXPRe
Content-Length: 21474836480
Accept-ranges: bytes
Last-Modified: Tue, 03 Dec 2013 11:20:45 GMT
# echo $?
0


originally observed while verifying http://gerrit.ovirt.org/#/c/21923/

We're using file:// because downloadImage doesn't support local has method (bug #1037500 )

Comment 1 Federico Simoncelli 2013-12-03 19:15:22 UTC
(In reply to Sandro Bonazzola from comment #0)
> vdsClient -s localhost downloadImage "{'url': 'file:///var/tmp/tmpnhXPRe',
> 'method': 'http'}" 288cf8b3-13e5-4b17-87bf-17882591115b
> f1ba6631-4ee6-4667-9fe5-a7de06a10b43 e6ccdabd-0109-40ad-94a0-a5d4aad6ee15
> defac5f2-36b3-495d-a98c-cd13efbd98fc

WRT:

{'url': 'file:///var/tmp/tmpnhXPRe', 'method': 'http'}

You are using the downloadImage HTTP method to, instead, do a local copy from a file:/// url.
Luckily it fails. You shouldn't be exploiting an internal implementation (curl) in order to achieve something that downloadImage (http method) wasn't designed for.

I'd prefer to address this with bug 1037500.

Comment 2 Sergey Gotliv 2013-12-03 20:04:58 UTC
Closed based on comment 1.


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