An error occurred (MaxSpotInstanceCountExceeded) when calling the RequestSpotInstances operation: Max spot instance count exceeded

0

I am using the CLI and sending in this command:

aws ec2 request-spot-instances --spot-price "0.0835" --instance-count 1 --launch-specification file://launch-specification.json

This is my launch-specification.json:

{ "ImageId": "ami-051f7e7f6c2f40dc1", "InstanceType": "t2.2xlarge", "IamInstanceProfile": { "Arn": "arn:aws:iam::040137372175:instance-profile/ec2-s3-instance-profile" }, "UserData": "IyEvYmluL2Jhc2gKYXdzIHMzIGNwIHMzOi8vYWR2YW4tY29kZS9jb2RlX3BhY2thZ2UuemlwIC9ob21lL2VjMi11c2VyLwp1bnppcCAvaG9tZS=" }

I keep getting the error that I've maxed out my spot instances.

I don't have any spot instances running and my service level quotas says I can do up to 5 and have used none.

I don't know why I get this error. Anybody know why?

Po
asked 8 months ago962 views
1 Answer
0
Accepted Answer

Hello.

The vCPU for t2.2xlarge is 8.
The error is due to the spot instance's vCPU default quota of 5 being exceeded.
The service quota for spot instances is limited by the number of vCPUs, not the number of instances.
Please apply for an increase in the limit from the service quota.
https://docs.aws.amazon.com/general/latest/gr/ec2-service.html

The maximum number of vCPUs for all running or requested Standard (A, C, D, H, I, M, R, T, Z) Spot Instances per Region

The number of vCPUs for each instance type can be found in the following document.
https://aws.amazon.com/ec2/instance-types/?nc1=h_ls

Also, I don't think this has anything to do with this case, but I will share it with you just in case.
The use of "--spot-price" is discouraged because it increases the likelihood of stoppages.
https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/request-spot-instances.html

--spot-price (string)

The maximum price per unit hour that you are willing to pay for a Spot Instance. We do not recommend using this parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the current Spot price.

profile picture
EXPERT
answered 8 months ago
  • Thank you. Didn't know the limit was for vCPU. Thank you. I also took out the Spot Instance price. Thanks or letting me know and saved me the trouble I would have had later.

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