Study guide
Technical reference and lesson notes
AWS EC2 Instance Lifecycle: States, Stop/Start, Reboot, Hibernate, and Termination
Purpose of This Lesson
This lesson explains how an Amazon EC2 instance moves through its lifecycle and how the choice between rebooting, stopping, hibernating, and terminating affects compute billing, storage, memory, networking, host placement, and recoverability. These distinctions are important for AWS Certified CloudOps Engineer Associate scenario questions and for safe day-to-day operations.
Key Concepts
- Launch: An instance is launched from an Amazon Machine Image (AMI). It enters the pending state and then transitions to running.
- Reboot: A reboot is equivalent to an operating system reboot. The instance returns to operation while retaining its DNS name and IPv4/IPv6 addresses.
- Stop: A stop operation moves an eligible instance through stopping to stopped. Stopping is supported for EBS-backed instances, not instances whose root volume is instance store-backed.
- Start: A stopped instance transitions through pending and back to running.
- Hibernate: Hibernation saves the contents of RAM to the EBS root volume, allowing the instance to resume its previous processes when started again. Hibernation requires a supported AMI and must be enabled at launch.
- Terminate: Termination moves an instance through shutting-down to terminated. A terminated instance cannot be recovered by default.
- Retirement: AWS may retire an instance when the underlying hardware has an irreparable failure or reaches a scheduled retirement date.
EC2 State Transitions and Operational Effects
Launching and starting
A newly launched EC2 instance starts in the pending state before entering running. Starting a previously stopped instance also sends it through pending before it becomes running again.
Rebooting
Rebooting is an operating system restart rather than a stop/start cycle. AWS recommends initiating the reboot through EC2 rather than directly from the operating system when possible.
A reboot retains:
- The instance’s DNS name
- Private IPv4 addresses
- IPv6 addresses
- Public IPv4 addressing associated with the instance, subject to the normal behavior of that address during a reboot
A reboot does not affect billing. It also does not move the instance to a different underlying host in the way a stop followed by a start can.
Stopping and starting
Stopping applies to EBS-backed instances. An instance with an instance store-backed root volume cannot be stopped. When an eligible instance is stopped:
- EC2 instance compute charges stop.
- EBS volumes remain and continue to incur EBS storage charges.
- Data in RAM is lost unless hibernation is used.
- Private IPv4 and IPv6 addresses are retained.
- A dynamically assigned public IPv4 address is released.
- An associated Elastic IP address is retained.
- Starting the instance places it on a different underlying host.
The host migration makes stop/start useful when AWS reports planned host maintenance through the Personal Health Dashboard or when system status checks indicate an underlying host problem. Stop/start should be performed at a suitable operational time because the instance becomes unavailable during the operation and volatile memory is lost.
Hibernating
Hibernation is a specialized stop operation. For supported AMIs and instances, the contents of RAM are saved to the EBS volume. When the instance is started again:
- The root volume is restored to its previous state.
- RAM contents are reloaded.
- Previously running processes resume.
- Previously attached data volumes are reattached.
- The instance retains its instance ID.
- Associated Elastic IP addresses are retained.
Hibernation must be enabled when the instance is launched, and specific prerequisites apply. It is therefore not a capability that can be assumed for every existing EC2 instance.
Terminating
Termination is a destructive lifecycle action. The instance shuts down and enters the terminated state. By default, the root EBS volume is deleted, so data stored there is permanently lost. A terminated instance cannot be recovered by default; any required data must be preserved through an appropriate storage or backup design before termination.
Retiring
AWS may retire an instance when it detects an irreparable failure in the underlying hardware or when the instance reaches a scheduled retirement date. Depending on the situation, AWS stops or terminates the instance. Monitor AWS notifications and system health information so that workloads can be moved or restored appropriately.
Exam- or Assessment-Relevant Takeaways
- A stop operation is available for EBS-backed instances, not instance store-backed root instances.
- Stopped instances do not incur EC2 instance compute charges, but retained EBS volumes remain billable.
- Stopping loses RAM contents; hibernation preserves RAM by writing it to EBS.
- A standard stop/start releases a dynamically assigned public IPv4 address, while private IPv4, IPv6, and Elastic IP addressing are retained.
- Stop/start can move an instance to a different underlying host; rebooting is an OS restart and is not the same operation.
- Hibernation requires a supported AMI, prerequisites, and enablement at launch.
- Termination is not a recoverable shutdown by default, and the default root EBS volume is deleted.
- CloudWatch can monitor system status checks and support recovery when an instance is impaired by underlying hardware or platform issues. The recovered instance is identical to the original instance.
- For a planned host maintenance event or a host-level failure, stop/start is the relevant remediation when the workload and storage design permit it.
Tool / Feature Decision Guide
| Situation | Preferred action | Why |
|---|---|---|
| The operating system needs to restart but the instance should remain in place | Reboot | Performs an OS reboot without the stop/start addressing and host-placement effects. |
| An EBS-backed instance should be powered off temporarily and RAM can be discarded | Stop, then start | Stops EC2 compute billing, preserves EBS volumes, and moves the instance to another host when started. |
| A supported workload must resume processes and memory state after being powered off | Hibernate | Saves RAM to EBS and restores the prior execution state when started. |
| AWS reports host maintenance or system status checks show an underlying host issue | Stop, then start, when operationally appropriate | Starting again migrates the instance to a different host. |
| The workload and its data are no longer needed | Terminate | Permanently removes the instance; verify data retention requirements first. |
| The instance is impaired by an underlying hardware or platform issue | Use CloudWatch monitoring and instance recovery where applicable | Recovery can restore an identical instance without treating termination as a recovery method. |
Common Traps / Misconceptions
- “Stopped means free.” EC2 compute charges stop, but EBS volumes and their stored data remain billable.
- “Stop works for every EC2 instance.” Instance store-backed root instances cannot be stopped.
- “Stopping preserves memory.” A normal stop loses RAM contents. Use hibernation when supported and enabled.
- “The public IP always remains the same.” A dynamically assigned public IPv4 address is released on stop; an Elastic IP is retained.
- “Reboot and stop/start are interchangeable.” Reboot is an OS restart. Stop/start can migrate the instance to another host and causes different memory and public-address behavior.
- “Termination is just a longer stop.” Termination is destructive, and the default root EBS volume is deleted.
- “Hibernation can always be enabled later.” Hibernation must be enabled at launch and has specific prerequisites.
- “A terminated instance can be recovered.” By default, termination cannot be undone; preserve required data before terminating.
Real-World Engineer / Analyst Notes
Before stopping or terminating an instance, identify whether the root volume is EBS-backed, whether any data exists only in RAM or instance store, and how the workload obtains its public address. Confirm that EBS data is retained or backed up as required.
For planned maintenance, use the Personal Health Dashboard and system status checks to distinguish host-related concerns from normal operating-system problems. A reboot may be sufficient for an OS issue, while stop/start is the lifecycle action that can relocate an instance to a different host.
Treat hibernation as a workload-specific capability rather than a universal replacement for stop/start. Validate AMI and instance prerequisites, and account for the EBS storage used to hold the RAM contents.
For recovery planning, CloudWatch monitoring of system status checks can identify underlying hardware or platform impairment. Instance recovery is different from terminating and recreating an instance: the recovered instance is identical to the original instance according to the lesson.
Quick Reference Summary
- Launch: AMI → pending → running.
- Reboot: OS restart; DNS name and IPv4/IPv6 addresses are retained; no billing effect.
- Stop: EBS-backed only; compute charges stop, EBS charges continue, RAM is lost, and dynamic public IPv4 is released.
- Start: stopped → pending → running; the instance is moved to a different host.
- Hibernate: Saves RAM to EBS and resumes processes; requires support, prerequisites, and enablement at launch.
- Terminate: shutting-down → terminated; default root EBS volume is deleted and the instance cannot be recovered by default.
- Retirement: AWS may stop or terminate instances because of irreparable hardware failure or scheduled retirement.
- Recovery: CloudWatch can monitor system status checks and recover an instance impaired by underlying hardware or platform issues.
Flashcards
Q: An EBS-backed instance must be powered off overnight, and losing in-memory state is acceptable. Which lifecycle action should be used?
A: Stop the instance. EC2 compute charges stop while EBS volumes remain and continue to incur storage charges.
Q: What happens to an instance when it is launched from an AMI?
A: It enters the pending state and then transitions to running.
Q: When should you choose reboot instead of stop/start?
A: Choose reboot for an operating-system restart when host migration, RAM loss, and stop/start networking effects are not desired.
Q: What is the key host-placement difference between reboot and stop/start?
A: Stop/start moves the instance to a different underlying host when it is started again; reboot is an OS reboot and does not provide that host-migration behavior.
Q: Which EC2 instances cannot be stopped according to this lesson?
A: Instances with an instance store-backed root volume cannot be stopped. Stopping applies to EBS-backed instances.
Q: What happens to RAM during a normal stop?
A: RAM contents are lost. Hibernation is required when the memory state and running processes must be restored.
Q: A stopped instance must keep a stable public address. Which address type should be associated with it?
A: Use an Elastic IP address. A dynamically assigned public IPv4 address is released when the instance is stopped, while an Elastic IP is retained.
Q: What must be true before an EC2 instance can hibernate?
A: The AMI and instance must meet the applicable prerequisites, and hibernation must be enabled at launch.
Q: How does hibernation restore an instance?
A: RAM is saved to EBS, then reloaded when the instance starts; previously running processes resume, data volumes reattach, and the instance ID is retained.
Q: What is the default root-volume consequence of terminating an EC2 instance?
A: The default root EBS volume is deleted, so data on it is permanently lost unless it was preserved elsewhere.
Q: AWS announces maintenance on the host running an instance. Which action can move the instance to another host?
A: Stop the instance and start it again at a suitable time. Starting after a stop migrates it to a different underlying host.
Q: What should an operator use to monitor system status checks and support recovery from hardware or platform impairment?
A: CloudWatch can monitor the system status checks and support instance recovery when the impairment is caused by underlying hardware or platform issues.
Q: How does an Elastic IP differ from a dynamically assigned public IPv4 address during stop/start?
A: The dynamic public IPv4 address is released on stop, while an associated Elastic IP is retained.
Q: Why is termination a poor first response to an instance health problem?
A: Termination is destructive and cannot be recovered by default. Investigate status checks and consider supported recovery or stop/start before deleting the instance.
Practice Questions
Question 1
An operations team needs to restart an application server’s operating system. The team wants to retain its addresses and avoid moving the instance to another underlying host. Which action is most appropriate?
A. Stop and start the instance
B. Hibernate the instance
C. Reboot the instance
D. Terminate and relaunch the instance
Correct answer: C. Reboot the instance. A reboot is an OS restart and retains the DNS name and IPv4/IPv6 addresses without the stop/start host-migration behavior.
Question 2
An EBS-backed instance is stopped for cost control. The team later notices that charges continue for its attached EBS volumes. Is this expected?
A. No; all charges stop when an instance is stopped
B. Yes; EC2 compute charges stop, but EBS storage remains billable
C. No; only Elastic IP charges continue
D. Yes; stopped instances continue to incur full EC2 instance charges
Correct answer: B. Stopping removes EC2 instance compute charges, but attached EBS volumes remain and are charged for stored data.
Question 3
An engineer attempts to stop an instance whose root volume is backed by instance store. The stop operation is unavailable. What is the decisive explanation?
A. Instance store-backed instances cannot be rebooted
B. Only instances with Elastic IP addresses can be stopped
C. Stop is supported for EBS-backed instances, not instance store-backed root instances
D. The instance must be terminated before it can be stopped
Correct answer: C. The lesson identifies EBS-backed instances as eligible for stopping and instance store-backed root instances as ineligible.
Question 4
A supported workload must resume its processes with its previous RAM contents after being powered off. Which capability should have been configured at launch?
A. Reboot
B. Hibernation
C. Termination protection
D. Dynamic public IPv4 addressing
Correct answer: B. Hibernation. Hibernation saves RAM contents to EBS and restores them when the instance starts, but it requires support and launch-time enablement.
Question 5
System status checks indicate that an instance may be affected by an underlying host problem. The workload can tolerate a maintenance interruption. Which action best aligns with the lesson’s host-migration guidance?
A. Reboot only
B. Stop and start the instance
C. Terminate immediately
D. Delete the root EBS volume
Correct answer: B. Stop and start the instance. Starting after a stop moves the instance to a different underlying host; termination is destructive and reboot does not provide the same migration behavior.
WordPress Metadata
Suggested Slug:
aws-ec2-instance-lifecycle-stop-start-reboot-hibernate-termination
Meta Description:
Study EC2 instance lifecycle states, including stop/start, hibernation, rebooting, termination, addressing behavior, storage costs, host migration, and recovery considerations for the AWS Certified CloudOps Engineer Associate exam.
Tags:
AWS, Amazon EC2, EC2 instance lifecycle, EBS, instance store, EC2 hibernation, EC2 reboot, EC2 termination, Elastic IP, CloudWatch