This topic describes how to share or unshare custom images. Shared images can be used to deploy Elastic Compute Service (ECS) instances across accounts. You can share your custom images to other Alibaba Cloud accounts. These Alibaba Cloud accounts can then use the shared images to create their own instances. You can also unshare shared custom images from other Alibaba Cloud accounts.

Prerequisites

Before you share a custom image, make sure that all sensitive data and files are removed from the image.

Background information

Images shared to an account do not count against the image quota for the account. The account does not incur charges for images shared to it.

When an account creates their own instances by using an image that you shared, you do not incur charges. Only the account that used the image to create instances is charged. For more information about the billing of shared images, see the "Image prices" section in Image overview.

The account can use the shared images but cannot delete the shared images. You must unshare a shared image before you can delete it. For more information, see Delete a custom image.

Before you share an image, take note of the following items:
  • You can share only the custom images that are created in your account. You cannot share custom images that are created and shared by other accounts.
  • Each custom image can be shared to up to 50 accounts.
  • You can share images between the accounts on the China (aliyun.com), International (alibabacloud.com), and Japan (jp.alibabacloud.com) sites. However, the custom images that are created based on Alibaba Cloud Marketplace images cannot be shared.
  • Custom images cannot be shared across regions. If you want to share a custom image across regions, you must copy the image to the destination region first. For more information, see Copy custom images.
  • ECS does not guarantee the integrity and security of shared images. Before you use shared images, make sure that the images come from trusted accounts. You must assume all risks.

Share a custom image

You can perform the following operations to share your custom image to an Alibaba Cloud account.

  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 Custom Image tab, find the custom image that you want to share and click Share Image in the Actions Column.
  5. In the Share Image dialog box, enter the ID of the account to which you want to share the image, and select the option under the Account field. Then, click Share Image.

    Images can be shared only to Alibaba Cloud accounts, not to RAM users. To obtain the ID of your Alibaba Cloud account, move the pointer over the profile picture in the upper-right corner of the Alibaba Cloud Management Console. If the account is identified as Main Account in the user information panel, the account ID is an Alibaba Cloud account ID.

    After you share a custom image with an account, the account can view the shared image in the ECS console by choosing Instances & Images > Images and then clicking the Shared Image tab in the same region as that you previously selected. The account can perform the following operations:

Unshare a custom image

You can perform the following operations to unshare your custom image from an Alibaba Cloud account.
Notice After you unshare a custom image from an account, the following results occur:
  • The account is no longer able to query the image by using the ECS console or by calling an API operation.
  • The account is no longer able to create ECS instances or replace system disks by using the image.
  • The system disks of ECS instances that were created from the shared image cannot be re-initialized.
  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 Custom Image tab, find the custom image that you want to unshare and click Share Image in the Actions column.
  5. In the Share Image dialog box, find the ID of the account from which you want to unshare the image and click Cancel Sharing in the Actions column.