Modifies the attributes of a custom image, such as the image family, name, boot mode, and status and whether the image supports the Non-Volatile Memory Express (NVMe) protocol. When you call this operation, you can specify parameters, such as ImageId and ImageFamily, in the request.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ecs:ModifyImageAttribute | update | *Image acs:ecs:{#regionId}:{#accountId}:image/{#imageId} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the custom image. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
ImageId | string | Yes | The ID of the custom image. | m-bp18ygjuqnwhechc**** |
ImageName | string | No | The name of the custom image. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with acs: or aliyun. It cannot contain http:// or https://. It can contain letters, digits, periods (.), colons (:), underscores (_), and hyphens (-). By default, this parameter is empty. In this case, the original name is retained. | testImageName |
Status | string | No | The new state of the custom image. Valid values:
Note
If you want to roll back a custom image in the image family to a previous version, you can put the latest available custom image into the Deprecated state. If no custom images are in the Available state within the image family, an image family cannot be used to create instances. Proceed with caution if only a single custom image is in the Available state within the image family.
| Deprecated |
ImageFamily | string | No | The name of the image family. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with acs: or aliyun. It cannot contain http:// or https://. It can contain letters, digits, periods (.), colons (:), underscores (_), and hyphens (-). By default, this parameter is empty. | hangzhou-daily-update |
BootMode | string | No | The new boot mode of the image. Valid values:
Note
Before you change the boot mode, we recommend that you obtain the boot modes supported by the image. If you specify an unsupported boot mode for the image, ECS instances that use the image cannot start as expected. If you do not know which boot modes are supported by the image, we recommend that you use the image check feature to perform a check. For information about the image check feature, see Overview .
Note
For information about the UEFI-Preferred boot mode, see Best practices for ECS instance boot modes.
| BIOS |
LicenseType | string | No | The type of the license that is used to activate the operating system after the image is imported. Set the value to BYOL. BYOL: The license that comes with the source operating system is used. When you use the BYOL license, make sure that your license key is supported by Alibaba Cloud. | Auto |
Description | string | No | The new description of the custom image. The description must be 2 to 256 characters in length It cannot start with http:// or https://. This parameter is empty by default, which specifies that the original description is retained. | testDescription |
Features | object | No | The attributes of the custom image. | |
NvmeSupport | string | No | Specifies whether to support the Non-Volatile Memory Express (NVMe) protocol. Valid values:
| supported |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidImageName.Malformed | The specified Image name is wrongly formed. | The specified image name is invalid. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with acs: or aliyun. It can contain letters, digits, periods (.), colons (:), underscores (_), and hyphens (-). It cannot contain http:// or https://. |
400 | MissingParameter | The input parameter "RegionId" that is mandatory for processing this request is not supplied. | - |
400 | InvalidImageName.Duplicated | The specified Image name has already bean used. | - |
400 | InvalidDescription.Malformed | The specified description is wrongly formed. | The resource description is invalid. The description must be 2 to 256 characters in length and cannot start with http:// or https://. |
400 | ImageQuotaFull.ImageFamily | The specified image family has exceeded max number of images for one image family. | - |
400 | InvalidImageFamily.Malformed | The specified parameter "ImageFamily" is malformed. | - |
400 | ImageFamilyQuotaFull | The specified region has exceeded max number of image family. | - |
400 | InvalidBootMode.NotSupport | The specified parameter BootMode is not supported. | - |
400 | InvalidLicenseType.NotSupported | The specified parameter LicenseType is not supported. | - |
400 | InvalidBootMode.NotSupport | The specified parameter BootMode is not supported for current image architecture. | The current image architecture does not support setting this boot mode. |
403 | ImageStatus.NotAvailable | The specified image status is not available. | - |
403 | ImageStatus.NotDeprecated | The specified image status is not deprecated. | The specified image is not in the Deprecated state. |
403 | ImageUseShared | The specified image has been shared to others, please remove shared accounts first. | - |
403 | OperationDeined.ImageUsingByInstance | The boot mode of the image cannot be modified because it has associated instances. | The boot mode of the image cannot be modified while the image has associated instances. |
404 | InvalidImageId.NotFound | The specified ImageId does not exist. | The specified image does not exist in this account. Check whether the image ID is correct. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2022-11-30 | The Error code has changed | View Change Details |