An image family is used to classify a group of related images, which can help you better manage and use images. You can set an image family for a custom image when you create a custom image or edit the image attributes. This topic describes how to specify an image family for a custom image.
Procedure
Set an image family in the ECS console
You can use one of the following methods to set an image family for a custom image.
Set an image family for a custom image when you create the custom image.
For more information, see Create a custom image from an instance or Create a custom image from a snapshot.
Set an image family for a custom image when you modify the attributes of the custom image.
For more information, see Modify the attributes of a custom image.
You can specify a name to create an image family or select an existing image family.
NoteThe name must be 2 to 128 characters in length. It cannot start with a digit, a special character, http://, or https://. It can contain letters, digits, periods (.), underscores (_), hyphens (-), and colons (:).
(Optional) View the image families of custom images.
Turn on
above the custom image list.
In the Image Families section, click the name of an image family to view images in the image family.
Specify an image family by calling an API operation
In this example, the CreateImage operation is called to specify an image family when a custom image is created.
Log on to the OpenAPI Explorer console.
Call the CreateImage operation to create a custom image and set an image family.
In this example, a custom image is created from an instance and the image family name is set to
hangzhou-image
. Take note of the following API request parameters:RegionId: the ID of the region. Example:
cn-hangzhou
.InstanceId: the ID of the instance. Example:
i-bp117mtgmllecpwl****
.ImageFamily: the image family name. Example:
hangzhou-image
.
After you create a custom image, you can obtain the ID of the custom image.
Call the DescribeImages operation to query the image family of the custom image that you create in the previous step.
Specify the following API request parameters:
RegionId: the same region ID as in the previous step.
ImageId: the ID of the custom image created in the previous step.
The following figure shows a sample response. The value of the
ImageFamily
parameter ishangzhou-image
.
References
After you set an image family, you can modify the image family. For more information, see Modify the attributes and tags of an image or ModifyImageAttribute.
After you set an image family, you can use the image family to create ECS instances. For more information, see Create an ECS instance by using an image family.