All Products
Search
Document Center

Elastic Compute Service:Copy a custom image

Last Updated:Dec 02, 2024

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

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.

    1. Set the Copy Mode parameter to Copy and select a destination region. You can follow the steps described in this topic.

    2. Create an instance by using a custom image

    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.

    1. Set the Copy Mode parameter to Copy and select a destination region. You can follow the steps described in this topic.

    2. Share a custom image

    3. Create an instance by using a custom image

    Deploy ECS instances across accounts in the same region

    You can share an image to other Alibaba Cloud accounts. This way, the Alibaba Cloud accounts can use the image to deploy ECS instances.

    1. Share a custom image

    2. Create an instance by using a custom image

  • 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.

    Note

    After 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.

    1. 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.

    2. Create an instance by using a custom image

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 the actual snapshot storage capacity that you use. For more information, see Snapshots.

      Note

      Snapshots 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 data transfer. For information about the most recent 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.

    Note

    You can copy a snapshot faster than you can copy an image, and you can use snapshot copying to bypass capacity limits. To copy a large image across regions, such as an image larger than 2 TiB in size, 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

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Instances & Images > Images.

  3. In the top navigation bar, select the region and resource group to which the resource belongs. 地域

  4. On the Images page, click the Custom Images tab.

  5. Find the image that you want to copy and click Copy Image in the Actions column.

  6. In the Copy Image dialog box, configure the parameters based on the copy scenario.

    Copy scenarios

    Parameter

    Required

    Description

    Copy Mode

    Yes

    Select Copy.

    Destination Region

    Yes

    Select different regions from the region of the source image.

    Note

    If you use 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 facilitate management.

    Tag

    No

    Add tags to the image copy. You can use tags to classify images to facilitate search and batch operations.

    Note

    You 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.

    Note

    If 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 in which you want to create the image copy. The region can be the region of the source image or a different region.

    • Encryption Key: Select the service key of the destination region or a customer master key (CMK) that is created in KMS from the drop-down list. For more information about encryption keys, see the Encryption keys section of the "Encrypt cloud disks" topic.

    Note
    • If you use an Alibaba Cloud account to copy an image, you can select up to five destination regions.

    • If you select a CMK, make sure that the CMK meets the region and permission requirements. For more information, see the Limits section of the "Encrypt cloud disks" topic.

    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 facilitate management.

    Tag

    No

    Add tags to the image copy. You can use tags to classify images to facilitate search and batch operations.

    Note

    You 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.

  7. Make sure that the information is correct and click Confirm. The system copies the source image.

  8. You can view the results of the image copy task and manage the task in the image list in the destination region.

    Note

    If you use 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 image copy task. After the image is copied, the corresponding stack is deleted.

    1. 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.

    2. (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.