Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adjusting AWS ECS spot request

Tags:

I have AWS ECS cluster but spot instance type I selected is too small.

I can't find way to adjust Spot Fleet request ID or change Instance type(s) for Spot Fleet request cluster is using.

  • Do I have to create a new cluster with a new spot fleet request?
  • Is there any cli option to adjust cluster?
  • Do I have manually order EC2 with ECS optimized AMI ?

UPDATE In question How to change instance type in AWS ECS cluster? that sounds similar advised to copy Launch Configuration. But I have no Launch Configuration

enter image description here

like image 987
Zeta Doop Avatar asked Sep 03 '19 15:09

Zeta Doop


1 Answers

There is no way of changing the instance types' requested by a spot fleet after its been created.

If you want to run you ECS workload on another instance type, create a new spot fleet (with instances which are aware of your ECS cluster).

When the spot instances spin up, they will register with your ECS Cluster.

Once they are registered, you can find the old instances (in the ECS Instances tab of the cluster view) and click the checkbox net to them.

Then, go to Actions -> Drain instances

This tells ECS that you no longer wish to use these instances. New tasks will now be scheduled on the new instances.

Once all the tasks are running on the new instances, you can delete the old spot fleet.

On the subject of launch configurations. There are two ways of creating collections of spot instances.

  • Through a Spot Fleet (which is what you're doing)
  • Through and Auto Scaling Group (ASG)

ASGs allow you to supply a launch configuration (basically a set of instructions to set up an EC2 instances.

Spot Fleets only allow you to customise the instance on creation via User Data.

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html

Because you're using Spot Fleets, Launch Configurations are really a consideration for you.

like image 76
Mat Avatar answered Oct 10 '22 09:10

Mat