Ravindra BagaleCourses & study guides

Chapter 14: EC2 Operations — Elastic IP, AMI, Snapshots and Vertical Scaling

Practice Questions and Lab Exercises

  1. Why does the public IP of an instance change after stop/start? How does an Elastic IP fix it?
  2. What is the default Elastic IP limit per region? Are idle Elastic IPs free?
  3. List the parts of an AMI. Differentiate AWS, Marketplace, Community and own AMIs.
  4. Explain the pros and cons of the "No reboot" option.
  5. Why must you delete snapshots after deregistering an AMI?
  6. What is a golden AMI? Why do companies use it?
  7. Compare scale up and scale out with an example.
  8. Lab: Allocate an EIP, associate it with web-1, stop/start the instance and confirm the IP stays the same. Then build web-2, re-associate the EIP to it, and finally release the EIP.
  9. Lab: Create an AMI of your working web server, launch a new instance from it and confirm the website loads without any installation. Copy the AMI to ap-south-2, then deregister both copies and delete their snapshots.
  10. Lab: Take a snapshot of your root volume, delete a file from the website, restore it by creating and mounting a volume from the snapshot.
  11. Lab: Create a DLM policy that takes a daily snapshot of volumes tagged Backup=daily and keeps 7.
  12. Lab: Change your instance from t3.micro to t3.small, verify with nproc, free -h and lscpu, then change it back.

Quick Revision

  • Elastic IP: static public IPv4 owned by your account; allocate → associate → (re-associate for server replacement) → disassociate → release. Default limit 5 per region; all public IPv4 is charged hourly, even idle.
  • AMI: root snapshot(s) + block device mapping + launch permissions. Create from instance (reboot = consistent), launch copies, copy across regions, share by account ID, deregister and delete snapshots. Golden AMI = standard hardened image.
  • Snapshots: incremental, stored in S3 (managed), regional. Create volume from snapshot in any AZ → attach → mount (ro,nouuid for XFS copy) → restore. Copy across regions, make AMIs, automate with DLM, delete old ones.
  • Vertical scaling: stop → Change instance type → start → verify (nproc, free -h, lscpu). Public IP changes (unless EIP), instance store lost, EBS and private IP stay. Watch architecture, ENA/NVMe drivers, AZ availability, free tier. For web tiers prefer horizontal scaling (ASG + ELB).