Uploading image data

PUT /v2/images/{image_id}/file

Upload a binary image file to an image record created, according to Creating image records.

Before you can store binary image data, you must meet the following preconditions:

  • The image must exist.
  • You must set the disk and container formats in the image.
  • The image status must be queued.
  • Your image storage quota must be sufficient.
  • The size of the data that you want to store must not exceed the size that the OpenStack Image service allows.

After the operation completes, the image status will change to active.

Source: https://docs.openstack.org/api-ref/image/v2/index.html?expanded=upload-binary-image-data-detail#upload-binary-image-data



Name In Type Description
Content-Type header string The media type descriptor for the request body. Use application/openstack-images-v2.1-json-patch. (You can also use application/openstack-images-v2.0-json-patch, but keep in mind that it’s deprecated.)
X-Image-Meta-Store (Optional) header string

A store identifier to upload or import image data. Should only be included when making a request to a cloud that supports multiple backing stores. Use the store discovery call to determine an appropriate store identifier. Simply omit this header to use the default store.

New in version 2.8

image_id path string The UUID of the image.


Set the Content-Type request header to application/octet-stream.

# curl -ks -X PUT -H 'Content-Type: application/octet-stream' -H 'X-Auth-Token: gAAAAA<...>' \
--data-binary @cirros2.qcow2 \


Status codes


Code Reason
204 - No Content The server has fulfilled the request.


Code Reason
400 - Bad Request

Some content in the request was invalid.

401 - Unauthorized

User must authenticate before making a request.

403 - Forbidden

Policy does not allow current user to do this operation.

404 - Not Found

The requested resource could not be found.

409 - Conflict

This operation conflicted with another operation on this resource.

410 - Gone

The access request to the target resource is no longer available.

413 - Request Entity Too Large

The request is larger than the server is willing or able to process.

415 - Unsupported Media Type

The request entity has a media type which the server or resource does not support.

503 - Service Unavailable

Service is not available. This is mostly caused by service configuration errors which prevents the service from successful start up.