You can copy images to deploy Elastic Compute Service (ECS) instances across regions or change the encryption status of encrypted and unencrypted images in the same region or across regions. After you copy an image (source image) to a destination region, an image copy that has a different ID is generated in the region. The image copy has the configurations, such as the resource groups, tags, and encryption attributes, that you specified when you copied the source image. This topic describes how to copy an encrypted or unencrypted custom image.
Prerequisites
A custom image is created. For more information, see Create a custom image from a snapshot or Create a custom image from an instance.
Key Management Service (KMS) is activated if you want to copy an image to create an encrypted image copy. For more information, see the Activate KMS section in the "Overview" topic.
Background information
Use scenarios
Copy scenarios
Scenario
Description
Procedure
Deploy ECS instances across regions in the same account
After you copy an image to a destination region, you can obtain the image copy that has a different ID in the region. Configurations such as tags, resource groups, and encryption attributes of the image copy are defined when you copy the source image. Then, you can use the image copy to deploy ECS instances.
Set the Copy Mode parameter to Copy and select a destination region. You can follow the steps described in this topic.
Deploy ECS instances across regions and accounts
After you copy an image to a destination region, you can share the image copy with other Alibaba Cloud accounts. Then, the accounts can use the image copy to deploy ECS instances.
Set the Copy Mode parameter to Copy and select a destination region. You can follow the steps described in this topic.
Deploy ECS instances across accounts in the same region
You can share an image to other Alibaba Cloud accounts. Then, the accounts can use the image to deploy ECS instances.
Copy and encryption scenarios
Scenario
Description
Procedure
Change the encryption status of a custom image, which requires a longer period of time than copying a custom image without changing the encryption status of the image
Copy an encrypted image to create an encrypted image that has a different encryption key
Copy an unencrypted image to create an encrypted image
After you copy an image in a region or across regions, you can use the encrypted image copy to deploy ECS instances.
NoteAfter a custom image is encrypted, the system and data disks of an ECS instance that is created from the image are automatically encrypted. The system and data disks use the same encryption key as the custom image.
Set the Copy Mode parameter to Copy and Encrypt, select a destination region, and then select an encryption key. The destination region can be the region of the source image or a different region.
Considerations
Before you copy an image, take note of the following items:
Fees for image replication
Snapshot fees: When you copy an image to a region, a corresponding snapshot is automatically created in the region and consumes snapshot storage capacity. You are charged for the amount of snapshot storage capacity that you actually use. For more information, see Snapshots.
NoteSnapshots created for image copies are retained indefinitely regardless of the retention period of the snapshots of the source images.
Fees for cross-region data transfer: Alibaba Cloud does not charge you for cross-region traffic. For information about the latest billing details, see the official Alibaba Cloud website for announcements.
Replication duration
The amount of time that is required to copy an image varies based on the size of the image, the network transmission speed, and the number of concurrent tasks in the queue.
NoteYou can copy a snapshot faster than an image and you can use snapshot copying to bypass capacity limits. To copy a large image such as an image larger than 2 TiB in size across regions, you can first copy the snapshots of the image to the destination region, and then create an image from the snapshots in the destination region. For more information, see Copy a snapshot and Create a custom image from a snapshot.
Procedure
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 Images page, click the Custom Images tab.
Find the image that you want to copy and click Copy Image in the Actions column.
In the Copy Image dialog box, configure the parameters based on your copy scenarios.
Copy scenarios
Parameter
Required
Description
Copy Mode
Yes
Select Copy.
Destination Region
Yes
Select different regions from the region of the source image.
NoteIf you are using an Alibaba Cloud account to copy an image, you can select up to five destination regions.
Custom Image Name
Yes
Enter a name for the image copy to display in the destination region. Example: Image_m_bp1f_from_hangzhou.
Description
No
Enter a description for the image copy to display in the destination region.
Resource Group
No
Specify the resource group to which you want to add the image copy to simplify management.
Tag
No
Add tags to the image copy. You can use tags to classify images to facilitate search and batch operations.
NoteYou can only add tags to the image copy. You cannot modify the custom tags of the source image. The image copy inherits the custom tags of the source image.
Copy and encryption scenarios
Parameter
Required
Description
Copy Mode
Yes
Select Copy and Encrypt.
NoteIf you want to encrypt image copies, you must select Copy and Encrypt.
Encryption Settings
Yes
Select destination regions and encryption keys.
Destination Region: Select the region where you want to create the image copy. The region can be the region of the source image or a different region.
Encryption Key: Select Default Service CMK or a custom customer master key (CMK) from the drop-down list.
Default Service CMK: the default key generated by KMS.
Custom CMK: a key that you created in KMS by using the bring your own key (BYOK) feature. For more information, see Create a CMK.
NoteIf you are using an Alibaba Cloud account to copy an image, you can select up to five destination regions.
The first time you select an encryption key, click Go to Authorize and follow the on-screen instructions to attach the
AliyunECSDiskEncryptDefaultRole
role to ECS to allow ECS to access your KMS resources.
Custom Image Name
Yes
Enter a name for the image copy to display in the destination region. Example: Image_m_bp1f_from_hangzhou.
Description
No
Enter a description for the image copy to display in the destination region.
Resource Group
No
Specify the resource group to which you want to add the image copy to simplify management.
Tag
No
Add tags to the image copy. You can use tags to classify images to facilitate search and batch operations.
NoteYou can only add tags to the image copy. You cannot modify the custom tags of the source image. The image copy inherits the custom tags of the source image.
Make sure that the information is correct and click Confirm. The system copies the source image.
You can view the results of the image copy task and manage the task in the image list in the destination region.
NoteIf you are using an Alibaba Cloud account, a message indicating that the image copy task is submitted appears in the upper-right corner of the page. You can go to the Resource Orchestration Service (ROS) console to check the progress of the task. After the image is copied, the corresponding stack is deleted.
In the upper-left corner of the top navigation bar, select the destination region from the drop-down list and view the copy progress of the custom image.
When the image copy task is completed, the progress reaches 100% and the image enters the Available state. The image copy is generated in the destination region and has a unique image ID.
(Optional) When Creating is displayed in the Status column of the image copy, you can click Cancel Copying in the Actions column to cancel the image copy task.