Home AWS Cloud Demystifying Amazon EC2 Instance States and Operations

Demystifying Amazon EC2 Instance States and Operations

240
0

Amazon EC2 (Elastic Compute Cloud) is a central part of AWS’s cloud computing platform, and understanding its instance states and operations is crucial for anyone working with AWS. This blog post breaks down these concepts into easy-to-understand language, helping you get a clearer picture of what happens behind the scenes.

Understanding EC2 Instance States

1. Pending

  • What Happens?: This is the birth phase of an EC2 instance. After you hit ‘Launch’, AWS prepares the instance with the necessary configuration and software.
  • Behind the Scenes: AWS allocates resources like CPU, memory, and storage. The Amazon Machine Image (AMI) you selected is loaded, setting the stage for the instance to start.
  • Trigger: Initiated by the user’s launch command.

2. Running

  • What Happens?: Your instance is now up and running, ready to be used just like any computer.
  • Behind the Scenes: The instance is fully operational, connected to the network, and starts incurring billing charges.
  • Trigger: Automatically follows the pending state.

3. Stopping/Stopped

  • What Happens?: When you stop an instance, it powers down. It’s like putting your computer to sleep; you can wake it up later.
  • Behind the Scenes: The instance transitions to the stopping phase and then to stopped. While stopped, the instance doesn’t incur compute charges, but storage charges for EBS volumes still apply.
  • Trigger: User command to stop the instance.

4. Shutting-down/Terminated

  • What Happens?: This is the end of the road for an instance. Termination is like throwing away your computer.
  • Behind the Scenes: In shutting-down, AWS cleans up resources, and then the instance moves to terminated where it’s deleted and cannot be restarted.
  • Trigger: User command to terminate the instance.

5. Hibernating (Only for EBS-backed instances)

  • What Happens?: Hibernation saves the instance’s state to disk, allowing it to resume later from the same state.
  • Behind the Scenes: RAM contents are saved to the EBS root volume. The instance enters stopping and then stopped. Billing is paused, but EBS volume storage charges still apply.
  • Trigger: User command to hibernate the instance.
  • Read more: heartinjacobk18.sg-host.com/blog/understanding-ec2-hibernate-state

EC2 Instance Change Operations

  1. Start: Wakes up a stopped instance. It’s similar to turning on your computer.
  2. Stop: Powers down the instance. Use this when you want to pause your work and resume later.
  3. Terminate: Permanently deletes the instance. Once done, it can’t be undone.
  4. Reboot: It’s like restarting your computer. The instance stays on the same host and retains its configuration and IP addresses.
  5. Hibernate: Saves your instance’s state to disk, including in-memory data. Useful for long-term pause without losing the current state.

Important notes

  • Elastic IP Addresses: If your instance has an Elastic IP, it retains this address across stop/start cycles, but not on termination.
  • Instance Store Volumes: These are temporary storage volumes that get deleted on stopping, hibernating, or terminating the instance.
  • Billing: Understand billing implications of each state. For example, you’re not billed for a stopped instance, but you are billed for its attached EBS storage.

Conclusion

Understanding these states and operations is crucial for efficient and cost-effective management of AWS resources. Remember, each state and operation has specific implications on billing, data persistence, and network settings. Keeping these in mind helps in making informed decisions while working with AWS EC2.

Previous articleGetting Started with ENI in AWS
Next articleUnderstanding EC2 Hibernate State
Heartin Kanikathottu
As a seasoned Cloud and Security Architect, I’ve led transformative initiatives in key roles, including Vice President at Morgan Stanley, Principal Architect at Societe Generale, and Tech Lead & Cloud Security Architect at VMware, among others. I’m also an internationally published author with multiple books available on platforms like Amazon and O'Reilly. Notably, one of my books was recognized as the 8th best cloud computing book of all time in 2020, reflecting the impact of my contributions to the field. With over 15 professional certifications from providers such as Microsoft (Azure), Amazon (AWS), Oracle (Java), Pivotal (Spring), and IBM, I bring a wealth of expertise to my work. Academically, I hold dual Master’s degrees in Cloud Computing and Data Analytics. I’m passionate about sharing knowledge and mentoring others, which is why I actively speak at global technical forums such as Tech Opportunities Fest at Platform Calgary, Google's Kubernetes Meetup, Java User Group, Elasticsearch Meetup, and the Agile India Conference.

LEAVE A REPLY

Please enter your comment!
Please enter your name here