Modifies the name, description, state, or image family of a custom image.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ModifyImageAttribute

The operation that you want to perform. Set the value to ModifyImageAttribute.

RegionId String Yes cn-hangzhou

The region ID of the custom image. You can call the DescribeRegions operation to query the most recent region list.

ImageId String Yes m-bp18ygjuqnwhechc****

The ID of the custom image.

ImageName String No testImageName

The new 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 (-).

This parameter is empty by default, which indicates that the original name is retained.

Status String No Deprecated

The new state of the custom image. Valid values:

  • Deprecated: puts the image into the Deprecated state. If the custom image is shared, you must unshare it before you can put it into the Deprecated state. Images in the Deprecated state cannot be shared or copied, but can be used to create instances or replace system disks.
  • Available: puts the image into the Available state. You can restore an image from the Deprecated state to the Available state.
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. An image family that contains no custom images in the Available state cannot be used to create instances. Proceed with caution if only a single custom image in the image family is in the Available state.
ImageFamily String No hangzhou-daily-update

The new 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 (-).

This parameter is empty by default.

BootMode String No BIOS

The new boot mode of the custom image. Valid values:

  • BIOS
  • UEFI
Note You must know the boot modes supported by the specified image. When you use this parameter to change the boot mode of the image, specify a boot mode supported by the image to ensure that instances which use this image can start as expected.
LicenseType String No BYOL

The type of the license used to activate the operating system after the image is imported. Only BYOL is supported. Valid value:

BYOL: The license that comes with the source operating system is used. In this case, make sure that your license key can be used in Alibaba Cloud.

Description String No testDescription

The new description of the custom image. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

This parameter is empty by default, which indicates that the original description is retained.

Features.NvmeSupport String No supported

Indicates whether the image supports the Non-Volatile Memory Express (NVMe) protocol. Valid values:

  • supported: The image supports the NVMe protocol. Instances created from this image support the NVMe protocol.
  • unsupported: The image does not support the NVMe protocol. Instances created from this image do not support the NVMe protocol.

Response parameters

Parameter Type Example Description
RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

The request ID.

Examples

Sample requests

http(s)://ecs.aliyuncs.com/?Action=ModifyImageAttribute
&RegionId=cn-hangzhou
&ImageId=m-bp18ygjuqnwhechc****
&ImageName=testImageName
&Status=Deprecated
&ImageFamily=hangzhou-daily-update
&BootMode=BIOS
&Description=testDescription
&Features={"NvmeSupport":"supported"}
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ModifyImageAttributeResponse>
    <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3****</RequestId>
</ModifyImageAttributeResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "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. Invalid ImageName format. 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 (-).
400 InvalidImageName.Duplicated The specified Image name has already bean used. The specified image name already exists.
400 InvalidDescription.Malformed The specified description is wrongly formed. Invalid Description format. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
403 ImageStatus.NotAvailable The specified image status is not available. The specified image is not in the Available state.
403 ImageStatus.NotDeprecated The specified image status is not deprecated. The specified image is not in the Deprecated state.
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 is not found in this account. Check whether the image ID is correct.

For a list of error codes, see Service error codes.