All Products
Search
Document Center

Elastic Compute Service:Share a snapshot

Last Updated:Jul 15, 2026

Share snapshots with other Alibaba Cloud accounts or a resource directory for cross-account disk creation and batch deployment.

Important

Before sharing, verify that the snapshot contains no sensitive data. Recipients get full read access to all snapshot data.

How it works

Snapshot sharing uses Resource Sharing from Resource Management. The workflow has three stages:

  1. The sharer adds the snapshot to a resource share and specifies recipients.

  2. The recipient accepts the sharing invitation.

  3. The recipient creates cloud disks from or copies the shared snapshot.

Sharing methods

Choose a method based on your scenario:

Method

Scope

Best for

Share with specific accounts

Any Alibaba Cloud account

Cross-department sharing, partner collaboration

Share within a resource directory

Accounts in a resource directory

Enterprise-wide sharing, automatic access for new members

When you share within a resource directory, all accounts in the directory or folder get access automatically. New accounts inherit access; removed accounts lose access.

Prerequisites

Ensure that you have:

  • A snapshot with no sensitive data

  • The target information ready:

    • To share with a specific account: The recipient's Alibaba Cloud account ID. Hover over the profile picture in the upper-right corner of the console. If the account type is Alibaba Cloud Account, the displayed ID is the Alibaba Cloud account ID.

    • To share within a resource directory: An Alibaba Cloud account that meets one of these conditions:

  • (For encrypted snapshots using a CMK) The AliyunECSShareEncryptSnapshotDefaultRole RAM role created with required permissions. See Share encrypted resources across accounts.

Share a snapshot

Console

  1. Open the ECS console - Snapshots page.

  2. In the top navigation bar, select the region and resource group. 地域

  3. On the Disk Snapshots tab, find the snapshot and choose More icon > Share Snapshot in the Actions column.

  4. In the Add to Resource Share dialog box, set Method to Existing Resource Share or New Resource Share:

    Note

    Snapshot sharing uses Resource Sharing from Resource Management. A resource share groups resources and principals together.

    Add to Resource Share dialog

  5. (For New Resource Share only) Set the Principal Scope:

    • All Accounts: Share with any Alibaba Cloud account.

    • Objects Within Resource Directory: Share only within your resource directory. The management account or members can share with the directory, its folders, and its members.

  6. Click Add Principals and configure the recipients. Share with a specific Alibaba Cloud account: Set Principal Type to Alibaba Cloud Account and enter the recipient's Alibaba Cloud account ID in Principal ID. Share within a resource directory:

    • If the sharer has not enabled the resource directory feature but belongs to one: Set Principal Type to Resource Directory or Folder (Organizational Unit). For folders, enter the folder ID.

      After you select Resource Directory, the Resource Directory ID automatically shows the current directory ID. Note: The resource is shared with the entire organization, including all folders and member accounts. Click OK to complete.

    • If the sharer has enabled the resource directory feature: Select the target directory or folder from the list, or add them manually.

    Note

    - If Principal Scope is Objects Within Resource Directory, only accounts within the directory are available. - To share with multiple accounts, add each one separately.

    Note

    - You can also share snapshots from the Resource Management console. See Manage shared resources as a resource owner. - When you share with an entire resource directory or folder, all accounts in it can access the snapshot. New accounts automatically receive access. Removed accounts automatically lose access.

  7. Click OK.

API

A Java SDK sample project demonstrates cross-account snapshot sharing and disk creation from a shared snapshot.

  1. Download the snapshot sharing sample project. It includes three code samples:

    Sample

    Description

    CreateResourceShare

    The sharer creates a resource share and initiates snapshot sharing

    ReceiveResourceShare

    The recipient accepts the sharing invitation

    UseResourceShare

    The recipient creates a cloud disk from the shared snapshot

  2. Configure SDK dependencies in pom.xml. See Java SDK call examples.

    Note

    SDK packages are updated frequently. Get the latest version from the GitHub links in SDK overview.

       <!--Resource Sharing SDK-->
       <dependency>
         <groupId>com.aliyun</groupId>
         <artifactId>resourcesharing20200110</artifactId>
         <version>${lastVersion}</version>
       </dependency>
       <!--ECS SDK-->
       <dependency>
         <groupId>com.aliyun</groupId>
         <artifactId>alibabacloud-ecs20140526</artifactId>
         <version>${lastVersion}</version>
       </dependency>
  3. Set the ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET environment variables to your AccessKey ID and AccessKey secret.

  4. Replace placeholder variables with your actual values, such as the snapshot ID, recipient's account UID, and disk type.

  5. Compile and run each sample as needed.

  6. Verify the results. The sharer can check the Resource Management console for the new resource share, and the recipient can check the ECS console for the shared snapshot and created disk.

Accept and use a shared snapshot

After the sharer completes sharing, the recipient must accept the invitation before using the snapshot.

Accept the sharing invitation

Required the first time a new or existing resource share is used.

  1. Open the Resource Management console.

  2. In the left-side navigation pane, choose Resource Sharing > Resources Shared To Me.

  3. In the top navigation bar, select the region of the shared snapshot.

  4. On the Shared To Me page, find the resource share and click Accept in the Status column.

  5. In the Accept Resource Sharing Invitation dialog box, click OK.

After you accept, new resources added to this resource share are accepted by default.

View the shared snapshot

  1. Open the ECS console - Snapshots page.

  2. In the top navigation bar, select the region of the shared snapshot.

  3. Find the shared snapshot. Identify it by the following indicators, or choose More icon > View Shared Snapshot in the Actions column to view details in the Resource Management console:

    • Hover over the info icon icon to view a tag in the format acs:ecs:sharedFrom:<UID of the sharer>:<Region>:<Source snapshot ID>.

    • The Creation Method column showing Shared Snapshot.

    • Hover over the details icon icon to view the sharer's account UID and source snapshot ID.

Use the shared snapshot

Create a data disk from the shared snapshot or copy it.

Note

For encrypted shared snapshots, change the encryption key when creating a disk or copying the snapshot.

Note

Disks created from a shared encrypted snapshot are limited to ESSD, ESSD AutoPL, and ESSD Entry. To create other disk types, copy the snapshot first and create a disk from the copy.

Unshare a snapshot

When a snapshot is unshared, recipients can no longer query it through the ECS console or API, or re-initialize disks created from it. Previously copied snapshots are not affected.

  1. Open the ECS console - Snapshots page.

  2. In the top navigation bar, select the region and resource group. 地域

  3. On the Disk Snapshots tab, find the snapshot. Choose More icon > Share Snapshot in the Actions column.

  4. In the Principals section, click Modify.

  5. In the Principals section, click Remove in the Actions column for the recipient to remove.

    Remove principal

  6. Click OK.

Limitations

Billing

  • Sharing a snapshot is free.

  • Recipients are charged for resources created from a shared snapshot, such as cloud disks or cross-region snapshot copies.

  • A shared snapshot that expires but remains shared is not automatically released and continues to incur storage charges.

Quotas

Resource

Limit

Maximum accounts per shared snapshot

64

Maximum snapshots shared per account

1,024

Account restrictions

Cross-site sharing (between China site and international site accounts) is not supported.

Sharer restrictions

  • Cannot delete a shared snapshot. Unshare it first.

  • Cannot share snapshots created from imported custom images.

  • Cannot share snapshots encrypted with a service key. To share such a snapshot, copy the snapshot to change the encryption to a CMK, then share the copy. See Disk encryption.

Recipient restrictions

  • Cannot create custom images from shared snapshots.

  • Cannot roll back disks using shared snapshots because the shared snapshot ID differs from the source snapshot ID.

  • Cannot delete shared snapshots. The sharer must unshare them first.

  • Cannot archive shared snapshots.

  • Cannot re-share shared snapshots. Workarounds:

    • Create a disk from the shared snapshot, create a new snapshot from that disk, and share the new snapshot.

    • Copy the shared snapshot and share the copy.

  • Cannot extend the retention period of a shared snapshot.

    • If the original has permanent retention, the shared copy retains for 1,096 days.

    • If the original has a custom retention period, the shared copy follows the same period.