if I changed Ec2 type to Spot instances in autoscaling that is already deployed, does EC2 stop service while it is changing?

0

I used ECS with EC2 not fargate and also have autoscaling

as we used gpu instances, we are considering to change ec2 type as spot instance.

I have question that if i do change instance as spot, the ec2 ,which is belong to autoscaling now, could be changed to spot without stop or service stop

1 Answer
0

This depends on your setup

  • If the ASG is using a MixedInstancePolicy, and you're changing the percent from 100% OnDemand to 100% spot (or any other changes), then yes, AutoScaling will proactively rebalance. You could avoid this by enabling scale-in protection on the instances, but they won't be able to be terminated for any graceful scale-in. So you'd need to manually manage cycling them out when they're idle
  • If there's no MixedInstancePolicy, and you're just updating the launch template or launch config to use spot, then no change will immediately happen. The ASG will just use the new settings when launching new instances in the future

Make sure your application is setup in a way to handle spot. Spot capacity is best effort (by definition, its EC2s spare capacity). This means your instances might get terminated with 2 minutes of warning from spot reclaiming them, or you might have times when no spot capacity is available and you'd get launch failures. To reduce capacity issues, use as many instance types and AZs as possible.

AWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions