A shared image is a custom image from another Alibaba Cloud account. This topic describes how to use a shared image to create ECS instances, copy the image, and replace the operating system of an instance.
Usage notes
Alibaba Cloud does not guarantee the integrity or security of shared images. Only use images from accounts you trust, and use them at your own risk.
Before using a shared image, consider the following points:
|
Item |
Description |
|
Sharing fees |
For more information about image billing, see Image billing. |
|
Usage limits |
|
|
Policy |
|
Create an ECS instance from a shared image
ECS console
You can use a shared image to quickly create one or more ECS instances with an identical environment.
-
Go to ECS console - Images.
In the top navigation bar, select the region and resource group of the resource that you want to manage.
-
On the Shared Images tab, find the shared image that you want to use and click Create Instance in the Actions column.

-
The region and image are pre-filled. Configure other parameters, such as the billing method and instance type, to create the instance.
For more information about the parameters, see Create an instance by using the wizard.
If you use an encrypted shared image to create an ECS instance, any disks created from the image's encrypted snapshots are also automatically encrypted. These disks cannot be decrypted. You must specify a service key or your customer master key (CMK) as the encryption key for these disks.

API
-
Call the DescribeImages operation to query the
ImageIdof the shared image that you can use. -
Call the RunInstances or CreateInstance operation. Set the
ImageIdparameter to theImageIdof the shared image to create an ECS instance from the shared image.ImportantIf you use an encrypted image, you must set the Encrypted parameter to true. Otherwise, instance creation may fail.
Replace the operating system with a shared image
ECS console
You can use a shared image to replace the system disk of an existing ECS instance. This process replaces the instance's system disk with one based on the shared image.
In the Replace System Disk dialog box, click the Shared Images tab in the Image section and select the shared image you want. For more information, see Replace the operating system (system disk).
API
-
Call the DescribeImages operation to query the
ImageIdof the shared image that you can use. -
Call the ReplaceSystemDisk operation. Set the
ImageIdparameter to theImageIdof the shared image to replace the operating system (system disk).ImportantIf you use an encrypted image, you must set the Encrypted parameter to true to encrypt the new system disk with your own key. Otherwise, the operation may fail.
Copy a shared image
ECS console
Shared images are read-only. To update or delete a shared image, you must first copy it to your account within the same region. The copy appears as a custom image in your account that you can manage.
-
On the Shared Images tab, find the shared image that you want to copy and click Copy Image in the Actions column.

-
In the Copy Image dialog box, configure the parameters as prompted.
-
You can perform a standard copy or an encrypted copy.
-
You can select only the current region.
NoteShared images can be copied only within the same region. To use a shared image in a different region, first copy it within its original region to create a custom image. Then, copy that custom image to the target region.
For more information about the parameters, see Copy a custom image.
-
-
(Optional) Click the Custom Images tab to view the copied image.
API
-
Call the DescribeImages operation to query the
ImageIdof the shared image that you can use. -
Call the CopyImage operation. Set the
ImageIdparameter to theImageIdof the shared image to copy the shared image as a custom image that you can manage.ImportantIf you copy an encrypted shared image, you must set the Encrypted parameter to true to encrypt the copied image with your own key. Otherwise, the copy operation may fail.
Related documents
-
You can use a shared image to deploy an ECS instance across accounts in the same region. For more information, see Share a custom image.
-
If you no longer need to share a custom image with other Alibaba Cloud accounts, you can unshare the image. For more information, see Unshare a custom image.
-
For information about the permissions required to share encrypted images, see Permissions on encrypted images.