All Products
Search
Document Center

Elastic Compute Service:Release a cloud disk

Last Updated:Sep 03, 2024

If you no longer use a cloud disk and you want billing for the disk to stop, you can release the disk. After you release a cloud disk, the disk and the data that is stored on the disk are deleted, and billing for the disk stops. This topic describes how to manually release a cloud disk and configure a cloud disk to be automatically released when the Elastic Compute Service (ECS) instance to which the disk is attached is released.

Methods for releasing cloud disks

You can manually release cloud disks. Alternatively, you can enable the Release Disk with Instance feature for cloud disks. This way, the cloud disks are automatically released when the ECS instances to which the disks are attached are released.

  • System disks:

    • System disks can only be automatically released when the ECS instances to which the disks are attached are released.

    • The Release Disk with Instance feature is automatically enabled for system disks when you create the disks. You can disable the Release Disk with Instance feature for system disks at any time.

  • Data disks:

    • You can manually release data disks or enable the Release Disk with Instance feature for data disks.

    • When you separately create pay-as-you-go data disks, the Release Disk with Instance feature is automatically disabled for the disks. In other scenarios, the Release Disk with Instance feature is automatically enabled for data disks. You can disable the Release Disk with Instance feature for data disks at any time.

Prerequisites

  • When a cloud disk is released, the data that is stored on the disk is deleted. Before you release a cloud disk, we recommend that you create snapshots to back up disk data. For more information, see Create a snapshot.

  • The cloud disk that you want to manually release is in the Unattached state.

  • Check whether the Delete Automatic Snapshots While Releasing Disk feature is enabled for the cloud disk that you want to release. If the Delete Automatic Snapshots While Releasing Disk feature is enabled for the cloud disk, the automatic snapshots of the disk are deleted when the disk is released. For information about how to enable the Delete Automatic Snapshots While Releasing Disk feature, see the Enable or disable Delete Automatic Snapshots While Releasing Disk section of the "Modify an automatic snapshot policy" topic.

    Note

    The manual snapshots of the cloud disks for which the Delete Automatic Snapshots While Releasing Disk feature is enabled are not affected when the disks are released.

  • The multi-attach feature is disabled for a cloud disk if you want to enable the Release Disk with Instance feature for the disk.

    Note

    You cannot enable the Release Disk with Instance feature for cloud disks for which the multi-attach feature is enabled. For more information, see Multi-attach for cloud disks.

Manually release a cloud disk

You can perform the following steps to manually release a data disk on the Block Storage (Disks) page in the ECS console:

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Storage & Snapshots > Block Storage (Disks) .

  3. In the top navigation bar, select the region and resource group to which the resource belongs. 地域

  4. Find the cloud disk that you want to release. In the Actions column, choose 更多 > Release.

  5. In the Release Cloud Disk dialog box, confirm the information about the associated snapshots, select I am aware of the disks and associated resources to be released and understand the related data risks, and then click Confirm.

Enable the Release Disk with Instance feature

You can enable or disable the Release Disk with Instance feature for existing cloud disks.

Note

You can also enable or disable the Release Disk with Instance feature for system disks or data disks based on your business requirements when you create ECS instances or cloud disks.

Impacts of release settings

Disk type

Enable the Release Disk with Instance feature

Disable the Release Disk with Instance feature

System disk

If you enable the Release Disk with Instance feature for the system disk of an ECS instance, the system disk is automatically released when the ECS instance is released, regardless of when the disk is detached from the ECS instance or is attached as a data disk to a different ECS instance.

If you disable the Release Disk with Instance feature for the system disk of an ECS instance, the disk is detached from the ECS instance and retained as a data disk when the instance is released.

Data disk

If you enable the Release Disk with Instance feature for a data disk of an ECS instance, the disk is automatically released when the instance is released.

Note

If the data disk is detached from the ECS instance and enters the Unattached state, the disk is not released when the instance is released.

  • Subscription disk: If you disable the Release Disk with Instance feature for a subscription disk attached to an ECS instance, the disk is retained as a pay-as-you-go disk three days after the instance expires, three days after a payment for the instance becomes overdue, or when the instance is released after expiration.

  • Pay-as-you-go disk: If you disable the Release Disk with Instance feature for a pay-as-you-go disk attached to an ECS instance, the disk is retained when the instance is released.

Note
  • If you have cloud disks that reside in a region inside the Chinese mainland, you must complete real-name verification for your account to ensure that the disks can be retained.

  • You are charged for retained cloud disks based on the pay-as-you-go billing method. You can log on to the Expenses and Costs console and view the consumption details by disk ID.

Procedure

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Storage & Snapshots > Block Storage (Disks) .

  3. In the top navigation bar, select the region and resource group to which the resource belongs. 地域

  4. Find the cloud disk that you want to release. In the Actions column, choose 更多 > Modify Attributes.

  5. In the Modify Disk Properties dialog box, select or clear Release Disk with Instance and click Confirm.

References

You can call the following API operations:

  • DeleteDisk: releases a pay-as-you-go data disk.

  • ModifyDiskAttribute: modifies the attributes of cloud disks, including enabling or disabling the Release Disk with Instance feature.