Unable to override instance type in ASG
I have a launch template that specifies t3.medium
as the instance to launch via SPOT.
I want to override this in ASG configuration. To do that I edit ASG config and do the following:
- Under instance type requirements, I choose "override launch template"
- I select 2 instance types that I want:
t3.medium
andt3a.medium
- Under instance purchase options, I choose 100% Spot, 0% On-Demand and disable "On Demand base capacity" option
- Under "Allocation strategies" choose "Lowest price"
When I click on Update
I get the error message:
Incompatible launch template: You cannot use a launch template that is set to request Spot Instances (InstanceMarketOptions) when you configure an Auto Scaling group with a mixed instances policy. Add a different launch template to the group and try again.
Is this a bug or am I missing something?
Hello,
You need to remove 'spot' from the launch template options, since its incompatible with the multiple instance types feature in AutoScaling. Since you're selecting "100% spot" in the overrides all your instances will be spot (even though you don't have it selected in the LT).
Basically, when you're using the overrides option you need to let the AutoScaling logic take over for the spot or not decisions (which AutoScaling then passes on to EC2 Fleet in a CreateFleet call if you ever want to look in cloudtrail at what happens under the hood)
This behavior is mentioned here: https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html But I can see how the wording is a bit ambiguous, so I've reached out to the AutoScaling team to have it updated to be more clear that you MUST leave the 'request spot instances' box un-checked
Thank you for choosing launch templates :)
Relevant questions
Tag Specific Volume in a Multi-Volume Launch Template
asked 6 months agoElastic Beanstalk´s ASG cannot create EC2 instances
Accepted Answerasked 6 months agoHow frequently does an ASG attempt to remove instances when current size is greater than desired?
asked 5 months agoEC2 instances unhealthy when created via ASG using cdk.
asked 20 days agoASG Won't Put Healthy EC2 Instances InService. Stuck in Pending.
asked 3 years agoLaunch an instance with preconfigured alarm
Accepted Answerasked 3 years agoUnable to remove instance type from launch template
asked 5 months agolaunch template suddenly stopped working
asked 4 months agoUnable to override instance type in ASG
Accepted Answerasked 5 months agocan't create AutoScaling group from launch template
asked 3 years ago
Ok, got it! Thanks! However, I am unable to modify my auto-scaling template to undo the instance selection. Please see my other question which has not answer yet: https://repost.aws/questions/QUmDEIczs-TLCxt3Lvhdm-eg/unable-to-remove-instance-type-from-launch-template . Thanks!