You need to enable JavaScript to run this app.
Elastic Compute Service

Elastic Compute Service

Copy page
Download PDF
Images
CreateImage - Creates images
Copy page
Download PDF
CreateImage - Creates images
Call the CreateImage operation to create a custom image based on an instance.​
Usage notes​
  • The number of custom images in the region where the instance is located cannot exceed 50.​
Debugging​
API Explorer
You can initiate calls online through API Explorer without paying attention to the signature generation process and quickly obtain the call results.
​
Request parameters​
Only the request parameters specific to this operation and some common parameters are listed below. For more information, refer to Common parameters.​
Action string required Sample value: CreateImage​
The action that you want to perform. Value: CreateImage.​
​
Version string required Sample value: 2020-04-01​
The API version. Value: 2020-04-01.​
​
CreateWholeImage boolean Optional Sample value: false​
Indicates whether to create a whole image. Value:​
  • false: Default value. This indicates not creating a whole image.​
  • true: This indicates creating a whole image.​
​
Description string Optional Sample value: This is my first image​
The image description.​
  • It must start with a letter or a Chinese character.​
  • It can contain only Chinese characters, letters, digits, underscores (_), hyphens (-), equal signs (=), English commas (,), English periods (.), Chinese commas (,), Chinese periods (。), and spaces.​
  • It must be 0 to 255 characters in length.​
  • If left blank, the parameter defaults to an empty value.​
​
ImageName string required Sample value: image-1​
The name of the image.​
  • It must start with a letter or a Chinese character.​
  • It can contain only Chinese characters, letters, digits, underscores (_), hyphens (-), and English periods (.).​
  • The name must be 1 to 128 characters in length.​
​
InstanceId string Optional Sample value: i-3teco18f1w5a71******​
The instance ID. You can call the DescribeInstances operation to query the instance ID.​
tip​
One of the values of this parameter, SnapshotId, or SnapshotGroupId is required.​
​
NeedDetection boolean Optional Sample value: true​
Specifies whether to perform image detection. Value:​
  • true: performs image detection. This is the default value.​
  • false: does not perform image detection.​
tip​
The image detection feature is currently in Beta. If you need a trial, contact your account manager.​
​
ProjectName string Optional Sample value: default​
The project to which the resource belongs.​
warning​
If the account that calls the operation has permissions only on specific projects, this parameter is required. For more information about how to authorize an account to manage projects, refer to Managing permissions on projects.​
​
SnapshotGroupId string Optional Sample value: sg-120931dkslfkl****​
The snapshot consistency group ID. This indicates creating the custom image by using a snapshot consistency group. You can call the DescribeSnapshotGroups operation to obtain the snapshot consistency group ID.​
tip​
One of the values of this parameter, SnapshotId, or InstanceId is required.​
​
SnapshotId string Optional Sample value: snap-120931dkslfkl****​
The system volume snapshot ID, which indicates using the system volume snapshot to create the custom image. You can call the DescribeSnapshots operation to view and obtain the snapshot ID.​
tip​
One of the values of this parameter, InstanceId, or SnapshotGroupId is required.​
​
Tags.N.Key string[] Optional Sample value: Tags.1.Key=image-tag-key-1&Tags.2.Key=image-tag-key-2​
The tag key of the image tag.​
  • Parameter - N: Indicates the serial number of the tag key. Value range: 1–20.​
  • Separate multiple keys with ampersands (&).​
tip​
  • Naming rules:​
  • It cannot start with volc: or sys: in any case form.​
  • Only language characters, digits, spaces, and English symbols of "_", ".", ":", "/", "=", "+", "-", and "@" are allowed.​
  • It must be 1 to 128 characters in length.​
  • Keys of the same resource must be unique.​
​
Tags.N.Value string[] Optional Sample value: Tags.1.Value=image-tag-value-1&Tags.2.Value=image-tag-value-2​
The tag value of the image tag.​
  • Argument - N: specifies the serial number of the tag value. Valid range: 1–20.​
  • Separate multiple tag values with ampersands (&).​
tip​
  • Naming rules:​
  • Only language characters, digits, spaces, and English symbols of "_", ".", ":", "/", "=", "+", "-", and "@" are allowed.​
  • It can be empty. Length limit: 0–256 characters.​
  • If you need to pass in this parameter, first specify the Tags.N.Key parameter.​
​
​
​
Response parameters​
Only the response parameters specific to this operation are listed below. For more information, refer to the response structure.​
ImageId string Sample value: image-3teco18f1w5a71******​
The image ID.​
​
​
​
Sample request​
​
GET /?Action=CreateImage&Version=2020-04-01&InstanceId=i-3teco18f1w5a71******&ImageName=image-1 HTTP/1.1​
Host: ecs.cn-beijing.volcengineapi.com​
Region: cn-beijing​
ServiceName: ecs​
​
Sample response​
​
{​
"ResponseMetadata":{​
"RequestId":"2021110417394001022514606307*****",​
"Action":"CreateImage",​
"Version":"2020-04-01",​
"Service":"ecs",​
"Region":"cn-beijing"​
},​
"Result": {​
"ImageId": "image-3teco18f1w5a71******"​
}​
}​
​
Error codes​
The table below lists the business-related error codes of the operation. For more information, refer to Common error codes.​
​
Status code​
Error code​
Error message​
Description​
400​
InvalidArgument​
The specified argument is invalid.​
The specified parameter is invalid.​
400​
InvalidDescription.Malformed​
The specified Description is malformed.​
The specified description is invalid.​
400​
InvalidImageName.Malformed​
The specified ImageName is malformed.​
The specified image name is invalid.​
400​
InvalidInstanceStatus​
The status of the specified instance does not support this request.​
The current status of the instance does not support this operation.​
400​
InvalidInstanceVolumeStatusForCreateImage.Unsupported​
The specified instance volume status cannot be used for CreateImage.​
The volume status of the specified instance does not support creating a custom image.​
400​
InvalidParameterCombination​
Indicates an incorrect combination of parameters, or a missing parameter.​
Argument combination error or missing argument.​
400​
InvalidPlatformForDetect.UnSupported​
The specified image platform cannot be used for detect.​
The specified image platform does not support detection​
400​
InvalidSnapshotIdOrSnapshotGroupIdForCreateImage.UnSupported​
The specified SnapshotId or SnapshotGroupId cannot be used for CreateImage.​
The specified snapshot or consistency group does not support creating a custom image.​
400​
InvalidSnapshotStatus​
The status of the specified snapshot does not support this request.​
The specified snapshot status does not support this operation.​
400​
InvalidTagKey.Malformed​
The specified TagKey is malformed.​
The specified tag key is invalid.​
400​
InvalidTagValue.Malformed​
The specified TagValue is malformed.​
The specified tag value is invalid.​
400​
InvalidVolumeTypeForCreateImage.Unsupported​
The specified instance volume type cannot be used for CreateImage.​
The volume type of the specified instance does not support creating a custom image.​
400​
LimitExceeded.MaximumImageCount​
You've reached the limit on the number of image that you can create.​
The number of custom images that you create exceeds the upper limit.​
400​
LimitExceeded.MaximumSnapshotCount​
You've reached the limit on the number of snapshot that you can create.​
The number of specified volume snapshots exceeds the limit.​
400​
LimitExceeded.MaximumSnapshotGroupTotalSize​
You've reached the limit on the total size of snapshot group that you can create.​
The capacity of the specified snapshot consistency group exceeds the limit.​
400​
LimitExceeded.MaximumSystemVolumeSize​
The specified system volume size exceeds the limit.​
The specified system volume size (GiB) exceeds the limit.​
400​
LimitExceeded.MaximumTags​
You've reached the limit on the number of tags that you can create.​
The specified tag number exceeds the maximum limit.​
400​
MissingParameter.ImageName​
The required parameter ImageName is not supplied.​
The image name cannot be empty.​
404​
InvalidInstance.NotFound​
The specified instance does not exist.​
The specified instance does not exist.​
404​
InvalidProject.NotFound​
The specified Project does not exist.​
The specified project does not exist.​
404​
InvalidSnapshotGroupId.NotFound​
The specified SnapshotGroupId does not exist.​
The specified snapshot consistency group ID does not exist.​
404​
InvalidSnapshotId.NotFound​
The specified SnapshotId does not exist.​
The specified snapshot ID does not exist.​
409​
InvalidTagKey.Conflict​
The specified TagKey already exists.​
The specified tag key already exists.​
412​
OperationDenied.ResourceLocked​
The specified operation is denied as your resource is locked for another operation.​
The specified operation is rejected because your resource has been locked by another operation.​
412​
OperationDenied.SnapshotServiceUnavailable​
The specified operation is denied as Snapshot service is unavailable.​
The specified operation was denied because the snapshot service is not enabled.​
500​
InternalError​
An internal error has occurred.​
An internal error occurred. Please try again. If multiple attempts fail, submit a ticket.​
​
​
Last updated: 2026.06.18 17:48:24