To quickly replicate the environment of an Elastic Compute Service (ECS) instance, you can create a custom image from a system disk snapshot of the instance. The custom image contains the operating system of the ECS instance, the software installed on the ECS instance, and the configurations of and data stored on the ECS instance. You can create ECS instances that have identical environment settings as the original ECS instance from the custom image. This topic describes how to use a system disk snapshot to create a custom image.
Prerequisites
A snapshot of the system disk of an ECS instance is created. For more information, see Create a snapshot.
Sensitive data is deleted from the system disk snapshot to enhance data security.
Considerations
Before you use a snapshot to create a custom image, take note of the items described in the following table.
Item | Description |
Region | A custom image and the snapshot from which the image was created reside in the same region. If you want to use an image across regions, you can create a custom image and then copy the custom image across regions. |
Snapshot |
|
Billing | You are charged for snapshot storage. For more information, see Snapshots. |
Creation period | The amount of time required to create an image varies based on the sizes of disks. You must wait until the snapshot of each disk is created before you can use the image. |
Others | If the ECS instance from which a snapshot was created expires or is released, the custom images created from the snapshot and the ECS instance created from the images are not affected. |
Procedure
You can use a system disk snapshot to create a custom image on the Images page, Instance Details page, or Snapshots page. In this example, a custom image is created on the Snapshots page.
Log on to the ECS console.
In the left-side navigation pane, choose .
In the top navigation bar, select the region and resource group to which the resource belongs.
On the Disk Snapshots tab, find a snapshot whose Disk Type is System Disk and click Create Custom Image in the Actions column.
In the Create Custom Image dialog box, configure the parameters that are described in the following table.
Parameter
Description
References
Name
Enter a name for the custom image.
N/A.
Image Check
Optional. The image check feature checks whether imported custom images are valid and whether the images can be used to create full-featured ECS instances.
By default, Check After Creation is selected, and the image check feature immediately checks the custom image after the image is created. After the image check is completed, you can view the check result in the Check Result column corresponding to the image on the Custom Images tab. If you need to repair an item, you can use the ACS-ECS-RepairImage public template of CloudOps Orchestration Service (OOS) or manually repair the item based on the solutions in the check result.
NoteOnly specific operating systems support the image check feature. For information about the operating systems that do not support the image check feature, see Operating system limits for image check.
Image Family
Optional. Select an image family.
Custom images that belong to an image family can be deprecated or restored to allow seamless image updates and rollbacks.
Snapshot Settings
Optional. Select increaseData Disk, click increases, and then select the ID of a data disk snapshot. After data disk snapshots are added, the custom image created from the snapshots contains the same number of data disks as the snapshots.
If you do not select the ID of a data disk snapshot, an empty data disk is created. The default size of the data disk is 5 GiB.
If you select the ID of a data disk snapshot, a data disk that has the same size as the data disk snapshot is created from the snapshot.
Billing of Snapshots
If you specified a retention period for the snapshot, you must select I have read the Billing of Snapshots.
ImportantTo ensure that the snapshot can be automatically released on schedule, delete the images that are associated with the snapshot before the snapshot expires. Otherwise, the snapshot cannot be released and continues to generate fees.
Description
Optional. Enter a description for the custom image.
N/A
Tag
Optional. Select a tag.
The Tag parameter is optional in most cases.
The Tag parameter is required when you log on as a Resource Access Management (RAM) user and a policy attached to the RAM user requires that tags be added. In this case, if you do not specify the Tag parameter, an error is reported indicating insufficient permissions.
Resource Group
Optional. Select a resource group to manage the custom image based on the usage and permissions.
Click OK.