Chapter 14: EC2 Operations — Elastic IP, AMI, Snapshots and Vertical Scaling
Practice Questions and Lab Exercises
Come on, now practice! After every lab release the EIP, deregister the AMI and delete the snapshots – a clean account is a skill too.
चला, आता प्रॅक्टिस! प्रत्येक लॅबनंतर EIP रिलीज, AMI डीरजिस्टर आणि स्नॅपशॉट्स डिलीट करा – स्वच्छ अकाउंट हे पण एक स्किल आहे.
चलो, अब प्रैक्टिस! हर लैब के बाद EIP रिलीज़, AMI डीरजिस्टर और स्नैपशॉट्स डिलीट करो – साफ़ अकाउंट भी एक स्किल है.
- Why does the public IP of an instance change after stop/start? How does an Elastic IP fix it?
- What is the default Elastic IP limit per region? Are idle Elastic IPs free?
- List the parts of an AMI. Differentiate AWS, Marketplace, Community and own AMIs.
- Explain the pros and cons of the "No reboot" option.
- Why must you delete snapshots after deregistering an AMI?
- What is a golden AMI? Why do companies use it?
- Compare scale up and scale out with an example.
- Lab: Allocate an EIP, associate it with
web-1, stop/start the instance and confirm the IP stays the same. Then buildweb-2, re-associate the EIP to it, and finally release the EIP. - 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. - 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.
- Lab: Create a DLM policy that takes a daily snapshot of volumes tagged
Backup=dailyand keeps 7. - Lab: Change your instance from
t3.microtot3.small, verify withnproc,free -handlscpu, then change it back.
Got it? Elastic IP, AMI, snapshots and scaling – this is the day-two work of EC2. In the next chapter, Chapter 15, we build our own network – VPC, subnets, NACL, NAT gateway and a bastion host. Before that, redo every lab on your own.
समजलं का? Elastic IP, AMI, snapshots आणि scaling – हेच EC2 चं दुसऱ्या दिवसाचं काम. पुढच्या Chapter 15 मध्ये आपण स्वतःचं network बनवणार आहोत – VPC, subnets, NACL, NAT gateway आणि bastion host. त्याआधी प्रत्येक lab स्वतः परत करा.
समझ आया? Elastic IP, AMI, snapshots और scaling – यही EC2 का दूसरे दिन का काम है. अगले Chapter 15 में हम अपना खुद का network बनाएँगे – VPC, subnets, NACL, NAT gateway और bastion host. उससे पहले हर lab खुद दोबारा करो.
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,nouuidfor 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).