This topic describes how to set image families by using the Elastic Compute Service (ECS) console or by calling API operations.

Prerequisites

An ECS instance or a system disk snapshot is created. For more information, see Creation method overview or Create a snapshot for a disk.

Background information

Image families cannot be separately created. You must set image families when you create custom images. If the image family that you set does not exist, the system automatically creates the image family. If the image family that you set already exists, the system assigns your custom images to the image family.

Set an image family by using the ECS console

  1. Log on to the ECS console.
  2. In the top navigation bar, select a region.
  3. Use one of the following methods to create a custom image:

    In the Create Custom Image dialog box, set Image Family for the custom image.

    You can specify a name for the image family or select an existing image family.
    Note The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http://, https://, acs:, or aliyun. It can contain letters, digits, colons (:), underscores (_), and hyphens (-).
    site image family
  4. In the left-side navigation pane, choose Instances & Images > Images to view the created custom image and the corresponding image family.
    In the Image Family section, enter an image family name or click the image family name for exact match. image family list

Set an image family by calling an API operation

This section describes how to set an image family when you call the CreateImage operation to create a custom image. For more information about the operation, see CreateImage.

  1. Log on to OpenAPI Explorer.
  2. Call the CreateImage operation to create a custom image and set an image family.
    In this example, create a custom image from an instance and set an image family named hangzhou-image. Specify the following API request parameters:
    • RegionId: Specify the ID of the region. Example: cn-hangzhou.
    • InstanceId: Specify the ID of the instance. Example: i-bp117mtgmllecpwl****.
    • ImageFamily: Specify the image family name. Example: hangzhou-image.
    After the custom image is created, the ID of the custom image is displayed. if3
  3. Call the DescribeImages operation to query the image family of the custom image created in the previous step. For more information about the operation, see DescribeImages.
    Specify the following API request parameters:
    • RegionId: Specify the same region ID as in the previous step.
    • ImageId: Enter the ID of the custom image created in the previous step.
    The following figure shows a sample response. The value of the ImageFamily parameter is hangzhou-image. if4

What to do next

If you want to modify an image family, you can call the ModifyImageAttribute operation. For more information, see ModifyImageAttribute.