Hibernate an idle instance to preserve its memory state and resume running quickly, unlike a regular stop that restarts all applications.
Background
-
Hibernation saves memory data to the system disk. When you start a hibernated instance, the OS restores applications to their pre-hibernation state. In contrast, starting a stopped instance restarts all backend services and applications from scratch.
-
If hibernation fails, the instance is automatically stopped. Memory data is not saved, and the OS restarts backend services and applications without restoring the pre-hibernation state.
Hibernation may cause service interruptions. Hibernate instances during off-peak hours.
Billing for hibernated instances varies by billing method.
-
Subscription instance: Hibernation does not affect the expiration time or billing.
-
Pay-as-you-go instance: Billing depends on whether you select No Fees for Hibernated Instances. See the following table for resource retention and billing details.
Billing of resources for a hibernated pay-as-you-go instance
|
Resource |
No Fees for Hibernated Instances |
Retain Instance and Continue Charging After Instance Is Hibernated |
|
Compute resources (vCPUs and memory) |
Released. Billing stops. |
Retained. Billing continues. |
|
Disks (system disk and data disks) |
Retained. Billing continues. |
Retained. Billing continues. |
|
Internal IP address |
Retained and free of charge. |
Retained and free of charge. |
|
Auto-assigned public IP address |
Released. A new public IP address is assigned free of charge when the instance starts. |
Retained and free of charge. |
|
Elastic IP address (EIP) |
Retained. Billing continues. |
Retained. Billing continues. |
|
Bandwidth |
Billing continues. |
Billing continues. |
Limitations
-
Hibernation is available only in the US (Silicon Valley) and Germany (Frankfurt) regions.
-
Before you hibernate an instance, ensure the following requirements are met:
-
Hibernation is enabled when the instance is created.
NoteHibernation cannot be disabled after it is enabled. If you do not enable hibernation when you create an instance, you cannot hibernate the instance later.
-
The hibernation agent is installed.
-
-
Hibernation requires an encrypted custom image. The following image versions are supported:
-
Windows Server 2016 or later
-
Ubuntu 18 or later
-
CentOS 7 or later
-
-
Instances with hibernation enabled do not support the following operations:
-
Create custom images.
-
Create disk snapshots.
-
Change the instance type.
-
Replace the OS or system disk.
-
-
Spot instances support only No Fees for Hibernated Instances when hibernated.
-
Instances in scaling groups cannot be hibernated.
Step 1: Enable hibernation when you create an instance
You must enable hibernation during instance creation with an encrypted image. Hibernation cannot be enabled after the instance is created.
-
Obtain an encrypted custom image.
Use one of the following methods:
-
Prepare an encrypted custom image that meets the hibernation requirements.
-
Copy a custom image to create an encrypted copy. See Copy a custom image.
NoteFor image limits, see Limitations.
-
-
Create an ECS instance and enable hibernation.
See Create an instance with Custom Launch. Note the following parameters.
Parameter
Description
Example
Instance
-
Instance Type: Select an I/O optimized instance type that is not an ECS Bare Metal Instance (EBM) type.
-
Memory:
-
Windows: The instance type must have less than 16 GiB of memory.
-
Linux: The instance type must have less than 150 GiB of memory.
-
ecs.g6e.large
Image
-
Select the encrypted custom image obtained in Step 1.
-
Select Instance Hibernation to enable hibernation.
-
encrypted.windows2016
-
Select Instance Hibernation.
Storage
-
System Disk: Required. Must meet the following requirements:
-
Category: Ultra disk, standard SSD, or Enhanced SSD (ESSD).
-
Capacity: Set to at least twice the memory size to ensure sufficient space for memory data.
-
Encryption: Select Disk Encryption and select the key used to encrypt the custom image.
-
-
Data Disk: Optional. Specify the category, size, quantity, and encryption for each data disk.
-
System Disk: Enhanced SSD (ESSD), 60 GiB, encrypted with Default Service CMK.
-
Data Disk: Enhanced SSD (ESSD), 40 GiB, unencrypted.
Network and Zone
Select a VPC.
NoteInstances in the classic network do not support hibernation.
vpc-bp1opxu1zkhn00g****
-
Step 2: Install the hibernation agent
After enabling hibernation, install the hibernation agent before you can hibernate the instance.
-
Use Cloud Assistant Agent to install the hibernation agent.
-
Windows instance:
acs-plugin-manager.exe --exec --plugin ecs-hibernate-win --params "install" -
Linux instance:
acs-plugin-manager --exec --plugin ecs-hibernate-linux --params "install"Successful installation displays the following output:

-
-
Restart the instance for the hibernation agent to take effect.
See Restart an instance.
Step 3: Hibernate the instance
After hibernation is enabled and the agent is installed, you can hibernate a running instance. You cannot connect to a hibernated instance.
Log in to the ECS console.
In the left-side navigation pane, choose .
In the upper-left corner of the page, select a region and resource group.
-
Find the target instance and choose in the Actions column.
-
In the Stop Instance dialog box, configure the following parameters.
-
Set Stopped By to Hibernate.
-
Set Stop Mode to Retain Instance and Continue Charging After Instance Is Hibernated or No Fees for Hibernated Instances based on the billing method of the instance.
-
Subscription instances are always charged regardless of hibernation state. Select Retain Instance and Continue Charging After Instance Is Hibernated.
-
For a pay-as-you-go instance, select Retain Instance and Continue Charging After Instance Is Hibernated or No Fees for Hibernated Instances.
Note-
For the difference between Retain Instance and Continue Charging After Instance Is Hibernated and No Fees for Hibernated Instances, see the Billing of resources for a hibernated pay-as-you-go instance table.
-
Spot instances support only No Fees for Hibernated Instances.
-
-
-
Click OK.
NoteThe instance enters the Stopped state. To resume, see Start an instance.
-
References
CloudOps Orchestration Service (OOS) provides Scheduled startup/shutdown to batch manage hibernation and startup times for instances. Combine this with the economical mode to save costs.
> Instance Status > Stop