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 original 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 original 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 ECS 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 to 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 ECS 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 ECS instance by using a custom image
  • Copy and encryption scenarios
    Scenario Description Procedure
    Change the encryption state of a custom image
    • 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 original image or a different region.
    2. Create an ECS instance by using a custom image

Usage notes

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 original 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 original 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 a region.
  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 described in the following table.
    Parameter Required Description
    Copy Mode Yes Select Copy or Copy and Encrypt.
    • Select Copy to copy a custom image across regions when you want to deploy ECS instances or back up data across regions.
    • Select Copy and Encrypt to encrypt an image copy when you copy a custom image within a region or across regions. You can select this option to change the encryption states of custom images and back up data within a region or across regions.
      Note If you want to encrypt image copies, select Copy and Encrypt.
    Destination Region Yes When Copy Mode is set to Copy, select a different region from the region of the original image.
    Note If you are using an Alibaba Cloud account to copy an image, you can select up to five destination regions.
    Encryption Settings Yes When Copy Mode is set to Copy and Encrypt, select a destination region and an encryption key.
    • Destination Region: Select the region of the original image or a different one.
    • Encryption Key: Select Default Service Key or a custom key from the drop-down list.
      • Default Service CMK: the default key generated by KMS.
      • A custom key: a custom key that you created in KMS. For more information, see Create a CMK.
    Note
    • If you are using an Alibaba Cloud account to copy an image, you can select up to five destination regions.
    • The first time that you select an encryption key, click Go to Authorize and follow on-screen tips to attach AliyunECSDiskEncryptDefaultRole to allow ECS to access your KMS resources.
    Custom Image Name Yes In the Custom Image Name field, enter a name for the image copy to display in the destination region. Example: Image_m_bp1f_from_hangzhou.
    Description No In the Description field, enter an 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 original image. The image copy inherits the custom tags from the original image.
  7. Confirm the information and click OK. The system copies the original image.
  8. You can view the results of the 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 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: If the Progress has not reached 100% and the Status is Creating, you can cancel the copy task by clicking Cancel Copy.
      Creating

What to do next

You can use the image copy to create instances or replace the operating systems of instances as described in the following topics: