Use image deprecation to roll back an image family to an earlier version when the latest custom image is defective. To make a deprecated custom image usable again, restore it.
Prerequisites
Before you begin, ensure that you have:
Two custom images in the same image family. For more information, see Set an image family
The examples in this topic use an image family named image-test that contains two images: image1 and image2. image2 is the latest available custom image.
Limitations
A shared custom image must be unshared before it can be deprecated.
Deprecated custom images can still be used to create instances or replace system disks, but cannot be shared or copied.
After an image is deprecated
When an image is deprecated in an image family:
New instances created from the image family use the next latest available custom image instead.
The deprecated image remains usable — it can still be used to create instances or replace system disks.
The deprecated image cannot be shared or copied.
If the deprecated image is the only available image in the family, no image is available for creating new instances from that family. Proceed with caution.
Deprecate an image
Go to ECS console - Images.
In the top navigation bar, select the region and resource group of the resource.

Deprecate the latest custom image
image2in theimage-testimage family.(Optional) In the upper-right corner of the custom image list, turn on the
switch.In the Image Family section, click
image-test.Find
image2and choose
> Deprecate Image in the Actions column.Confirm the image to deprecate and click Confirm.
Verify that Deprecated appears in the Status column for
image2.
Log on to OpenAPI Explorer.
Call DescribeImageFromFamily to verify the latest available image in the family. Set the following parameters:
RegionId: The region ID of the image family.ImageFamily: The image family name — for example,image-test.
The response shows
image1as the latest available image, confirming thatimage2is deprecated.
Restore an image
Go to ECS console - Images.
In the top navigation bar, select the region and resource group of the resource.

Restore the deprecated image
image2in theimage-testimage family.(Optional) In the upper-right corner of the custom image list, turn on the
switch.In the Image Family section, click
image-test.Find
image2in the Deprecated state and choose
> Restore Image in the Actions column.Confirm the image to restore and click Confirm.
Verify that Available appears in the Status column for
image2.
Log on to OpenAPI Explorer.
Call DescribeImageFromFamily to verify the latest available image in the family. Set the following parameters:
RegionId: The region ID of the image family.ImageFamily: The image family name — for example,image-test.
The response shows
image2as the latest available image, confirming the restore was successful.
What's next
After an image is restored, use it to create ECS instances via the RunInstances or CreateInstance API operations.