You can create a custom image from a snapshot that contains the operating system and data of an Elastic Compute Service (ECS) instance. Then, you can use the custom image to create multiple identical instances.
Prerequisites
- The snapshot service is activated, and a system disk snapshot is created. For more information, see Activate ECS Snapshot and Create a snapshot of a disk.
- Sensitive data is deleted from the system disk snapshot to enhance data security.
Background information
Precautions
Before you create custom images from snapshots, take note of the items described in the following table.
Item | Description |
---|---|
Limits on regions | A custom image resides within the same region as the snapshot from which the image was created. For information about how to use images across regions, see Copy an image. |
Billing | A snapshot is automatically generated for each disk when you create a custom image. You are charged for the snapshots. For more information about snapshot billing, see Snapshots. |
Snapshot |
|
ECS instance | ECS instances created from custom images:
|
Create a custom image on the Images page
- Log on to the ECS console.
- In the left-side navigation pane, choose .
- In the top navigation bar, select a region.
- In the Create Image section, click Create Custom Image.
- In the Create Custom Image dialog box, configure the parameters described in the following table.
Parameter Description References Creation Method Select Snapshot. N/A Snapshot Select a created system disk snapshot from the drop-down list. N/A Image Name Enter a name for the custom image. N/A 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.
Overview Snapshot Details Optional. Select increaseData Disk, click increases, and then select the ID of a data disk snapshot. - If you leave the Snapshot ID field empty, an empty data disk will be created when you use the custom image to create an instance. By default, the data disk is 5 GiB in size.
- If you select the ID of a data disk snapshot, the capacity of the data disk to be created is the same as the snapshot size.
Snapshot overview Image Description Enter a description for the custom image. N/A Tag Select one or more tags. - Tag is an optional parameter in most cases.
- Tag is a required parameter 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 Tag, an error is reported and indicates insufficient permissions.
Overview Resource Group Optional. Select a resource group to manage the custom image based on the usage and permissions. Resource groups - Click OK.
Create a custom image on the Instances page
- Log on to the ECS console.
- In the left-side navigation pane, choose .
- In the top navigation bar, select a region.
- Find the instance whose snapshot you want to use and click the instance ID to go to the Instance Details page.
- On the Instance Details page, click the Snapshot 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 described in the following table.
Parameter Description References Image Name Enter a name for the custom image. N/A 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.
Overview Snapshot Details Optional. Select increaseData Disk, click increases, and then select the ID of a data disk snapshot. - If you leave the Snapshot ID field empty, an empty data disk will be created when you use the custom image to create an instance. By default, the data disk is 5 GiB in size.
- If you select the ID of a data disk snapshot, the capacity of the data disk to be created is the same as the snapshot size.
Snapshot overview Image Description Enter a description for the custom image. N/A Tag Select one or more tags. - Tag is an optional parameter in most cases.
- Tag is a required parameter when you log on as a RAM user and a policy attached to the RAM user requires that tags be added. In this case, if you do not specify Tag, an error is reported and indicates insufficient permissions.
Overview Resource Group Optional. Select a resource group to manage the custom image based on the usage and permissions. Resource groups - Click OK.
Create a custom image on the Snapshots page
- Log on to the ECS console.
- In the left-side navigation pane, choose .
- In the top navigation bar, select a region.
- 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 described in the following table.
Parameter Description References Image Name Enter a name for the custom image. N/A 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.
Overview Snapshot Details Optional. Select increaseData Disk, click increases, and then select the ID of a data disk snapshot. - If you leave the Snapshot ID field empty, an empty data disk will be created when you use the custom image to create an instance. By default, the data disk is 5 GiB in size.
- If you select the ID of a data disk snapshot, the capacity of the data disk to be created is the same as the snapshot size.
Snapshot overview Image Description Enter a description for the custom image. N/A Tag Select one or more tags. - Tag is an optional parameter in most cases.
- Tag is a required parameter when you log on as a RAM user and a policy attached to the RAM user requires that tags be added. In this case, if you do not specify Tag, an error is reported and indicates insufficient permissions.
Overview Resource Group Optional. Select a resource group to manage the custom image based on the usage and permissions. Resource groups - Click OK.