[Openstack] Glance API semantics when image sizes aren't known

Ewan Mellor Ewan.Mellor at eu.citrix.com
Tue Nov 15 20:03:30 UTC 2011


Hi,

What are the expected semantics for the Glance API when uploading an image who's size you do not know?  The docs at http://glance.openstack.org/glanceapi.html say "x-image-meta-size: This header is optional. ... When not present, Glance will calculate the image's size based on the size of the request body."  I read this as "If x-image-meta-size is missing, then Glance will accept the upload, and then update the metadata to match whatever what was sent".  However (with Glance-over-Swift at least) that's not what's happening.  What's actually happening is "If x-image-meta-size is missing, then the Content-Length header is read, and if both are missing then the image size is set to 0."

I'm not sure whether I should clarify the docs to say that x-image-meta-size is required if you don't set Content-Length, or whether the Swift backend needs to be updated to record / recover the uploaded image size.

Thanks,

Ewan.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20111115/8786493a/attachment.html>


More information about the Openstack mailing list