Manage instance release protection
Enable release protection for pay-as-you-go instances that host critical services or store important data. This prevents accidental manual release via the console, API, or CLI, avoiding irreversible data loss.
Prerequisites
The instance uses the pay-as-you-go billing method.
Usage notes
Release protection does not prevent automatic release. Automatic release occurs in scenarios including but not limited to:
Your account has an overdue payment for more than 15 days.
The instance has a scheduled automatic release time.
The instance is stopped due to security or compliance risks.
Auto Scaling (ESS) removes and releases the instance during a scale-in event.
Effect of release protection
When you manually release instances in the console, instances with release protection enabled are skipped.
The instance is categorized under the Non-releasable Instances tab. Hover over the information icon to see the tooltip Release protection is enabled for this instance.
Enable or disable release protection
Release protection is disabled by default. You can enable or disable it when creating an instance or after creation.
Enable or disable for an existing instance
Enable or disable release protection for a pay-as-you-go instance after creation.
Go to ECS console - Instances.
In the upper-left corner of the page, select a region and resource group.
Click the instance ID to go to the details page. Click More, then search for and click Enable Release Protection or Disable Release Protection. In the Enable Release Protection or Disable Release Protection dialog box, click OK.
Enable or disable when creating an instance
Release protection is disabled by default when creating a pay-as-you-go instance. Enable it manually if needed.
Go to ECS console - custom launch.
When creating a Pay-as-you-go instance, click Advanced Settings. In the Release Protection section, select Prevent Instances from Being Accidentally Released by Using the ECS Console or by Calling an API Operation.
Check release protection status
Go to ECS console - Instances.
In the upper-left corner of the page, select a region and resource group.
Click the instance ID to go to the details page. In the Other Information section, check the Release Protection Enabled field.
Yes: release protection is enabled.
No: release protection is disabled.
References
You can also manage release protection by API:
Enable or disable for an existing instance: Call ModifyInstanceAttribute and set the
DeletionProtectionparameter.Enable or disable when creating an instance: Call RunInstances or CreateInstance and set the
DeletionProtectionparameter.NoteCalling DeleteInstance on a protected instance returns the
InvalidOperation.DeletionProtectionerror code.
If your account has an overdue payment, top up your account to prevent instance release.
To release an unneeded instance, disable release protection first, then release the instance.
NoteYou can also schedule a release or call ModifyInstanceAutoReleaseTime to set an automatic release time after disabling release protection.