EC2 - Placement Groups/ENI/Hibernate Flashcards
What are Placement Groups in AWS, and what are the three types?
Placement Groups control how EC2 instances are placed within AWS infrastructure for performance, fault tolerance, and scalability.
Three Types:
Cluster Placement Group
Spread Placement Group
Partition Placement Group
What is a Cluster Placement Group and its use case?
Instances in a Cluster Placement Group are placed within a single availability zone for low-latency, high-throughput networking (up to 10 Gbps).
Use Case: High-performance computing (HPC), big data processing, and applications that require high-speed communication between instances.
Trade-Off: If the AZ fails, all instances in the group fail.
What is a Spread Placement Group, and when should you use it?
Spread Placement Groups distribute instances across different hardware in multiple availability zones for fault tolerance and high availability.
Use Case: Applications that need fault isolation and high availability (e.g., critical applications).
Limitations: Max 7 instances per AZ per placement group.
What is a Partition Placement Group, and how is it different from Spread?
Partition Placement Groups distribute instances across multiple partitions (isolated hardware racks) within or across availability zones for fault tolerance.
Use Case: Large-scale distributed systems like Hadoop, Cassandra, and Kafka.
Advantage: More scalable (up to hundreds of instances) and can span multiple AZs.
Difference from Spread: Partition groups offer isolation between partitions, making them more resilient to rack failures than spread groups.
What is the key benefit and limitation of each Placement Group type?
Cluster Placement Group:
Benefit: High performance with low latency and high throughput (10 Gbps).
Limitation: High risk—if the AZ fails, all instances fail.
Spread Placement Group:
Benefit: Fault tolerance by spreading instances across multiple AZs.
Limitation: Limited to 7 instances per AZ per group.
Partition Placement Group:
Benefit: Fault isolation across different hardware racks, scalable for large distributed applications.
Limitation: More complex setup but ideal for partition-aware applications.
What is an Elastic Network Interface (ENI) in AWS?
An Elastic Network Interface (ENI) is a virtual network card in a VPC that provides network connectivity to EC2 instances. It can also be used outside EC2 instances for other purposes.
What are the key attributes of an ENI?
An ENI can have the following attributes:
Primary private IPv4
Secondary private IPv4 (can have multiple)
Elastic IPv4 or Public IPv4 (per private IP)
Security Groups attached
MAC Address
It is bounded to a specific Availability Zone (AZ).
Can ENIs be created independently of EC2 instances?
Yes, ENIs can be created independently of EC2 instances. They can be attached on the fly to EC2 instances and moved between them for failover purposes.
What is the significance of moving an ENI between EC2 instances?
Moving an ENI (e.g., from eth1 to another EC2 instance) allows you to move a private IP from one instance to another, enabling failover capabilities. This is useful for scenarios where an EC2 instance is accessed via a static private IP.
What is the limitation of ENIs in terms of Availability Zones?
ENIs are bound to a specific Availability Zone (AZ), meaning an ENI created in one AZ can only be attached to EC2 instances in that same AZ.
What is EC2 Hibernate?
EC2 Hibernate allows you to preserve the in-memory state of an EC2 instance, so when it is restarted, it resumes from where it left off, without needing to reload applications or data into memory.
How does EC2 Hibernate differ from EC2 Stop and Terminate?
Stop: Preserves data on EBS but requires a full boot on restart.
Terminate: Deletes instance data unless specified otherwise.
Hibernate: Saves the RAM state to EBS, allowing faster restart without full OS boot.
Where is the in-memory state stored during EC2 Hibernate?
The RAM state is written to the root EBS volume when hibernating the EC2 instance.
What are the requirements for using EC2 Hibernate?
The root EBS volume must be encrypted and large enough to store the RAM.
The instance must have less than 150 GB of RAM (varies).
Hibernation is not supported on bare metal instances.
Supports Linux and Windows operating systems.
Works with on-demand, reserved, and spot instances.
What happens during the EC2 Hibernate process?
The instance stops.
The RAM state is written to the root EBS volume.
The instance shuts down.
Upon restart, the RAM state is loaded from the EBS volume back into the instance.