Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to

  1. create an EBS volume
  2. create an EC2 instance, and then
  3. attach the volume to the instance.

But when I try this, I keep hitting InsufficientInstanceCapacity. Apparently, there's still lots of room for EBS volumes in certain zones, but no more EC2 instances can be created.

Is there an easy way to test for this condition, so that I can hide zones with no capacity from the user? Or is there some other trick, such as creating an EBS volume without specifying an availability zone, that will allow me to pick a zone with leftover capacity without guessing randomly?

share|improve this question
    
By default, there is a limit of 20 instances per account, unless you have had them bump it up. It is also possible that your Availability Zone was at capacity, perhaps try another time. –  Flashman Apr 13 '11 at 16:40

1 Answer 1

up vote 1 down vote accepted

Try first launching the ec2 image, then create the EBS volume. When you attempt to launch the ami, you'll get the capacity error, add the exception handling and try starting it in a different az.

1) create EC2 instance 2) create EBS Volume 3) attach volume

share|improve this answer
    
Further research reveals that you're correct: There's no documented way to query for instance capacity before launching an instance. –  emk Apr 25 '11 at 19:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.