| Verb | URI | Description | |||
| POST | /servers/id/action |
Creates a new image. | |||
Normal Response Code(s): 202
Error Response Code(s): computeFault (400, 500, …), backupOrResizeInProgress (409), resizeNotAllowed (403), serviceUnavailable (503), unauthorized (401), forbidden (403), badRequest (400), badMethod (405), overLimit (413), itemNotFound (404), badMediaType (415), serverCapacityUnavailable (503), buildInProgress (409)
| Image Status Transition: |
SAVING ACTIVE
|
||
SAVING ERROR (on error)
|
|||
This action creates a new image for the given
server. Once complete, a new image will be
available that can be used to rebuild or create
servers. The full URL to the newly created image
is returned via the Location header,
additional attributes for the image including
creation status may be retrieved by performing a
subsequent GET on that URL. See Section 4.5.2, “Get Image Details” for details.
Custom image metadata can also be supplied when creating an image. See Section 4.6, “Metadata” for details on working with metadata. The maximum size of the metadata key and value is 255 bytes each. The maximum number of key-value pairs that can be supplied per image is determined by the compute provider and may be queried via the maxImageMeta absolute limit.
This operation does not return a response body.
![]() | Note |
|---|---|
At present, image creation is an asynchronous operation, so coordinating the creation with data quiescence, etc. is currently not possible. |
Example 4.39. Action Create Image: XML
<?xml version="1.0" encoding="UTF-8"?>
<createImage
xmlns="http://docs.openstack.org/compute/api/v1.1"
name="new-image">
<metadata>
<meta key="ImageType">Gold</meta>
<meta key="ImageVersion">2.0</meta>
</metadata>
</createImage>
Example 4.40. Action Create Image: JSON
{
"createImage" : {
"name" : "new-image",
"metadata": {
"ImageType": "Gold",
"ImageVersion": "2.0"
}
}
}

![[Note]](../common/images/admon/note.png)
