There are several pricing models available when building a cloud environment based on Infrastructure as a Service (IaaS):
- On-Demand or Pay-As-You-Go –Customers pay for compute resources per hour or second (depending on the cloud vendor or VM type) with no upfront commitment
- Reserved Instances or Committed Use Discount –Customers commit for 1 or 3-year terms with the goal to control or reduce total computing costs
- Dedicated Hosts –Customers choose either on-demand or reserved instance and receive a dedicated host so that the hardware is not shared with any other customers
- Spot Instances or Low-Priority VM or Pre-Emptible VM Instances –Customer can purchase VM instances at a very low price from a pool of spare compute capacity at cloud vendors’ data centers
Spot Instances Background
Public cloud vendors spend a lot of money expanding available compute resources in all of their data centers and in all regions in order to supply customers an almost infinite amount of available compute resources for consumption.
The fact that cloud vendors have extra compute capacity enables them to sell compute resources to customers at a very low price.
Common Use Cases
- Stateless web services
- Image rendering
- Big Data analytics
- Batch jobs
- Containerized workloads
- High Performance Computing (HPC)
- Massive parallel computations
- CD/CD workloads
- Genomics
- Financial modeling and simulations
What do you need to know when considering the Spot Instance model?
Because vendors sell compute resources from extra capacity, customers need to understand that the low priced VM might be taken at (almost) any given time. If this capacity is needed by another customer who is willing to pay extra money, there is no guarantee that the vendor will continue to offer the same terms.
AWS Spot
Each Amazon EC2 instance has a price based on trends in supply and demand in each Amazon region.
Amazon does not terminate EC2 instances that are configured with a specific duration when the spot price changes (also known as Spot blocks).
AWS offers a free tool called Spot instance advisor to assist customers determine where there is the least chance of interruption in a specific region.
Amazon supports “hibernating” interrupted spot instances to enable customers to resume consumption of an EC2 spot machine.
In cases where customers require a specific level of capacity, Amazon’s Spot Fleet service can solve this by attempting to launch a number of Spot Instances and On-Demand Instances to meet the target capacity specified in the request. The request for Spot Instances is fulfilled if the Spot price exceeds the current Spot price and there is available capacity. The Spot Fleet service also attempts to maintain its target capacity fleet if your Spot Instances are interrupted due to a change in Spot prices or available capacity.
Before an instance is terminated, customers will receive a two-minute warning.
For more information, see:
- Getting Started with Amazon EC2 Spot Instances
- Spot Instance Interruptions
- How Spot Fleet Works
- EC2 Fleet – Manage Thousands of On-Demand and Spot Instances with One Request
- EC2 Spot Instance Termination Notices
- Amazon EC2 Spot Instances Pricing
- Specifying a Duration for Your Spot Instances
Azure Low-Priority VMs
Microsoft Azure supports low-priority VMs for both batch jobs and as part of VM scale sets.
If batch jobs are interrupted, it will detect and re-queue the jobs.
The Low-priority VM service is currently available under preview release (May 2018).
Azure supports an eviction policy which enables customers to redeploy evicted instances, though there are no guarantees that allocations will succeed.
For more information, see:
- Use low-priority VMs with Batch
- Azure Batch Low-Priority VM pricing
- Low-priority VMs on scale sets
- Linux Virtual Machine Scale Sets Pricing
- Microsoft Azure Low-priority Virtual Machines – take advantage of surplus capacity in Azure
- Introducing Elastigroup Support For Azure’s Low Priority VMSS
Google Preemptible VMs
Google preemptible VMs are suitable for batch jobs and fault-tolerant workloads at fixed prices.
The instance duration is for a maximum of 24 hours.
Preemptible VMs support attaching GPUs and local SSD for additional performance.
Before an instance is terminated, customers receive 30 seconds for a smooth shutdown.
Google supports preemptible managed instance groups, which allow a customer to configure a group of low-cost VMs once the resources are available in a specific region.
Google also supports cloud TPU (Tensor Processing Units) as preemptible VMs for running deep learning models and running preemptible VMs with Google Kubernetes Engine.
For more information, see:
- Preemptible Virtual Machines
- Preemptible VM Instances
- Instance Groups
- Best practices for using preemptible VM instance
- Introducing improved pricing for Preemptible GPUs
- Cloud TPU now offers preemptible pricing and global availability
- Google Pre-emptible VM and Google Kubernetes Engine
The article compares Spot Instance options on AWS, Azure, and Google:
http://sixninesit.com/what-are-your-spot-instances-options-on-aws-azure-and-google/
Eyal Estrin
Eyal Estrin is a Cloud Architect. He joined IUCC in December 2017 and his main focus is promoting and supporting cloud services in Universities in Israel. He brings with him more than 20 years of experience in the IT and information security field.
Follow him at @eyalestrin