Hibernate an instance - Amazon Elastic Compute Cloud
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Hibernate an instance

You can hibernate an instance if the instance is enabled for hibernation and meets the hibernation prerequisites. If an instance cannot hibernate successfully, a normal shutdown occurs.

Console
To hibernate an Amazon EBS-backed instance
  1. Open the Amazon EC2 console at https://console.amazonaws.cn/ec2/.

  2. In the navigation pane, choose Instances.

  3. Select an instance, and choose Instance state, Hibernate instance. If Hibernate instance is disabled, the instance is already hibernated or stopped, or it can't be hibernated. For more information, see Hibernation prerequisites.

  4. When prompted for confirmation, choose Hibernate. It can take a few minutes for the instance to hibernate. The instance state first changes to Stopping, and then changes to Stopped when the instance has hibernated.

Amazon CLI
To hibernate an Amazon EBS-backed instance

Use the stop-instances command and specify the --hibernate parameter.

aws ec2 stop-instances \ --instance-ids i-1234567890abcdef0 \ --hibernate
PowerShell
To hibernate an Amazon EBS-backed instance using the Amazon Tools for Windows PowerShell

Use the Stop-EC2Instance command and specify the -Hibernate $true parameter.

Stop-EC2Instance ` -InstanceId i-1234567890abcdef0 ` -Hibernate $true

 

Console
To view if hibernation was initiated on an instance
  1. Open the Amazon EC2 console at https://console.amazonaws.cn/ec2/.

  2. In the navigation pane, choose Instances.

  3. Select the instance and, on the Details tab, in the Instance details section, inspect State transition message. The message Client.UserInitiatedHibernate: User initiated hibernate indicates that hibernation was initiated on the instance.

Amazon CLI
To view if hibernation was initiated on an instance

Use the describe-instances command and specify the state-reason-code filter to see the instances on which hibernation was initiated.

aws ec2 describe-instances \ --filters "Name=state-reason-code,Values=Client.UserInitiatedHibernate"

The following field in the output indicates that hibernation was initiated on the instance.

"StateReason": { "Code": "Client.UserInitiatedHibernate" }
PowerShell
To view if hibernation was initiated on an instance using the Amazon Tools for Windows PowerShell

Use the Get-EC2Instance command and specify the state-reason-code filter to see the instances on which hibernation was initiated.

Get-EC2Instance ` -Filter @{Name="state-reason-code";Value="Client.UserInitiatedHibernate"}

The output lists the EC2 instances on which hibernation was initiated.