> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/compute/vm/image/createimage.md).

# CreateImage

## 1. API Description

This API (CreateImage) is used to create a custom image.

{% hint style="info" %} <mark style="color:blue;">**Note**</mark>

* <mark style="color:blue;">Up to 5 images can be created in each zone. If you need more, please contact Zenlayer Support.</mark>
* <mark style="color:blue;">The system disk of an instance will be mirrored while creating an image. Please ensure the instance is shut down.</mark> <mark style="color:blue;">Any operations on the instances are not allowed while creating.</mark>
* <mark style="color:blue;">The image size is the same as that of instance system disk.</mark>
* <mark style="color:blue;">Images are not supported in</mark> <mark style="color:blue;">`SIN-E`</mark> <mark style="color:blue;">and</mark> <mark style="color:blue;">`LAX-A`</mark> <mark style="color:blue;">for now.</mark>
  {% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name   | Required | Type   | Description                                                                                                                                                  |
| ---------------- | -------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| instanceId       | Yes      | String | ID of instance to be mirrored.                                                                                                                               |
| imageName        | Yes      | String | <p>Image name to be displayed.</p><p>This parameter must contain up to 24 characters. Only Chinese characters, letters, numbers, - and \_ are supported.</p> |
| imageDescription | No       | String | <p>Image description.</p><p>This parameter must contain up to 255 characters.</p>                                                                            |

## 3. Output Parameters

| Parameter Name | Type   | Description                                                                                                           |
| -------------- | ------ | --------------------------------------------------------------------------------------------------------------------- |
| requestId      | String | <p>The unique request ID, which is returned for each request.</p><p>RequestId is required for locating a problem.</p> |
| imageId        | String | Image ID.                                                                                                             |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Create an image.**

```json
POST /api/v2/vm HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: CreateImage
<Common Request Params>

Request:
{
  "instanceId": "your-instance-id",
  "imageName": "testimagename",
  "imageDescription": "testimagedescription"
}

Response:
{
  "requestId": "T69E37B61-4E39-4461-A2BB-205F847D1D60",
  "response": {
    "requestId": "T69E37B61-4E39-4461-A2BB-205F847D1D60",
    "imageId": "img-xxxxx"
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](/api-reference/api-introduction/toolkit/api-sdk.md)，to make it easier for you to call APIs. More programming languages will be supported.

## 6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see [Common Error Codes](/api-reference/api-introduction/instruction/commonerrorcode.md).

| HTTP Status Code | Error Code | Description |
| ---------------- | ---------- | ----------- |
