Skip to content

How do I launch an EC2 instance from a custom AMI?

4 minute read
1

I want to launch an Amazon Elastic Compute Cloud (Amazon EC2) instance from a custom Amazon Machine Image (AMI).

Resolution

To launch a new EC2 instance from an custom AMI, complete the following steps:

  1. Open the Amazon EC2 console.
    Note: Make sure to select the AWS Region where the AMI resides. To launch an instance from an AMI in another Region, copy the AMI to the target Region. Then, use the copied AMI to launch the instance.
  2. In the navigation pane, choose AMIs.
  3. Select the target custom AMI.
    To use a custom AMI that you created, choose Owned by me, and then select the AMI.
    To use a custom AMI that someone shared with you, choose Shared with me, and then select the AMI.
    Note: To filter results, use the filter search bar to enter the AMI ID, AMI Name, or other criteria in.
  4. Choose Launch instance from AMI.
  5. Under Names and tags, for Name, enter a name for your instance.
  6. Under Instance type, choose an instance type.
  7. Under Key pair (login), for Key pair name, choose a key pair. Or, create a new one.
  8. (Optional) Under Network settings, choose Edit, and then select your virtual private cloud (VPC), subnet, and security group. Or, create a new security group.
  9. (Optional) Under Configure storage, configure your GiB and root volume size.
  10. (Optional) Under Advanced details, choose options such as IAM instance profile to attach an AWS Identity and Access Management (IAM) role to the instance.
  11. Under Summary, choose Launch instance.
  12. To check the status of your instance, choose Instances in the navigation bar. Or, select the instance ID.

Troubleshoot issues that occur after you launch the custom AMI

(Windows only) Troubleshoot the "Password not available yet" error

If you don't use Sysprep to create the custom Windows AMI to launch the instance, then you might receive the following error message:

"Password is not available yet. Please wait at least 4 minutes after launching an instance before trying to retrieve the auto-generated password."

To troubleshoot this issue, see Why can't I connect to my EC2 Windows instance that I launched from a custom AMI?

To create a reusable custom Windows AMI, see How do I use Sysprep to create and install custom reusable Windows AMIs?

Troubleshoot the "AMI may no longer exist" error

You might receive an error message similar to the following example:

"The AMI may no longer exist or may be specific to another account or region."

To troubleshoot this issue, make sure that the AMI ID is correct and that you launched the custom AMI in the correct Region. If you created the custom AMI in the incorrect Region, then copy the AMI to the correct Region.

If you copied the custom AMI and still can't launch the instance, then see Why can't I launch EC2 instances from my copied AMI?

Shared custom AMIs with encrypted snapshots

You can't share AMIs with encrypted snapshots that use the default AWS managed key. To share custom AMIs with encrypted snapshots, the AMI must use a customer-managed key.

Note: If users in another AWS account want to copy a shared AMI, then you must grant them read permissions to the storage that backs the AMI.

Troubleshoot driver issues

If the source instance is Xen-based but the new instance is Nitro, then migrate to the latest generation type to avoid driver install issues.

For EC2 Windows instances, you can use the AWSSupport-UpgradeWindowsAWSDrivers automation runbook to install or upgrade drivers on your instance.

Troubleshoot instance status check failures

If the instance fails a status check after you launch the custom AMI, then the instance might require additional configuration. To troubleshoot this issue for a Windows instance, see Why is my EC2 Windows instance down with an instance status check failure? For a Linux instance, see How do I troubleshoot status check failures for my EC2 Linux instance?

Related information

Amazon Machine Images in Amazon EC2

2 Comments

Is it mandatory to choose current region, or we can use any location?

replied 3 years ago

Thank you for your comment. We'll review and update the Knowledge Center article as needed.

AWS
EXPERT
replied 3 years ago