9

I used spot instances for the past month, launching and terminating instances. Currently, I've no instances running on AWS (all spot instance terminated). But when I try to launch a new spot instance, it tells me that "Max spot instance count exceeded".

I've read the documentation on spot instance limits. However, I'm confused to how this limit works. Is it limiting the number of concurrent instances you can run, or the total instances you ever launched?

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-limits.html#spot-limits-general

calclavia
  • 321
  • 1
  • 5
  • 10

3 Answers3

7

Is it limiting the number of concurrent instances you can run, or the total instances you ever launched?

EC2 Limits are per number of concurrent instances you can launch.

I'd suggest to check your current EC2 limits using the AWS Management Console.

Check your current limits for the instance type(s) you want to use and the limits related to the spot instances.

Antonio
  • 1,565
  • 3
  • 20
  • 33
  • It says I have the default number of spot instances (which should be 20). That's strange because I still can't launch new instances even when I have no instances currently running. – calclavia Apr 05 '17 at 21:11
  • 2
    Yes, it's strange. You should contact the AWS Support for understanding what's going on. – Antonio Apr 06 '17 at 08:24
3

You may want to check "Spot requests" under EC2 panel. According to the docs:

If you terminate your Spot Instance but do not cancel the request, the request counts against this limit until Amazon EC2 detects the termination and closes the request.

I've found closed requests that didn't cancel automatically, you can cancel them manually to free new requests.

Gabriel
  • 1,749
  • 1
  • 11
  • 15
  • This should be the accepted answer, worked for me, thanks. Very unintuitive, though, - the "EC2 detects the termination" did not happen for me even after an hour. – Vladimir Fomenko Apr 25 '21 at 09:15
1

I was having the same issue and I got a solution by following the below steps.

I was running one autoscaling group of type vt1.3xlarge (12 vCPU) of 6 instances as max.. and I found that the autoscaling group is unable to allocate the 6th instance with the error "Launching a new EC2 instance. Status Reason: Max spot instance count exceeded. Launching EC2 instance failed."

Steps for Solving: Since my instance family name is not directly mentioned in the spot instance limit category

  1. Create a service request with mentioning family name and type of instance from the same account.
  2. Once the service request is raised and confirmed from AWS then it should not take more than 15-20 min for reflecting in our account.
  3. There is no extra cost for increasing the limit of vCPUs. - Pricing will only occur with the launch of resources.
  4. The vCPUs counts can be anything. No strict rules like it should be the multiple of 64 Eg: it can be 150 also