All Products
Search
Document Center

Elastic Compute Service:Release a disk

Last Updated:Apr 15, 2024

If you no longer need a disk and want to stop billing for the disk, you can release the disk. After you release a disk, all data stored on the disk is also released and billing for the disk stops. This topic describes how to manually or automatically release a disk in the Elastic Compute Service (ECS) console.

Prerequisites

  • A snapshot is created for the disk that you want to release to back up data stored on the disk. For more information, see Create a snapshot for a disk.

  • The disk is in the Unattached state. If the disk is attached to an instance, you must detach the disk before you can release the disk. For information about how to detach a disk, see Detach a data disk.

Background information

You can manually release a disk or enable the Release Disk with Instance feature for the disk to automatically release the disk when the associated instance is released. The following table describes how to release different types of disks.

Disk type

Subscription

Pay-as-you-go

System disk

System disks can only be automatically released when the associated instances are released.

By default, the Release Disk with Instance feature is enabled for system disks. You can disable the feature for the disks.

Data disk

  • Subscription data disks can be manually released.

  • Subscription data disks can also be automatically released when the associated instances are released.

    By default, the Release Disk with Instance feature is enabled for subscription data disks. You can disable the feature for the disks.

  • Pay-as-you-go data disks can be manually released.

  • Pay-as-you-go data disks can also be automatically released when the associated instances are released.

    By default, the Release Disk with Instance feature is enabled for pay-as-you-go data disks that are created when instances are created. For pay-as-you-go data disks that are separately created from instances, you must manually enable the feature.

Note

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

Manually release a disk

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

  1. Log on to the ECS console.

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

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

  4. Find the disk that you want to release and choose 更多 > Release in the Actions column.

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

Automatically release a disk when the associated instance is released

You can enable or disable the Release Disk with Instance feature for disks when you create an instance or after the instance is created.

Impacts of release settings

  • Impacts on disks

    • When the Release Disk with Instance feature is enabled

      • System disk: The system disk of an instance is automatically released when the instance is released even if the disk was detached from the instance or is attached as a data disk to another instance.

      • Data disk: A data disk is automatically released when the associated instance is released. If the disk was detached from the instance and enters the Unattached state, the disk is not released when the instance is released.

    • When the Release Disk with Instance feature is disabled

      A subscription disk is retained as a pay-as-you-go disk three days after the associated instance expires, three days after a payment becomes overdue for the instance, or when the instance is automatically released due to expiration. If the disk is a system disk, the disk is detached and retained as a data disk when the associated instance is released.

      Note
      • If you create a disk in a region in the Chinese mainland, you must complete real-name verification for your account to ensure that the disk can be retained.

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

  • Impacts on snapshots

    • If you enable the Delete Automatic Snapshots While Releasing Disk feature for a disk, the automatic snapshots of the disk are deleted when the disk is released. You can disable the Delete Automatic Snapshots While Releasing Disk feature for a disk when you attach the disk to an instance. For more information, see the Enable or disable Delete Automatic Snapshots While Releasing Disk section of the "Modify an automatic snapshot policy" topic.

    • Manual snapshots are not released when the associated disks are released.

Procedure

Enable or disable the Release Disk with Instance feature for disks when you create an ECS instance

You can perform the following operations on the instance buy page in the ECS console to enable or disable the Release Disk with Instance feature for the system disk or data disks when you create an instance. For information about the parameters that are not described in this section, see Create an instance on the Custom Launch tab.

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Instances & Images > Instances.

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

  4. Click Create Instance.

  5. In the Storage section, select or clear Release with Instance for the system disk or data disks.

    image

Enable or disable the Release Disk with Instance feature for the disks of an instance after the instance is created

You can perform the following steps to enable or disable the Release Disk with Instance feature for the system disk or data disks of an instance after the instance is created:

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Instances & Images > Instances.

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

  4. Find the instance that you want to manage and click the instance ID.

  5. On the Instance Details page, click the Cloud Disk tab.

  6. Find the disk for which you want to enable or disable the Release Disk with Instance feature and choose 更多 > Modify Attributes in the Actions column.

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

References

You can call the DeleteDisk operation to release a disk. For more information, see DeleteDisk.