All Products
Search
Document Center

Elastic Compute Service:Copy a custom image

Last Updated:Feb 01, 2024

You can copy images to deploy Elastic Compute Service (ECS) instances across regions or change the encryption states of encrypted and unencrypted images within the same region or across regions. After an image is copied to a destination region, you can obtain the image copy with a different ID in the region. The configurations such as tags, resource groups, and encryption attributes of the image copy are defined when you copy 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 within the same account

    After an image is copied to a destination region, you can obtain the image copy with 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 Copy Mode 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 an image is copied 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 Copy Mode to Copy and select a destination region. You can follow the steps described in this topic.

    2. Share an image

    3. Create an instance by using a custom image

    Deploy ECS instances across accounts within the same region

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

    1. Share an 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 takes a longer period of time than copying without encryption

    • Copy an encrypted image to create an encrypted image with a different encryption key

    • Copy an unencrypted image to create an encrypted image

    After you copy an image within 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 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 Copy Mode 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:

  • Replication fees

    • Snapshot fees: When you copy an image to a region, a corresponding snapshot is automatically created in that 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.

      Note

      Snapshots created for image copies are retained indefinitely regardless of how long the snapshots of source images are retained.

    • 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 it takes to copy an image depends on the size of the image, the network transmission speed, and the number of concurrent tasks in the queue.

    Note

    It is much faster to copy a snapshot than an image, and snapshot copying can be used to bypass capacity constraints. To copy a large image such as an image larger than 2 TiB in size across regions, you can first copy the associated snapshots to the destination region and then create an image from these snapshots in the destination region. For more information, see Copy a snapshot and Create a custom image from a snapshot.

  • Image copy configurations

    Image copies do not inherit feature configurations from the source images such as authorized roles, authorized services, and instance user data. Grant permissions to image copies based on your needs.

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

    Note

    If 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 a resource group for the image copy to simplify management.

    Tag

    No

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

    Note

    You can only add tags to the image copy and cannot modify the custom tags of the source image. The image copy inherits the custom tags from 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 where the image copy is created. The region can be the region of the source image or a different region.

    • Encryption Key: Select Default Service Key or a custom key from the drop-down list.

      • Default Service CMK: the default key generated by KMS.

      • Custom customer master key (CMK): a key that you created in Key Management Service (KMS) by using the bring your own key (BYOK) feature. For more information, see Manage a key.

    Note
    • If 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 on-screen tips to attach the AliyunECSDiskEncryptDefaultRole role 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 a resource group for the image copy to simplify management.

    Tag

    No

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

    Note

    You can only add tags to the image copy and cannot modify the custom tags of the source image. The image copy inherits the custom tags from 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 are using an Alibaba Cloud account, a message that indicates 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.

    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.