hands-on lab

Using EC2 Spot Instances

Difficulty: Beginner
Duration: Up to 2 hours
Students: 3,565
Rating: 4.3/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

In this lab, you will learn how EC2 spot instances can be used in AWS. You will see that spot instances can be used in much the same way as regular, on-demand instances except with a different pricing model built around them allowing you to save a substantial amount. You can set a maximum price that you are willing to pay for an instance, and if the spot market price rises to your maximum, your instance is subject to termination. Despite this complication, you will see that there are ways to manage this situation.

Prerequisites

You should be familiar with:

  • Creating on-demand Amazon EC2 instances
  • Using EBS volumes with your instances
  • Working with autoscaling groups at a basic level

Learning Objectives

Upon completion of this Lab, you will be able to:

  • Create EC2 instances by placing spot requests
  • Handle instance interruptions
  • Auto-scale a spot fleet
  • Get advice from Spot Instance Advisor

Lab Environment

Before completing the Lab instructions, the environment will look as follows:

 

After completing the Lab instructions, the environment should look similar to:

Updates

May 22nd, 2024 - Updated the instructions and screenshots to reflect the latest UI

December 12th, 2023 - Resolved an issue that caused the lab to fail to setup on rare occasions

December 8th, 2023 - Updated screenshots and instructions to reflect the latest UI

October 25th, 2022 - Updated screenshots and instructions for clarity

Augusrt 29th, 2022 - Resolved validation check issue

March 16th, 2021 - Updated to reflect the latest console experience

October 29th, 2021 - Updated lab steps to apply to updated console UI

December 11th, 2020 - Minor updates to screenshots and instructions for outdated UI

August 12th, 2020 - Clarified an ambiguous instruction that could result in the second spot instance being created in the wrong availability zone

May 17th, 2020 - Updated all screenshots and instructions to match the latest AWS Console experience

May 15th, 2020 - Updated instructions to avoid an issue causing spot instance requests in us-west-2b to fail

January 10th, 2019 - Added a validation Lab Step to check the work you perform in the Lab

January 9th, 2019 - Content refresh to discuss new topics related to spot instances and to match the new AWS Console experience

November 8th, 2018 - Updated instructions and screenshots to match the new AWS UI

Covered topics

Lab steps

Logging In to the Amazon Web Services Console
Creating your first Spot Instance
Dealing with Spot Instance Termination
Auto Scaling Spot Fleets
Informing your Requests with Spot Instance Advisor