Modifies the attributes of a custom image, such as the image family, name, boot mode, status, and NVMe support, by calling the ModifyImageAttribute operation with parameters such as ImageId and ImageFamily.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:ModifyImageAttribute |
update |
*Image
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the custom image. You can call DescribeRegions 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 or a Chinese character and cannot start with Default value: null, which indicates that the original name is retained. |
testImageName |
| Status |
string |
No |
The image status. Valid values:
Note
To roll back a custom image in an image family to the previous version, you can set the latest available custom image to the deprecated state. However, if the image is the only available custom image in the image family, the image family will have no available custom image for creating instances after the image is deprecated. Proceed with caution. |
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 or a Chinese character and cannot start with Default value: null. |
hangzhou-daily-update |
| BootMode |
string |
No |
The boot mode of the image. Valid values:
Important
To prevent instances from failing to start due to an unsupported boot mode, make sure that you understand the boot modes supported by the image before you modify this parameter. For more information about image boot modes, see Image boot modes. Valid values:
|
BIOS |
| LicenseType |
string |
No |
The license type used to activate the operating system after the image is imported. Currently, only BYOL is supported. BYOL: The license that comes with the source operating system. When you use BYOL, make sure that your license key supports use on Alibaba Cloud. |
BYOL |
| Description |
string |
No |
The description of the custom image. The description must be 2 to 256 characters in length and cannot start with Default value: null, which indicates that the original description is retained. |
testDescription |
| Features |
object |
No |
The image feature attributes. |
|
| NvmeSupport |
string |
No |
Modifies the NVMe support attribute of the image. If this parameter is not specified, the current value is retained. Important Before enabling this feature, make sure that the NVMe driver is pre-installed in the operating system. Recommended procedure: install the driver on an instance, create a custom image, and then call this operation. Forcibly enabling this feature without the driver will cause instance startup failures. |
supported |
| ImdsSupport |
string |
No |
The metadata access mode of the image. Valid values:
|
v2 |
| DryRun |
boolean |
No |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** |
Examples
Success response
JSON format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidImageName.Malformed | Image names must be between 2 and 128 characters long, using either English or Chinese characters. The name must start with a letter or a Chinese character, and can include numbers, colons, underscores and hyphens. | The length of the image name is 2 to 128 English or Chinese characters. It must start with an uppercase letter or a Chinese character and can contain numbers, colons (:), underscores (_), or dashes (-). |
| 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. | The specified image name is already in use. |
| 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 | InvalidParameter.FeaturesImdsSupport | The specified parameter Features.ImdsSupport is not supported. | The specified parameter Features.ImdsSupport is not supported. |
| 403 | ImageStatus.NotAvailable | The specified image status is not available. | The status of the specified image 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. |
| 403 | InvalidOperation.FeaturesImdsSupportNotMatch | The specified parameter Features.ImdsSupport can not be set to v1 from v2. | The specified parameter Features.ImdsSupport can not be set to v1 from v2. |
| 403 | InvalidStatus.ImageIsCreating | The operation cannot be performed because the image is creating. Please wait until the creation is complete and try again. | The operation cannot be performed because the image is creating. Please wait until the creation is complete and try again. |
| 403 | InvalidOperation.PublicImageUnsupported | The community image's publisher is not the current account. Modification is not permitted. | The community image's publisher is not the current account. Modification is not permitted. |
| 403 | InvalidDescription.Malformed | The specified parameter description is not valid. | The specified parameter description is invalid. |
| 403 | InvalidBootMode.SecureBootUnsupported | Secure Boot requires UEFI or UEFI-Preferred boot mode. Please check the BootMode and try again. | Secure Boot requires UEFI or UEFI-Preferred boot mode. Please check the startup mode and try again. |
| 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. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.