All Products
Search
Document Center

Elastic Compute Service:Enable or disable release protection for ECS instances

Last Updated:Dec 08, 2023

If your critical business is deployed on a pay-as-you-go Elastic Compute Service (ECS) instance, we recommend that you enable release protection for the instance. This can help prevent accidental release of the instance, which may cause irreparable consequences. After release protection is enabled for the instance, the instance cannot be manually released in the ECS console, by calling API operations, or by using command-line interfaces. This topic describes how to configure release protection for ECS instances.

Prerequisites

The instances for which you want to enable or disable release protection are pay-as-you-go instances.

Usage notes

The release protection feature cannot prevent the automatic release of instances that is triggered by normal reasons, such as the following ones:

  • A payment in your Alibaba Cloud account is overdue for more than 15 days.

  • The automatic release time that you set for the instance arrives.

  • The instance does not comply with applicable security compliance policies.

  • The instance was automatically created by Auto Scaling and is removed during subsequent scale-in events.

Impact of instance release protection

When you attempt to manually release instances in the ECS console, instances with release protection enabled are automatically skipped.

实例释放保护警告信息

Enable or disable release protection for instances

By default, release protection is disabled for instances. You can manually enable or disable release protection for instances when you create the instances or after the instances are created.

Enable or disable release protection in the ECS console

Scenario 1: Enable or disable release protection for existing instances

After you create pay-as-you-go instances, you can enable or disable release protection for the instances.

  1. Log on to the ECS console.

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

  3. In the upper-left corner of the top navigation bar, select a region. 地域

  4. On the Instances page, enable or disable release protection for a single instance or multiple instances.

    • To enable or disable release protection for a single instance, find the instance and choose icon1> Instance Properties > Enable Instance Release Protection or Disable Release Protection in the Actions column. In the Enable Release Protection or Disable Release Protection message, click OK.

    • To enable or disable release protection for multiple instances at a time, select the instances and choose More > Instance Properties > Enable Instance Release Protection or Disable Release Protection. In the message that appears, click OK.

Scenario 2: Enable or disable release protection when you create instances

When you create instances, release protection is disabled for the instances by default. You can manually enable release protection.

On the instance buy page, click the Custom Launch tab. In the Billing Method section of the Basic Configurations step, click Pay-as-you-go. Then, in the System Configurations(Optional) step, select Prevent Instances from Being Accidentally Released by Using the ECS Console or by Calling API Operations for Release Protection.

image.png

Enable or disable release protection by calling API operations

  • To enable or disable release protection for existing instances, call the ModifyInstanceAttribute operation with the DeletionProtection parameter specified.

  • To enable or disable release protection when you create instances, call the RunInstances or CreateInstance operation with the DeletionProtection parameter specified.

Note

If you call the DeleteInstance operation to release an instance for which release protection is enabled, the error code InvalidOperation.DeletionProtection is returned.

Check whether release protection is enabled for an instance

On the Instances page, click the ID of the instance to go to the Instance Details page. In the Other Information section, view the value of Release Protection.

  • Yes: Release protection is enabled for the instance.

  • No: Release protection is disabled for the instance. 国际站其他信息.png