|« PreviousNext »|
|Did this page help you? Yes | No | Tell us about it...|
To create an Amazon EBS-backed Linux AMI, start from an instance that you've launched from an existing Amazon EBS-backed Linux AMI. After you've customized the instance to suit your needs, create and register a new AMI, which you can use to launch new instances with these customizations.
If you'd prefer to create an Amazon EBS-backed Windows AMI, see Creating an Amazon EBS-Backed Windows AMI in the Amazon Elastic Compute Cloud Microsoft Windows Guide.
The AMI creation process is different for instance store-backed AMIs. For more information about the differences between Amazon EBS-backed and instance store-backed instances, see Storage for the Root Device. To learn about creating an instance store-backed Linux AMI, see Creating an Instance Store-Backed Linux AMI.
The following diagram summarizes the creation process for Amazon EBS-backed AMIs.
First, launch an instance from an AMI that's similar to the AMI that you'd like to create. You can connect to your instance and customize it. When the instance is set up the way you want it, it's best to stop the instance before you create an AMI to ensure data integrity. Then, you can create the image. When you create an Amazon EBS-backed AMI, we automatically register it for you.
Amazon EC2 powers down the instance before creating the AMI to ensure that everything on the instance is stopped and in a consistent state during the creation process. If you're confident that your instance is in a consistent state appropriate for AMI creation, you can tell Amazon EC2 not to power down and reboot the instance. Some file systems, such as xfs, can freeze and unfreeze activity, making it safe to create the image without rebooting the instance.
It takes several minutes for the entire AMI creation process to complete. After the process completes, you have a new AMI and snapshot created from the root volume of the instance. When you launch an instance using the new AMI, we create a new EBS volume for its root volume using the snapshot. Both the AMI and the snapshot incur charges to your account until you delete them. For more information, see Deregistering Your AMI.
If you add instance-store volumes or EBS volumes to your instance in addition to the root device volume, the block device mapping for the new AMI contains information for these volumes, and the block device mappings for instances that you launch from the new AMI automatically contain information for these volumes. The instance-store volumes specified in the block device mapping for the new instance are new and don't contain any data from the instance store volumes of the instance you used to create the AMI. The data on Amazon EBS volumes persists. For more information, see Block Device Mapping.
To create an AMI from an instance using the console
Open the Amazon EC2 console.
If you don't have a running instance that uses an Amazon EBS volume for the root device, you must launch one. For instructions, see Launching an Instance.
(Optional) Connect to the instance and customize it. For example, you can install software and applications, copy data, or attach additional EBS volumes. For more information about connecting to an instance, see Connect to Your Amazon EC2 Instance.
In the navigation pane, click Instances and select your instance. Click Actions and then click Create Image.
If this option is disabled, your instance isn't an Amazon EBS-backed instance.
In the Create Image dialog box, specify the following, and then click Create Image.
A unique name for the image.
(Optional) A description of the image, up to 255 characters.
By default, Amazon EC2 shuts down the instance, takes snapshots of any attached volumes, creates and registers the AMI, and then reboots the instance. Select No reboot if you don't want your instance to be shut down.
If you select No reboot, we can't guarantee the file system integrity of the created image.
(Optional) You can modify the root volume, EBS volumes, and instance store volumes as follows:
To change the size of the root volume, locate the Root volume in the Type column, and fill in the Size field.
To suppress an EBS volume specified by the block device mapping of the AMI used to launch the instance, locate the EBS volume in the list and click Delete.
To add an EBS volume, click Add New Volume, select EBS from the Type list, and fill in the fields. When you then launch an instance from your new AMI, these additional volumes are automatically attached to the instance. Empty volumes must be formatted and mounted. Volumes based on a snapshot must be mounted.
To suppress an instance store volume specified by the block device mapping of the AMI used to launch the instance, locate the volume in the list and click Delete.
To add an instance store volume, click Add New Volume, select Instance Store from the Type list, and select a device name from the Device list. When you launch an instance from your new AMI, these additional volumes are automatically initialized and mounted. These volumes don't contain data from the instance store volumes of the running instance from which you based your AMI.
Click AMIs in the navigation pane to view the status of your AMI. While the
new AMI is being created, its status is
pending. This process typically takes a few minutes
to finish, and then the status of your AMI is
(Optional) Click Snapshots in the navigation pane to view the snapshot that was created for the new AMI. When you launch an instance from this AMI, we use this snapshot to create its root device volume.
If you have a snapshot of the root device volume of an instance, you can launch an instance from this snapshot.
To create an AMI from a snapshot using the console
Open the Amazon EC2 console.
In the navigation pane, under Elastic Block Store, click Snapshots.
Select the snapshot and click Create Image.
In the Create Image from EBS Snapshot dialog box, select the architecture
i386 for 32-bit or
x86_64 for 64-bit), and then click Yes, Create.