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

3 minute read
0

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, follow these steps:

  1. Open the EC2 console.
    Note: Be sure to select the AWS Region that you want to launch the instance in.
  2. In the navigation pane, choose EC2 Dashboard, and then choose Launch instance.
  3. Under Names and tags, for Name, enter a name for your instance.
  4. Under Application and OS Images (Amazon Machine Image), find the AMI that you want to use to launch a new instance:
    To search for the custom AMI, enter the name of the custom AMI in the search bar.
    To use a custom AMI that you created, choose Browse more AMIs, choose My AMIs, and then choose Owned by me.
    To use a custom AMI that was shared with you, choose Browse more AMIs, choose My AMIs, and then choose Shared with me.
  5. Under Instance type, choose an instance type.
  6. Under Key pair (login), for Key pair name, choose a key pair. Or, create a new one.
  7. (Optional) Under Network settings, choose Edit, and then choose your VPC and Subnet.
  8. (Optional) Under Configure storage, choose your GiB and Root volume size.
  9. Under Summary, choose Launch instance.
  10. Choose View all Instances to check the status of your instance.

Troubleshoot errors or issues after you launch the custom AMI

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

This error might occur when you don't use Sysprep with a custom Windows AMI to launch the instance. Wait a few minutes, and then try to launch the instance again. Or, reset the administrator password on the EC2 Windows instance.

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

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

Make sure that the AMI ID is correct and that you launched the custom AMI in the correct AWS Region. If you created the custom AMI in the wrong AWS Region, then copy it to another AWS Region.

If you copied the custom AMI and 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. You can share custom AMIs with encrypted snapshots that use only a customer managed key.

Note: If users in another AWS account want to copy a shared AMI, then you must grant them read permissions for the storage that backs the AMI. For more information, see Cross-account copying.

Driver issues

To avoid driver install issues, manually install or upgrade drivers for the instance type. For more information, see Migrate to latest generation instance types.

Note: You can also use the AWSSupport-UpgradeWindowsAWSDrivers automation runbook to install or upgrade drivers.

Instance status check failures

If the instance received a status check failure after you launched the custom AMI, then the instance might require additional configuration. To troubleshoot, see Why is my EC2 Windows instance down with an instance status check failure?

Related information

Instances and AMIs

Amazon Machine Images (AMI)

AWS OFFICIAL
AWS OFFICIALUpdated 6 months ago
2 Comments

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

Dhrupal
replied a year ago

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

profile pictureAWS
MODERATOR
replied a year ago