All Products
Search
Document Center

Elastic Compute Service:Deprecate or restore an image

Last Updated:Jan 29, 2024

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.

Important

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.

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Instances & Images > Images.

  3. In the top navigation bar, select the region and resource group to which the resource belongs. 地域

  4. Deprecate the latest custom image named image-2 in the image-test image family.

    1. (Optional) In the upper-right corner of the custom image list, turn on the image.png switch.

    2. In the Image Family section, click image-test.

    3. Find the image2 image and choose 更多操作 > Depreciate Image in the Actions column.

    4. Confirm the image that you want to deprecate and click Confirm.

    5. Deprecated is displayed in the Status column that corresponds to image2.

  5. Log on to OpenAPI Explorer.

  6. 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 the image2 image in the image family is deprecated. if1

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.

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Instances & Images > Images.

  3. In the top navigation bar, select the region and resource group to which the resource belongs. 地域

  4. Restore the latest image image2 in the image-test image family.

    1. (Optional) In the upper-right corner of the custom image list, turn on the image.png switch.

    2. In the Image Family section, click image-test.

    3. Find the image2 image that is in the Depreciated state and choose 更多操作 > Restore Image in the Actions column.

    4. Confirm the image that you want to restore and click Confirm.

    5. Available is displayed in the Status column that corresponds to image2.

  5. Log on to the OpenAPI Explorer console.

  6. 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 that image2 in the image family is restored.image2