This topic describes how to set image families by using the Elastic Compute Service
(ECS) console or by calling API operations.
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
- Log on to the ECS console.
- In the top navigation bar, select a region.
- 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 (-).

- In the left-side navigation pane, choose 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.

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.
- Log on to OpenAPI Explorer.
- 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.

- 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
.

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