I want to launch an Amazon Elastic Compute Cloud (Amazon EC2) instance from an Amazon Machine Image (AMI). However, the instance type that I want to launch is unavailable.
Short description
AWS Graviton processors use the aarch64 (ARM64) architecture instead of the x86_64 (AMD64) architecture. The following are some of the instance types that use AWS Graviton processors:
- General Purpose (M7g, M6g, A1, T4g)
- Compute Optimized (C7g, C7gn, C6g, C6gn)
- Memory Optimized (R7g, R6g, X2gd)
- Accelerated Computing (G5g)
- Storage Optimized (Im4gn, Is4gen)
Aarch64 architecture uses a different set of CPU instructions than the x86_64 architecture type. The following resolution provides a mechanism for how to send commands to the processor. During software compilation, the human-readable software code converts to CPU instructions that are specific to a CPU architecture. Any CPU of that architecture type can use these CPU instructions. However, the CPU of one architecture type can't understand the instruction set of another type. An AMI that's compiled from one architecture runs on only the CPUs of that architecture type.
EC2 instances and AMIs that are created through the x86_64 architecture aren't compatible with instances that use the aarch64 architecture. When you launch or change instance types, the incompatibility might cause one of the following to happen:
- When you launch an AWS Graviton instance type with your selected Amazon EC2 AMI, the launch instance wizard might show the new instance types as unavailable.
- When you change the instance type of an already deployed EC2 instance that doesn't use the new architecture type, you might receive the following error:
"'m6g.large' is not a valid instance type for instance 'i-xyz' of architecture 'x86_64'".
To use a different architecture, complete the following steps:
- Create a new EC2 instance or AMI.
- Migrate the application to the new EC2 instance.
Note: An AMI might be incompatible with your instance type without enhanced networking turned on. For more information, see How do I turn on and configure enhanced networking on my EC2 instances?
Resolution
Create a new EC2 instance or AMI
All major Linux distributions are available on ARM architecture. To launch an instance that uses ARM architecture, complete the following steps:
- Open the Amazon EC2 console.
- Choose Instances, and then choose Launch instances.
- From the Architecture dropdown menu, next to the AMI that corresponds to the ARM version of your distribution, choose 64-bit (ARM).
- Complete the launch of the instance.
Migrate the application to a new EC2 instance
Note: Because of the different instruction sets, a direct instance type change isn't possible between architecture types.
To migrate your system to the new architecture, complete the following steps:
- Launch a new EC2 instance for your chosen configuration.
- Migrate to the new instance type.
Related information
AWS Graviton processors