Updated on 2025-07-25 GMT+08:00

Recycle Bin Overview

What Is Recycle Bin?

Recycle bin is a resource recovery feature that enables you to restore ECSs that have been deleted. When using recycle bin, if you delete pay-per-use ECSs or unsubscribe from unexpired yearly/monthly ECSs, they are retained in the recycle bin for a time period that you specify before being permanently deleted. This can help protect your ECSs from accidental deletions.

Constraints

  • If an IAM user wants to use recycle bin, the user must have the following permissions:
    • ecs:recycleBin:get: Query the recycle bin.
    • ecs:recycleBin:update: Update (enable or disable) the recycle bin.
    • ecs:recycleBin:updatePolicy: Update the recycle bin policy.

    You can assign these permissions to the IAM user by referring to ECS Custom Policies.

  • A deleted or unsubscribed ECS cannot be moved to the recycle bin if:
    • Your account is in arrears, restricted, or frozen.
    • The ECS is faulty.
    • The number of days that has passed since the ECS was created is less than that specified in the recycle bin policy.
    • The ECS is in the retention period.
    • The ECS was deleted after the ECS retention period ends.
    • A scheduled deletion time has been set for the ECS.
    • The ECS is a spot ECS.
  • Quota considerations:
    • ECSs in the recycle bin still occupy the ECS resource quotas.
    • If ECSs deployed on a DeH are moved to the recycle bin, they still occupy the DeH resource quotas.

    If ECS quotas are insufficient, delete the ECSs from the recycle bin in a timely manner.

  • When ECSs are used as compute resources for gPaaS & AI DaaS services, the ECSs that meet the recycle bin policy will be moved to the recycle bin. This may lead to the failure of clearing resources of gPaaS & AI DaaS services. In this case, you need to delete the ECSs from the recycle bin first.

Pricing

  • After ECSs are moved to the recycle bin, they will be stopped and billed on a pay-per-use basis based on the billing rules in Table 1. (For more details, see Billing Mode Overview.)
    Table 1 Billing for a stopped ECS

    Instance Type

    Description

    Billing Item

    Billed or Not

    Action on Resources

    Common instances

    Common instances include:
    • Non-bare-metal instance
    • Instances without local disks
    • Instances without FPGA cards

    ECS (compute resources including vCPUs and memory)

    No

    • If ECSs are created from public resource pools, basic resources (vCPUs and memory) are no longer retained.

      The ECS may fail to be started due to insufficient resources. Wait patiently and try again later.

    • If ECSs are created on a DeH or in an edge AZ, basic resources (vCPUs and memory) will be retained.

    Image

    No

    Resources are retained but are not billed.

    GPU

    No

    After GPU-accelerated ECSs without local disks attached are stopped, GPU resources are no longer retained.

    EVS disks (system and data disks)

    Yes

    The resources are still billed based on the billing rules.

    EIP bandwidth

    Yes

    The resources are still billed based on the billing rules.

    • EIP bandwidth price: pay-per-use EIPs (by bandwidth)
    • Shared bandwidth price

    For details, see EIP Billing.

    Special instances

    Special instances include:
    • Bare metal instances
    • Instances with local disks

      such as disk-intensive, ultra-high I/O ECSs.

    • ECSs with FPGA cards

    ECS (compute resources including vCPUs and memory)

    Yes

    The ECS resources are still billed based on the billing rules.

    To stop the billing, you need to delete the instance and its associated resources.

    Image

    Yes

    GPU

    Yes

    EVS disks (system and data disks)

    Yes

    EIP bandwidth

    Yes

  • If your account is in arrears, the ECSs kept in the recycle bin will enter a grace period and then a retention period. These ECSs may not be kept as long as the duration you specify in the recycle bin policy and may be deleted earlier.
  • ECSs recovered from the recycle bin are billed on a pay-per-use basis. If you want to change the billing mode to yearly/monthly, see From Pay-per-Use to Yearly/Monthly.

Recycling Process

Figure 1 shows the process of recycling ECSs.

Figure 1 ECS recycling process

Recycle Bin Policy Configuration Suggestions

When using ECS recycle bin, you need to configure a recycle bin policy. For details, see Configuring a Recycle Bin Policy.

A recycle bin policy includes:

  • The minimum number of days that must have passed after an ECS was created (the minimum ECS age) before it can be moved to the recycle bin upon deletion or unsubscription
  • A duration that deleted or unsubscribed ECSs can be kept in the recycle bin

    This rule only applies to the ECSs that are moved to the recycle bin after the rule is set.

Both ECS and EVS support recycle bins. Their recycle bin policies are configured separately. If you enable recycle bin for both ECS and EVS, you are advised to configure the same minimum number of days for moving ECSs and EVS disks to the recycle bin upon deletion to avoid issues caused by different lifecycles.

In special cases, you may need to configure different recycle bin policies for ECS and EVS. For details, see Table 2.

Assume that an ECS (including system and data disks) was created 8 days ago. If you delete or unsubscribe from the ECS, the resources would be handled as follows.

Table 2 Scenarios and rules for recycling resources

Scenario

Recycling Rule

ECS

EVS Disk

The minimum ECS age for moving to the recycle bin is less than that of EVS disks, for example:

  • Minimum ECS age for moving to the recycle bin: 7 days
  • Minimum EVS disk age for moving to the recycle bin: 15 days

Both ECSs and EVS disks comply with the ECS recycle bin policy.

Moved to the recycle bin

Moved to the recycle bin

The minimum ECS age for moving to the recycle bin is greater than that of EVS disks, for example:

  • Minimum ECS age for moving to the recycle bin: 15 days
  • Minimum EVS disk age for moving to the recycle bin: 7 days

ECSs comply with the ECS recycle bin policy.

EVS disks comply with the EVS recycle bin policy.

Deleted or unsubscribed

Moved to the recycle bin

Associated Resource Recycling

After an ECS is moved to the recycle bin, its associated resources are handled as follows:

  • Table 3 describes how EIPs bound to ECSs are handled.
    Table 3 Handling of bound EIPs

    ECS Billing Mode

    Operation

    Moved to the Recycle Bin

    After ECS Is Recovered

    After ECS Is Permanently Deleted

    Pay-per-use

    Select Release the EIPs bound to the ECSs when deleting an ECS.

    No

    The EIP has been deleted and cannot be recovered.

    The EIP has already been deleted.

    Deselect Release the EIPs bound to the ECSs when deleting an ECS.

    No

    The EIP has been unbound from the ECS and will not be recovered.

    The EIP has been unbound from the ECS and will not be deleted.

    Yearly/Monthly

    Unsubscribe from the EIP when unsubscribing from an ECS.

    No

    The EIP has been deleted and cannot be recovered.

    The EIP has already been deleted.

    Do not unsubscribe from the EIP when unsubscribing from an ECS.

    No

    The EIP has been unbound from the ECS and will not be recovered.

    The EIP has been unbound from the ECS and will not be deleted.

  • Table 4 describes how EVS disks attached to ECSs are handled.
    Table 4 Handling of attached EVS disks

    ECS Billing Mode

    Disk Type

    Operation

    Moved to the Recycle Bin

    After ECS Is Recovered

    After ECS Is Permanently Deleted

    Pay-per-use

    System disk

    Select Delete all data disks attached to the ECSs when deleting an ECS.

    Yes

    The disk will also be recovered.

    The disk will also be permanently deleted.

    Deselect Delete all data disks attached to the ECSs when deleting an ECS.

    Yes

    The disk will also be recovered.

    The disk will also be permanently deleted.

    Exclusive data disk

    Select Delete all data disks attached to the ECSs when deleting an ECS.

    Yes

    The disk will also be recovered.

    The disk will also be permanently deleted.

    Deselect Delete all data disks attached to the ECSs when deleting an ECS.

    No

    The disk will still be attached to the ECS, unless it is manually detached.

    The disk has been detached from the ECS and will not be deleted.

    Shared data disk

    Select Delete all data disks attached to the ECSs when deleting an ECS.

    No (when the shared disk is attached to multiple ECSs)

    The disk will still be attached to the ECS, unless it is manually detached.

    The disk has been detached from the ECS and will not be deleted.

    Yes (when the shared disk is attached to only one ECS)

    The disk will also be recovered.

    The disk will also be permanently deleted.

    Deselect Delete all data disks attached to the ECSs when deleting an ECS.

    No

    The disk will still be attached to the ECS, unless it is manually detached.

    The disk has been detached from the ECS and will not be deleted.

    Yearly/Monthly

    System disk

    Unsubscribe from an ECS.

    Yes

    The disk will also be recovered.

    The disk will also be permanently deleted.

    Exclusive data disk

    Unsubscribe from an ECS with an exclusive data disk attached in the same order.

    Yes

    The disk will also be recovered.

    The disk will also be permanently deleted.

    Unsubscribe from an ECS with an exclusive data disk attached in another order.

    No

    The disk will still be attached to the ECS, unless it is manually detached.

    The disk has been detached from the ECS and will not be deleted.

    Shared data disk

    Unsubscribe from an ECS with a shared data disk attached.

    No

    The disk will still be attached to the ECS, unless it is manually detached.

    The disk has been detached from the ECS and will not be deleted.

  • Table 5 describes how network interfaces attached to ECSs are handled.
    Table 5 Handling of attached network interfaces

    Network Interface Type

    Operation

    Moved to the Recycle Bin

    After ECS Is Recovered

    After ECS Is Permanently Deleted

    Primary network interface

    Delete or unsubscribe from an ECS.

    No

    The network interface will still be attached to the ECS.

    The network interface will also be permanently deleted.

    Extension network interface

    Delete or unsubscribe from an ECS.

    No

    The network interface will still be attached to the ECS, unless it is manually detached.

    • The network interface will not be deleted if it is manually detached from the ECS.
    • The network interface will also be permanently deleted if it is not manually detached from the ECS.