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

Heesu
已提问 1 年前271 查看次数
1 回答
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
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则