Troubleshoot Amazon EC2 Auto Scaling: AMI issues
This page provides information about the issues associated with your AMIs, 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 due to issues with your AMI, you might get one or more of the following error messages.
AMI issues
- The AMI ID <ID of your AMI> does not exist. Launching EC2 instance failed.
- AMI <AMI ID> is pending, and cannot be run. Launching EC2 instance failed.
- Invalid device name <device name>. Launching EC2 instance failed.
- The architecture 'arm64 ' of the specified instance type does not match the architecture 'x86_64' of the specified AMI...Launching EC2 instance failed.
- AMI '<AMI ID>' is disabled, and cannot be run. Launching EC2 instance failed.
Important
AWS supports sharing an AMI privately with another AWS account by modifying the AMI permissions. If an AMI is made private without being shared, this can result in an authorization error when launching new instances. For more information about sharing private AMIs, see Share an AMI with specific AWS accounts in the Amazon EC2 User Guide.
The AMI ID <ID of your AMI> does not exist. Launching EC2 instance failed.
-
Cause: The AMI might have been deleted after creating the launch template or launch configuration.
-
Solution:
-
Create a new launch template or launch configuration using a valid AMI.
-
Update your Auto Scaling group with the new launch template or launch configuration using the update-auto-scaling-group command.
-
AMI <AMI ID> is pending, and cannot be run. Launching EC2 instance failed.
Cause: You might have just created your AMI (by taking a snapshot of a running instance or any other way), and it might not be available yet.
Solution: You must wait for your AMI to be available and then create your launch template or launch configuration.
Invalid device name <device name>. Launching EC2 instance failed.
Cause: When attaching an EBS volume to an EC2 instance, you must provide a valid device name for the volume. The selected AMI must support this device name.
Solution:
-
Create a new launch template or launch configuration and specify the correct device name for your AMI. The recommended naming convention varies based on the virtualization type of the AMI. For more information, see Device names 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.
The architecture 'arm64 ' of the specified instance type does not match the architecture 'x86_64' of the specified AMI...Launching EC2 instance failed.
Cause 1: If the architecture of the AMI and the instance type used in your launch template or launch configuration are not the same, you get an error when Amazon EC2 Auto Scaling tries to launch an instance using the incompatible instance configuration.
Solution 1:
-
Verify the architecture of your AMI using the describe-images command or from the Amazon EC2 console by checking the Architecture value on the details pane of the Amazon Machine Images (AMIs) page.
-
Find an instance type that has the same architecture as your AMI using the describe-instance-types command or from the Amazon EC2 console by checking the Architecture column on the Instance types screen. For more information about choosing a compatible instance type, see Compatibility for changing the instance type in the Amazon EC2 User Guide.
-
Create a new launch template or launch configuration using an instance type that has the same architecture as your AMI.
-
Update your Auto Scaling group with the new launch template or launch configuration using the update-auto-scaling-group command.
Cause 2: Amazon EC2 Auto Scaling tries to launch an instance type that's specified in the mixed instances policy for your Auto Scaling group, but the instance type does not have the same architecture as the AMI specified in your launch template.
Solution 1: Do not include instance types that have different architectures in your mixed instances policy.
-
Verify the architecture of your AMI using the describe-images command or from the Amazon EC2 console by checking the Architecture value on the details pane of the Amazon Machine Images (AMIs) page.
-
Verify the architecture of each instance type that you intend to include in your mixed instances policy using the describe-instance-types command or from the Amazon EC2 console by checking the Architecture column on the Instance types screen. For more information about choosing compatible instance types, see Compatibility for changing the instance type in the Amazon EC2 User Guide.
-
Update or remove the incompatible instance types from your Auto Scaling group using the update-auto-scaling-group command.
Solution 2: To launch both Arm (Graviton2) and x86_64 (Intel) instances in the same Auto Scaling group, you must use launch templates supported by an Arm-compatible AMI and an Intel x86-compatible AMI, respectively, to match the instance types in your mixed instances policy.
-
Verify the architecture of the AMI in your existing launch template using the describe-images command or from the Amazon EC2 console by checking the Architecture value on the details pane of the Amazon Machine Images (AMIs) page.
-
Create a new launch template using an AMI that matches the other architecture you intend to use.
-
Update your Auto Scaling group to override the existing launch template and specify the new launch template for each compatible instance type using the update-auto-scaling-group command. For more information, see Use a different launch template for an instance type.
AMI '<AMI ID>' is disabled, and cannot be run. Launching EC2 instance failed.
Cause: You are attempting to launch instances from an AMI that has been disabled. For more information, see Disable an AMI in the Amazon EC2 User Guide.
Solution:
-
Create a new launch template or launch configuration and specify an AMI that is not disabled.
-
Update your Auto Scaling group with the new launch template or launch configuration using the update-auto-scaling-group command.