Alibaba Cloud provides the image family feature to update and roll back images. You can set an image family for an updated image. Then, when you use the image family to create Elastic Compute Service (ECS) instances, you do not need to obtain the ID of the updated image. The system automatically selects the latest available custom image in the image family. You can also set the state of the latest available custom image in the image family to Deprecated to roll back the image.
Features
- When you call the RunInstances or CreateInstance operation to create ECS instances, you can set the
ImageFamily
parameter to automatically select the latest available custom image in the image family instead of specifying theImageId
parameter. - If you want to roll back an image in an image family, you can set the state of the image to Deprecated or delete the latest available custom image in the image family, and then create an ECS instance from the image family.
- You can restore an image from the Deprecated state to the Available state by using the ECS console or by calling the ModifyImageAttribute operation.
Limits
- You can set image families only for custom images.
- After you set an image family for a custom image, you can modify but cannot delete the image family.
- Image family names must be unique within the same account in the same region. Image family names can be the same in different regions.
- An image family can contain a maximum of 100 images.
- The number of image families within a single region cannot exceed 100.
- If a custom image is shared with other users, you must unshare the custom image before you put the custom image 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.
Usage notes
- Before you use the image family feature, you must set an image family for your images by using the ECS console or by calling API operations. For more information, see Set an image family.
- You can create ECS instances from image families only by calling API operations. When you create an ECS instance from an image family, the system automatically selects the latest available custom image in the image family. For more information, see Create an ECS instance from an image family.
- You can set the state of an image in an image family to Deprecated or restore the image. When you set the state of an image to Deprecated, the image can be rolled back. For more information, see Set the state of an image to Deprecated or restore an image.
- You can call the DescribeImageFromFamily operation to query the latest image in the specified image family.
The following figure shows the procedure for using an image family. 
