Uploading images using euca-publish-tarball sets image size = 0 when using Swift storage
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Fix Committed
|
Critical
|
Unassigned |
Bug Description
glance 2011.3~
nova 2011.3~
swift 1.4.3-0ubuntu1
Until recently, I was using nova with glance + the filesystem backend without any problems. After switching to using swift as the backend all images uploaded are registered with a size of zero. This prevents the images from being used to launch instances.
Tests that I have performed:
1. Upload via nova using 'euca-publish-
2. Upload the same image using the glance command line client (without passing in the file size) results in the file being registered correctly with the correct file size.
3. Upload as in (1) and manually change the file size in the registry's database allows the image to be downloaded and booted correctly.
During tests (1) and (3) the logs indicate that glance.registry sets size to zero in the metadata, but the size is set correctly in (2).
When I query swift for the images directly, they report the correct sizes and can be downloaded directly.
Almost positive this is due to Nova not using the latest Glance client (which does a file seek and sets the Content-Length of the request properly...
I'll check with Monty and Vish and see what's up. In the meantime, could you check on your Nova box (the one running nova-compute) that your Glance library has a glance. client. add_image( ) method that has a section that looks like this?
if image_data:
headers[ 'content- type'] = 'application/ octet-stream'
image_ size = self._get_ image_size( image_data)
headers[ 'x-image- meta-size' ] = image_size
headers[ 'content- length' ] = image_size
body = image_data
if image_size:
else:
body = None
Thanks!
-jay