Troubleshoot Amazon EC2 Auto Scaling: EC2 instance launch failures
This page provides information about your EC2 instances that fail to launch, potential causes, and the steps you can take to resolve the issues.
To retrieve an error message, see Retrieve an error message from scaling activities.
When your EC2 instances fail to launch, you might get one or more of the following error messages:
Launch issues
- The requested configuration is currently not supported.
- The security group <name of the security group> does not exist. Launching EC2 instance failed.
- The key pair <key pair associated with your EC2 instance> does not exist. Launching EC2 instance failed.
- Your requested instance type (<instance type>) is not supported in your requested Availability Zone (<instance Availability Zone>)...
- Your Spot request price of 0.015 is lower than the minimum required Spot request fulfillment price of 0.0735...
- Invalid device name <device name> / Invalid device name upload. Launching EC2 instance failed.
- Value (<name associated with the instance storage device>) for parameter virtualName is invalid... Launching EC2 instance failed.
- EBS block device mappings not supported for instance-store AMIs.
- Placement groups may not be used with instances of type '<instance type>'. Launching EC2 instance failed.
- Client.InternalError: Client error on launch.
- We currently do not have sufficient <instance type> capacity in the Availability Zone you requested... Launching EC2 instance failed.
- The requested reservation does not have sufficient compatible and available capacity for this request. Launching EC2 instance failed.
- Your Capacity Block reservation <reservation id> is not active yet. Launching EC2 instance failed.
- There is no Spot capacity available that matches your request. Launching EC2 instance failed.
- <number of instances> instance(s) are already running. Launching EC2 instance failed.
The requested configuration is currently not supported.
Cause: Some options in your launch template or launch configuration might not be compatible with the instance type, or the instance configuration might not be supported in your requested AWS Region or Availability Zones.
Solution: Try a different instance configuration. To search for an instance type that meets your requirements, see Finding an Amazon EC2 instance type in the Amazon EC2 User Guide.
For further guidance to resolve this issue, check the following:
-
Ensure that you have chosen an AMI that is supported by your instance type. For example, if the instance type uses an Arm-based AWS Graviton processor instead of an Intel Xeon processor, you need an Arm-compatible AMI. For more information about choosing a compatible instance type, see Compatibility for changing the instance type in the Amazon EC2 User Guide.
-
Test that the instance type is available in your requested Region and Availability Zones. The newest generation instance types might not yet be available in a given Region or Availability Zone. The older generation instance types might not be available in newer Regions and Availability Zones. To search for instance types offered by location (Region or Availability Zone), use the describe-instance-type-offerings command. For more information, see Finding an Amazon EC2 instance type in the Amazon EC2 User Guide.
-
If you use Dedicated Instances or Dedicated Hosts, ensure that you have chosen an instance type that's supported as a Dedicated Instance or Dedicated Host.
The security group <name of the security group> does not exist. Launching EC2 instance failed.
Cause: The security group specified in your launch template or launch configuration might have been deleted.
Solution:
-
Use the describe-security-groups command to get the list of the security groups associated with your account.
-
From the list, select the security groups to use. To create a security group instead, use the create-security-group command.
-
Create a new launch template or launch configuration.
-
Update your Auto Scaling group with the new launch template or launch configuration using the update-auto-scaling-group command.
The key pair <key pair associated with your EC2 instance> does not exist. Launching EC2 instance failed.
Cause: The key pair that was used when launching the instance might have been deleted.
Solution:
-
Use the describe-key-pairs command to get the list of the key pairs available to you.
-
From the list, select the key pair to use. To create a key pair instead, use the create-key-pair command.
-
Create a new launch template or launch configuration.
-
Update your Auto Scaling group with the new launch template or launch configuration using the update-auto-scaling-group command.
Your requested instance type (<instance type>) is not supported in your requested Availability Zone (<instance Availability Zone>)...
Error message: Your requested instance type (<instance type>) is not supported in your requested Availability Zone (<instance Availability Zone>)...Launching EC2 instance failed.
Cause: The Availability Zones specified in your Auto Scaling group don't support your chosen instance type.
Solution:
-
Verify which Availability Zones support your chosen instance type using the describe-instance-type-offerings command or from the Amazon EC2 console by checking the Availability Zones value on the networking pane of the Instance types page.
-
Update or remove the subnet for any unsupported zones in the settings of your Auto Scaling group using the update-auto-scaling-group command. For more information, see Add an Availability Zone.
Your Spot request price of 0.015 is lower than the minimum required Spot request fulfillment price of 0.0735...
Cause: The Spot maximum price in your request is lower than the Spot price for the instance type that you selected.
Solution: Submit a new request with a higher Spot maximum price (possibly the On-Demand price). Previously, the Spot price you paid was based on bidding. Today, you pay the current Spot price. By setting your maximum price higher, it gives the Amazon EC2 Spot service a better chance of launching and maintaining your required amount of capacity.
Invalid device name <device name> / Invalid device name upload. Launching EC2 instance failed.
Cause 1: The block device mappings in your launch template or launch configuration might contain block device names that are not available or currently not supported.
Solution:
-
Verify which device names are available for your specific instance configuration. For more details on device naming, see Device names on Linux instances in the Amazon EC2 User Guide.
-
Manually create an Amazon EC2 instance that is not part of the Auto Scaling group and investigate the problem. If the block device naming configuration conflicts with the names in the Amazon Machine Image (AMI), the instance will fail during launch. For more information, see Block device mappings in the Amazon EC2 User Guide.
-
After you confirm that your instance launched successfully, use the describe-volumes command to see how the volumes are exposed to the instance.
-
Create a new launch template or launch configuration using the device name listed in the volume description.
-
Update your Auto Scaling group with the new launch template or launch configuration using the update-auto-scaling-group command.
Value (<name associated with the instance storage device>) for parameter virtualName is invalid... Launching EC2 instance failed.
Cause: The format specified for the virtual name associated with the block device is incorrect.
Solution:
-
Create a new launch template or launch configuration by specifying the device name in the
virtualName
parameter. For information about the device name format, see Device naming on Linux instances in the Amazon EC2 User Guide. -
Update your Auto Scaling group with the new launch template or launch configuration using the update-auto-scaling-group command.
EBS block device mappings not supported for instance-store AMIs.
Cause: The block device mappings specified in the launch template or launch configuration are not supported on your instance.
Solution:
-
Create a new launch template or launch configuration with block device mappings supported by your instance type. For more information, see Block device mapping in the Amazon EC2 User Guide.
-
Update your Auto Scaling group with the new launch template or launch configuration using the update-auto-scaling-group command.
Placement groups may not be used with instances of type '<instance type>'. Launching EC2 instance failed.
Cause: Your cluster placement group contains an invalid instance type.
Solution:
-
For information about valid instance types supported by the placement groups, see Placement groups in the Amazon EC2 User Guide.
-
Follow the instructions detailed in the Placement groups to create a new placement group.
-
Alternatively, create a new launch template or launch configuration with the supported instance type.
-
Update your Auto Scaling group with a new placement group, launch template, or launch configuration using the update-auto-scaling-group command.
Client.InternalError: Client error on launch.
Problem: Amazon EC2 Auto Scaling tries to launch an instance that has an encrypted EBS volume, but the service-linked role does not have access to the AWS KMS customer managed key used to encrypt it. For more information, see Required AWS KMS key policy for use with encrypted volumes.
Cause 1: You need a key policy that gives permission to use the customer managed key to the proper service-linked role.
Solution 1: Allow the service-linked role to use the customer managed key as follows:
-
Determine which service-linked role to use for this Auto Scaling group.
-
Update the key policy on the customer managed key and allow the service-linked role to use the customer managed key.
-
Update the Auto Scaling group to use the service-linked role.
For an example of a key policy that lets the service-linked role use the customer managed key, see Example 1: Key policy sections that allow access to the customer managed key.
Cause 2: If the customer managed key and Auto Scaling group are in different AWS accounts, you need to configure cross-account access to the customer managed key in order to give permission to use the customer managed key to the proper service-linked role.
Solution 2: Allow the service-linked role in the external account to use the customer managed key in the local account as follows:
-
Update the key policy on the customer managed key to allow the Auto Scaling group account access to the customer managed key.
-
Define an IAM user or role in the Auto Scaling group account that can create a grant.
-
Determine which service-linked role to use for this Auto Scaling group.
-
Create a grant to the customer managed key with the proper service-linked role as the grantee principal.
-
Update the Auto Scaling group to use the service-linked role.
For more information, see Example 2: Key policy sections that allow cross-account access to the customer managed key.
Solution 3: Use a customer managed key in the same AWS account as the Auto Scaling group.
-
Copy and re-encrypt the snapshot with another customer managed key that belongs to the same account as the Auto Scaling group.
-
Allow the service-linked role to use the new customer managed key. See the steps for Solution 1.
We currently do not have sufficient <instance type> capacity in the Availability Zone you requested... Launching EC2 instance failed.
Error message: We currently do not have sufficient <instance type> capacity in the Availability Zone you requested (<requested Availability Zone>). Our system will be working on provisioning additional capacity. You can currently get <instance type> capacity by not specifying an Availability Zone in your request or choosing <list of Availability Zones that currently supports the instance type>. Launching EC2 instance failed.
Cause: At this time, the requested instance type and Availability Zone combination isn't supported.
Solution: To resolve the issue, try the following:
-
Wait a few minutes for Amazon EC2 Auto Scaling to find capacity for this instance type in other enabled Availability Zones.
-
Expand your Auto Scaling group to additional Availability Zones. For more information, see Add an Availability Zone.
-
Follow the best practice of using a diverse set of instance types so that you're not reliant on one specific instance type. For more information, see Auto Scaling groups with multiple instance types and purchase options.
The requested reservation does not have sufficient compatible and available capacity for this request. Launching EC2 instance failed.
Cause 1: You've reached the limit on the number
of instances that you can launch with a targeted
On-Demand Capacity
Reservation.
Solution 1: Either increase the number of
instances that you can launch with the targeted
On-Demand Capacity
Reservation, or use a Capacity Reservations group so that anything beyond the
reserved capacity will launch as regular On-Demand capacity. For more information,
see Reserve capacity in specific Availability Zones with Capacity Reservations
.
Cause 2: You've reached the limit on the number of instances that you can launch with a Capacity Block.
With Capacity Blocks, you are constrained by the amount of capacity originally purchased. If you experience a higher number of launches than anticipated and use up all the capacity that you have available, this causes launches to fail. Terminating instances go through a lengthy clean up process before they're fully terminated. During this time, they can't be reused. This can also cause launches to fail. For more information, see Use Capacity Blocks for machine learning workloads.
Solution 2: To resolve the issue, try the following:
-
Keep the request as is. If a Capacity Block instance is terminating, you must wait several minutes for the instance to finish terminating and capacity to become available again. Amazon EC2 Auto Scaling continues to automatically make the launch request until capacity becomes available.
-
Make sure that you purchase sufficient capacity to accommodate your peak workload so that you do not encounter this error frequently.
Your Capacity Block reservation <reservation id> is not active yet. Launching EC2 instance failed.
Cause: The specified Capacity Block is not active yet.
Solution: Follow the recommended approach for Capacity Blocks and use scheduled scaling. Doing so helps you make sure you increase the desired capacity of your Auto Scaling group only when the reservation is active and decrease it before the reservation is over.
There is no Spot capacity available that matches your request. Launching EC2 instance failed.
Cause: At this time, there isn't enough spare capacity to fulfill your request for Spot Instances.
Solution: To resolve the issue, try the following:
-
Wait a few minutes; capacity can shift frequently. Amazon EC2 Auto Scaling continues to automatically make the launch request until capacity becomes available.
-
Expand your Auto Scaling group to additional Availability Zones. For more information, see Add an Availability Zone.
-
Follow the best practice of using a diverse set of instance types so that you're not reliant on one specific instance type. For more information, see Auto Scaling groups with multiple instance types and purchase options.
<number of instances> instance(s) are already running. Launching EC2 instance failed.
Cause: You have reached the limit on the number of instances that you can launch in a Region. When you create your AWS account, we set default limits on the number of instances you can run on a per-Region basis.
Solution: To resolve the issue, try the following:
-
If your current limits aren't adequate for your needs, you can request a quota increase on a per-Region basis. For more information, see Amazon EC2 service quotas in the Amazon EC2 User Guide.
-
Submit a new request with a reduced number of instances (which you can increase at a later stage).