You're trying to launch a new EC2 instance and suddenly hit a wall. The error message is clear but frustrating:
Failed to launch instance: Instance limit exceeded.
You have requested more vCPU capacity than your current limit.This is one of the most common AWS errors, especially for new accounts or when scaling quickly. Let me walk you through exactly how to resolve it.
Understanding the Error
AWS sets default limits on the number of vCPUs and instances you can run in each region. These limits exist to prevent unexpected bills and protect AWS infrastructure. For new accounts, these limits are often conservative:
- New accounts: Typically 1-5 vCPUs per instance type family
- Established accounts: Can have much higher limits
- Default limits: Vary by instance type and region
The error usually appears in this format:
Your quota allows for 0 more running instances.
You can request a quota increase at https://console.aws.amazon.com/support/cases#/createQuick Diagnosis
First, check your current limits and usage in a specific region:
```bash # Check your current vCPU limits and usage aws ec2 describe-instance-types --instance-types t3.micro --query 'InstanceTypes[0].[InstanceType, VCpuInfo.DefaultVCpus, VCpuInfo.DefaultCores]' --output table
# List all running instances in a region aws ec2 describe-instances --filters Name=instance-state-name,Values=running --query 'Reservations[*].Instances[*].[InstanceId,InstanceType,State.Name]' --output table --region us-east-1
# Check your service quotas
aws service-quotas list-service-quotas --service-code ec2 --region us-east-1 --query 'Quotas[?QuotaName==Running On-Demand Standard instances]'
```
The console approach is sometimes easier. Navigate to EC2 Console > Limits to see your current limits and usage at a glance.
Solution 1: Request a Service Quota Increase
This is the most common fix for accounts that genuinely need more capacity.
Via AWS Console
- 1.Go to the Service Quotas console
- 2.Select AWS Services > Amazon EC2
- 3.Find the quota you need (e.g., "Running On-Demand Standard instances")
- 4.Click Request quota increase
- 5.Enter your desired value and submit
Via AWS CLI
bash
# Find the quota code for your instance type
aws service-quotas list-service-quotas --service-code ec2 --region us-east-1 --query 'Quotas[?contains(QuotaName, On-Demand`)]|[].[QuotaName,QuotaCode,Value]' --output table
# Request an increase (replace L-1216C47A with your quota code) aws service-quotas request-service-quota-increase \ --service-code ec2 \ --quota-code L-1216C47A \ --desired-value 20 \ --region us-east-1 ```
Typical Response Time
- Auto-approved limits: Small increases (up to 32-64 vCPUs) are often instant
- Manual review: Larger requests may take 24-48 hours
- Enterprise accounts: Often have expedited processing
Solution 2: Use a Different Region
If you need instances immediately and don't care about region:
# Check your limits in other regions
for region in us-east-1 us-west-2 eu-west-1; do
echo "=== $region ==="
aws service-quotas get-service-quota --service-code ec2 --quota-code L-1216C47A --region $region --query 'Quota.Value'
doneSolution 3: Terminate Unused Instances
Sometimes the simplest solution is freeing up resources:
```bash # Find stopped instances that could be terminated aws ec2 describe-instances --filters Name=instance-state-name,Values=stopped --query 'Reservations[*].Instances[*].[InstanceId,InstanceType,LaunchTime,State.Name]' --output table
# Terminate a specific instance aws ec2 terminate-instances --instance-ids i-1234567890abcdef0 ```
Solution 4: Use Spot Instances for Non-Critical Workloads
Spot instances have separate quotas and can be 70-90% cheaper:
# Launch a spot instance
aws ec2 run-instances \
--image-id ami-0c55b159cbfafe1f0 \
--count 1 \
--instance-type t3.micro \
--instance-market-options '{"MarketType":"spot"}' \
--key-name my-key-pairVerification
After implementing your solution, verify the fix:
```bash # Check your new limit aws service-quotas get-service-quota --service-code ec2 --quota-code L-1216C47A --region us-east-1 --query 'Quota.Value'
# Launch a test instance aws ec2 run-instances \ --image-id ami-0c55b159cbfafe1f0 \ --count 1 \ --instance-type t3.micro \ --key-name my-key-pair \ --region us-east-1 ```
Pro Tips for Preventing This Error
- 1.Monitor your quotas: Set up CloudWatch alarms for quota usage approaching 80%
- 2.Request increases proactively: Don't wait until you hit the limit
- 3.Use AWS Trusted Advisor: It provides recommendations for optimizing quotas
- 4.Consider Reserved Instances: They have separate quotas and can guarantee capacity
Common Gotchas
- Per-region limits: Quotas are region-specific, not global
- Instance family limits: Some instance types (like P4d for ML) have separate quotas
- vCPU-based counting: AWS counts by vCPUs, not instances, so larger instances consume more quota
- vCPU-based counting: A c5.4xlarge uses 16 vCPUs from your quota, not just 1 "instance"
Related Errors
If you see Vcpu limit exceeded instead, it's the same issue with different wording. The solutions above apply equally.