2. EC2 Hibernate
Copy of RAM data to EBS root volume encrypted.
● Supported instance families - C3, C4, C5, M3, M4, M5, R3, R4, R5, and T2.
● Instance RAM size - must be less than 150 GB.
● Instance size - not supported for bare metal instances.
● AMI: Amazon Linux 2, Linux AMI, Ubuntu... & Windows or you install yourself
● Root Volume: must be EBS, encrypted, not instance store, and large
● Available for On-Demand and Reserved Instances, not spot
● An instance cannot be hibernated more than 60 days
● Stay with private ops, public are released
https://docs.aws.amazon.com/pt_br/AWSEC2/latest/UserGuide/Hibernate.html#hibernating-prerequisites
4. Spot Instances & Spot Fleets
Amazon EC2 Spot Instances let you take advantage of unused EC2 capacity in the AWS cloud. Spot
Instances are available at up to a 90% discount compared to On-Demand prices
Define max spot price and get the instance while current spot price < max
● The hourly spot price varies based on offer and capacity
● If the current spot price > your max price you can choose to stop or terminate your instance with a
2 minutes grace period.
Other strategy: Spot Block
● "block" spot instance during a specified time frame (I to 6 hours) without interruptions.
● In rare situations, the instance may be reclaimed for AWS EC2, if that hapens you are not charged
for the terminated instances even if you used them.
5. Spot Instances & Spot Fleets
Reasons for interruption
● Price – The Spot price is greater than your maximum price.
● Capacity – If there are not enough unused EC2 instances to meet the demand for Spot Instances,
Amazon EC2 interrupts Spot Instances.
● Constraints – If your request includes a constraint such as a launch group or an Availability Zone
group, these Spot Instances are terminated as a group when the constraint can no longer be met.
Interruption behaviors
● Stop the Spot Instance
● Hibernate the Spot Instance
● Terminate the Spot Instance
6.
7. Spot Fleets
Spot Fleets = set of Spot Instances + (optional) On-Demand Instances
The Spot Fleet will try to meet the target capacity with price constraints
● Define possible launch pools: instance type, OS, Availability Zone
● Can have multiple launch pools, so that the fleet can choose
● Spot Fleet stops launching instances when reaching capacity or max cost
Spot Fleets allow us to automatically request Spot Instances with the lowest price
8. Spot Fleets
The allocation strategy for the Spot Instances in your Spot Fleet determines how it fulfills your Spot Fleet
request from the possible Spot Instance pools represented by its launch specifications.
● lowestPrice - The Spot Instances come from the pool with the lowest price. This is the default
strategy.(cost optimization, short workload)
● diversified - The Spot Instances are distributed across all pools. (great for availability, long
workloads)
● capacityOptimized - The Spot Instances come from the pool with optimal capacity for the number
of instances that are launching.
● InstancePoolsToUseCount - The Spot Instances are distributed across the number of Spot pools
that you specify. This parameter is valid only when used in combination with lowestPrice.