Set up Spot Scaling
Required permission
- Spot Scaling Manager
Spot Scaling needs access to your AWS account. Make sure to link your AWS account to the DoiT organization if you haven't done so yet.
Link Spot Scaling to your account
To allow Spot Scaling to monitor your ASG behavior and make recommendations, you need to link Spot Scaling to your AWS account and update the associated AWS IAM role.
Linking Spot Scaling to your AWS account doesn't affect your ASG configuration or your workloads. To apply the Spot Instance recommendations, you must use the Apply Recommendations button in the DoiT console or configure the Spot Scaling Auto-Enrollment tags.
-
Select the gear icon () from the top navigation bar, and then select Amazon Web Services.
-
On the Amazon Web Services screen, select the account you would like to use with Spot Scaling.
-
On the account edit screen, select the Spot Scaling checkbox.
-
Select Update account to add Spot Scaling to the account.
You'll be prompted to go to your AWS console to create a CloudFormation stack from a template. After creating the CloudFormation stack, you may have to wait about 30 seconds while we update your account. See Feature permissions: Spot Scaling for more information.
Spot Scaling recommendations in the DoiT console
Once Spot Scaling is linked to your AWS account, you can check recommendations on the Spot Scaling screen in the DoiT console.
View recommendations
To view recommendations, select Savings from the top navigation bar, and then select Spot Scaling.
The status of each Auto Scaling group is displayed in the Optimization Status column:
-
Optimized: The ASG is fully optimized. All applicable recommendations have been implemented.
-
New recommendations: Spot Scaling has new recommendations. Select the ASG to view the recommendations, modify them as you wish and apply the changes.
-
Not Optimized: The ASG is not optimized and is not benefiting from Spot Scaling recommendations.
-
Error: Something prevents Spot Scaling from working for this ASG. You may need to update your AWS CloudFormation stack. If you get stuck, open a support request.
Modify recommendations
For an un-optimized ASG, you'll see the Current Values of the ASG and the Recommended Values of Spot Scaling.
The current on-demand costs and hours running for that ASG are displayed in the upper-left corner.
You can adjust the following values of a recommendation:
-
On-Demand Base Capacity: The minimum number of instances for the ASG's initial capacity that must be fulfilled by On-Demand Instances.
-
On-Demand Instances: The percentage of On-Demand Instances for anything beyond the base capacity.
-
Spot Instances: The percentage of Spot Instances for anything beyond the base capacity.
-
Allowed Instance Types: The recommended instance types to provision based on the primary instance type.
-
Availability Zones: Balance the instances across the specified Availability Zones for high availability.
Apply recommendations
To reconfigure your ASG according to Spot Scaling's recommendations, select Apply Recommendations.
If successfully:
-
We update your ASG to work in a mixed instances policy and to use a launch template.
-
The Recommended Values column disappears, the values under the Current Values column is updated to reflect the changes.
-
The metrics displayed at the top show the actual cost/hour breakdowns for On-Demand and Spot, as well as the actual savings. You can use the Time Range dropdown in the upper-right corner to adjust the time range for which the metrics are displayed.
-
The ASG has an Optimization status of
Optimized
.
Additional settings
Spot Scaling provides two additional settings:
-
Automatically update: If selected, Spot Scaling will constantly look for savings opportunities and automatically optimize the ASG.
-
Fallback to On-Demand: If selected, when there are not enough EC2 instances to meet the capacity demand for Spot Instances, Spot Scaling will automatically fall back to On-Demand Instances.
Note that the additional settings are not available if you use AWS tags.
AWS tags
Spot Scaling supports the following AWS tags that can be used with Infrastructure as Code (IaC) tools:
-
Spot Scaling Auto-Enrollment:
doitintl:spotscaling:auto-enroll
,doitintl:fallback-to-on-demand
-
Instance distributions:
doitintl:spotscaling:spot-distribution-percentage
,doitintl:spotscaling:on-demand-base-capacity
The AWS tags are ideal for DevOps or Platforms teams that prefer using IaC tools (e.g., Terraform, AWS CloudFormation) to deploy and maintain their cloud infrastructure, instead of having to log in to the DoiT console.
Tag keys and values are case-sensitive.
Spot Scaling Auto-Enrollment
Spot Scaling Auto-Enrollment is a tool-agnostic solution that allows you to implement Spot Scaling recommendations using IaC tools.
-
Auto-Enrollment tag: to apply Spot Scaling recommendations.
- Key:
doitintl:spotscaling:auto-enroll
- Value: choose one of the following:
always
: Allows Spot Scaling to apply continuous recommendations by finding new savings opportunities when AWS modifies/updates its pricing for the Spot market or when new resources are updated or released.never
: Stops Spot Scaling from applying recommendations.
- Key:
-
Fallback tag: to enable fallback to on-demand.
- Key:
doitintl:fallback-to-on-demand
- Value: choose one of the following:
true
: When there are not enough EC2 instances to meet the capacity demand for Spot Instances, Spot Scaling will automatically fall back to On-Demand Instances.false
: Spot Scaling will not fall back to On-Demand Instances in case of Spot Instance interruptions.
- Key:
Instance distributions
Spot Scaling supports the following AWS tags that you can use for instance purchase options:
-
Instance distribution tag: to specify the the percentage of Spot Instances in the Auto Scaling group for resources beyond the base capacity.
- Key:
doitintl:spotscaling:spot-distribution-percentage
- Value: an integer between 0 to 100
- Key:
-
On-Demand base capacity tag: to specify the minimum amount of the Auto Scaling group's initial capacity that must be fulfilled by On-Demand Instances.
- Key:
doitintl:spotscaling:on-demand-base-capacity
- Value: integer
- Key:
If you don't specify the instance distributions tags, Spot Scaling will use the default setting: 20% On-Demand Instances and 80% Spot Instances.