Set an automatic snapshot policy for a disk

更新时间:
复制 MD 格式

Binding multiple automatic snapshot policies to a single disk lets you meet various requirements, such as short-term, high-frequency backups and long-term retention.

Applicability

Ensure that the disk meets one of the following conditions:

  • The disk is attached to an ECS instance that is in the Running or Stopped state.

  • The disk is in the Unattached state and was previously attached to an ECS instance.

    You can check whether a disk has an attachment history by calling DescribeDisks and inspecting the AttachedTime field.

Procedure

Set an automatic snapshot policy for a disk

  1. Go to ECS console - Block Storage - Cloud Disks. In the top-left corner, select the region and resource group for the target resource.

  2. In the Actions column for the target disk, click Configure Snapshot Policy.

  3. On the Configure Automatic Snapshot Policy page, add or remove policies as needed. A single disk supports up to 10 automatic snapshot policies.

    • Add a policy: In the Configure Automatic Snapshot Policy drop-down list, select an existing policy, or click Create Policy and follow the on-screen instructions to complete the policy Created, and then click OK.

    • Remove a policy: In the Configure Automatic Snapshot Policy list, click the X icon next to the policy you want to remove, and then click OK.

      Important

      After you remove an automatic snapshot policy, snapshots are no longer created automatically based on that policy. Ensure that your data protection plan accounts for this change.

Bind disks to an automatic snapshot policy

  1. Go to the ECS console - Automatic Snapshot Policy page. In the top-left corner, select the target region and resource group.

  2. In the Actions column of the target policy, take the necessary actions.

    • Bind disk: Click Bind Disk. In the Optional Disks area, select the target disk, and then click Bind.

      Disks that are already bound to the current policy or have reached the limit of 10 policies cannot be selected.
    • Unbind a disk: Click Unbind Disk. In the Optional Disks section, select the target disk and click Unbind.

      Important

      After you unbind a disk from a policy, that policy no longer creates automatic snapshots for the disk. Ensure this change does not affect your data protection plan.

Billing

Creating an automatic snapshot policy is free of charge, but you are charged for tasks the policy successfully executes. To reduce snapshot storage costs, you can enable automatic snapshots to be deleted when their associated disks are released, periodically delete unused automatic snapshots, and archive snapshots.

  • Automatic snapshot creation tasks: All snapshots created by a policy are billed based on their size at the standard snapshot storage fee.

  • Cross-region replication tasks: If a policy has cross-region replication enabled, you are charged the standard snapshot fee in the source region, plus the snapshot replication traffic fee and the standard snapshot storage fee in the destination region.

Quotas and limits

  • You can bind a maximum of 10 automatic snapshot policies to a single disk.

  • A disk has a limit on the number of concurrent snapshot creation tasks, including both automatic and manual tasks. If a policy attempts to run while a disk is at its concurrent snapshot limit, the task is skipped and retried at the next scheduled time. The task limits for different disk categories are as follows:

    Disk type

    Task limit

    ESSD series (ESSD, ESSD AutoPL, ESSD Entry, and zone-redundant ESSD)

    10

    Previous-generation disks (standard SSD, ultra disk, and basic disk)

    1

  • If cross-region replication is enabled in a policy, the system skips a task if another cross-region replication task is already running for the same disk between the same source and destination regions. The skipped task is retried at the next scheduled time.

  • For the maximum number of automatic snapshots supported per disk, see Snapshot limits. When the number of automatic snapshots reaches the quota, the system deletes the earliest automatic snapshot created by the policy. Plan your snapshot retention periods based on your business needs to prevent the system from unexpectedly deleting important snapshots.

More operations

Delete snapshots on disk release

By default, an automatic snapshot's lifecycle is determined by its policy's retention period; releasing the associated disk does not affect the snapshot. You can enable the Delete Automatic Snapshots While Releasing Disk property to change this behavior.

Important

When the Delete Automatic Snapshots While Releasing Disk property is enabled, all automatic snapshots of the disk are deleted immediately when the disk is released, regardless of whether the disk is released manually, with an instance, or during an OS replacement. This occurs even if the snapshot retention period has not expired.

  1. Go to ECS console - Block Storage - Cloud Disks. In the top-left corner, select the region and resource group for the target resource.

  2. In the Actions column for the target disk, click Edit Attributes.

  3. In the Modify Disk Property dialog box, select the Delete Automatic Snapshots While Releasing Disk checkbox.

    You can clear this checkbox later to disable the Delete Automatic Snapshots While Releasing Disk feature.
  4. Click OK.

View automatic snapshots

When a policy runs, it automatically creates snapshots. You can find them on the ECS console - Snapshots page.

Automatic snapshots use the naming format auto2.0_yyyyMMdd_SnapshotPolicyId, and their Snapshot Type is Automatic Snapshot. The components of the name are as follows:

  • auto2.0: Indicates an automatic snapshot.

    See What are the differences between manual and automatic snapshots? for the differences between manual and automatic snapshots.
  • yyyyMMdd: The date on which the snapshot is created, where yyyy is the year, MM is the month, and dd is the day.

  • SnapshotPolicyId: The ID of the automatic snapshot policy that created the snapshot.

For example, auto2.0_20241225_sp-2zeff8vy17u91rn5**** indicates an automatic snapshot that was created on December 25, 2024, by the automatic snapshot policy with the ID sp-2zeff8vy17u91rn5****.image