If the latest custom image in an image family is defective and you want to use an earlier image version to restore your business, you can deprecate the latest custom image in the image family to roll the image family back to an earlier image version. If you want to use a deprecated custom image in an image family, you can restore the custom image to use. This topic describes how to deprecate or restore an image in an image family.
Prerequisites
Two custom images are available in the same image family. For more information, see Set an image family.
In this example, the image family is named image-test
and contains two images: image1
and image2
. image2
is the latest available custom image.
Limits
Images in the Deprecated or Available state have the following limits:
A custom image that has been shared must be unshared before the image can be put into the Deprecated state.
Custom images in the Deprecated state can be used to create instances or replace system disks, but cannot be shared or copied.
Deprecate images in an image family
After you set the state of the latest available custom image in an image family to Deprecated and use the image family to create an Elastic Compute Service (ECS) instance, the system uses the latest available custom image other than the deprecated custom image by default.
If the deprecated custom image is the only available custom image in the image family, no custom image is available in the image family from which you want to create instances. Proceed with caution.
Log on to the ECS console.
In the left-side navigation pane, choose .
In the top navigation bar, select the region and resource group to which the resource belongs.
Deprecate the latest custom image named
image-2
in theimage-test
image 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 the
image2
image and choose > Depreciate Image in the Actions column.Confirm the image that you want to deprecate and click Confirm.
Deprecated is displayed in the Status column that corresponds to
image2
.
Log on to OpenAPI Explorer.
Call the DescribeImageFromFamily operation to query the latest available custom image in the specified image family.
In this example, the latest image in the
image-test
image family is queried. Specify the following API request parameters:RegionId: Specify the region ID of the image family.
ImageFamily: Specify the image family name. Example:
image-test
.
The following response, the name of the latest available image is
image1
, which indicates that theimage2
image in the image family is deprecated.
Restore an image in an image family
If you want to use the latest deprecated custom image in the image family, you must restore the custom image to use as the latest available custom image.
Log on to the ECS console.
In the left-side navigation pane, choose .
In the top navigation bar, select the region and resource group to which the resource belongs.
Restore the latest image
image2
in theimage-test
image 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 the
image2
image that is in the Depreciated state and choose > Restore Image in the Actions column.Confirm the image that you want to restore and click Confirm.
Available is displayed in the Status column that corresponds to
image2
.
Log on to the OpenAPI Explorer console.
Call the DescribeImageFromFamily operation to query the latest available custom image in the specified image family.
In this example, the latest image in the
image-test
image family is queried. Specify the following API request parameters:RegionId: Specify the region ID of the image family.
ImageFamily: Specify the image family name. Example:
image-test
.
In the following response, the name of the latest available image is
image2
, which indicates thatimage2
in the image family is restored.