Amazon Elastic Compute Cloud
API Reference (API Version 2011-12-15)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

RegisterImage

Description

Registers a new AMI with Amazon EC2. When you're creating an AMI, this is the final step you must complete before you can launch an instance from the AMI. For more information about creating AMIs, go to Creating Your Own AMIs in the Amazon Elastic Compute Cloud User Guide.

[Note]Note

For Amazon EBS-backed instances, the CreateImage operation creates and registers the AMI in a single request, so you don't have to register the AMI yourself.

You can also use the RegisterImage action to create an EBS-backed AMI from a snapshot of a root device volume. For more information, go to Launching an Instance from a Snapshot in the Amazon Elastic Compute Cloud User Guide.

If needed, you can deregister an AMI at any time. Any modifications you make to an AMI backed by Amazon S3 invalidates its registration. If you make changes to an image, deregister the previous image and register the new image.

Request Parameters

NameDescriptionRequired

ImageLocation

Full path to your AMI manifest in Amazon S3 storage.

Type: String

Default: None

Condition: Required if registering an Amazon-S3 backed AMI

Conditional

Name

A name for your AMI.

Type: String

Default: None

Constraints: 3-128 alphanumeric characters, parenthesis (()), commas (,), slashes (/), dashes (-), or underscores(_)

Yes

Description

The description of the AMI.

Type: String

Default: None

Constraints: Up to 255 characters.

No

Architecture

The architecture of the image.

Type: String

Valid Values: i386 | x86_64

Default: i386 for EBS backed AMIs. Instance store-backed AMIs will try to use the architecture specified in the manifest file.

No

KernelId

The ID of the kernel to select.

Type: String

Default: None

No

RamdiskId

The ID of the RAM disk to select. Some kernels require additional drivers at launch. Check the kernel requirements for information on whether you need to specify a RAM disk. To find kernel requirements, refer to the Resource Center and search for the kernel ID.

Type: String

Default: None

No

RootDeviceName

The root device name (e.g., /dev/sda1, or xvda).

Type: String

Default: None

Condition: Required if registering an Amazon EBS-backed AMI

Conditional

BlockDeviceMapping.n.DeviceName

The device name (e.g., /dev/sdh, or xvdh).

Type: String

Default: None

Condition: If registering an Amazon EBS-backed AMI from a snapshot, you must at least specify this field with the root device name (e.g., /dev/sda1, or xvda), and BlockDeviceMapping.n.Ebs.SnapshotId with the snapshot ID

Conditional

BlockDeviceMapping.n.VirtualName

The virtual device name.

Type: String

Default: None

No

BlockDeviceMapping.n.Ebs.SnapshotId

The ID of the snapshot.

Type: String

Default: None

Condition: If registering an Amazon EBS-backed AMI from a snapshot, you must at least specify this field with the snapshot ID, and BlockDeviceMapping.n.DeviceName with the root device name

Conditional

BlockDeviceMapping.n.Ebs.VolumeSize

The size of the volume, in GiBs.

Type: Integer

Default: None

Condition: Required if you are not creating a volume from a snapshot.

Conditional

BlockDeviceMapping.n.Ebs.NoDevice

Specifies that no device should be mapped.

Type: Boolean

Default: true

No

BlockDeviceMapping.n.Ebs.DeleteOnTermination

Whether the Amazon EBS volume is deleted on instance termination.

Type: Boolean

Default: true

No

Response Elements

The elements in the following table are wrapped in a RegisterImageResponse structure.

NameDescription

requestId

The ID of the request.

Type: xsd:string

imageId

Unique ID of the newly registered machine image.

Type: xsd:string

Examples

Example Request

This example registers the AMI specified in the my-new-image.manifest.xml manifest file, located in the bucket called mybucket.

https://ec2.amazonaws.com/?Action=RegisterImage
&ImageLocation=mybucket/my-new-image.manifest.xml
&AUTHPARAMS

Example Request

This example registers an Amazon EBS snapshot to create an AMI backed by Amazon EBS.

https://ec2.amazonaws.com/?Action=RegisterImage
&RootDeviceName=/dev/sda1 
&BlockDeviceMapping.1.DeviceName=/dev/sda1 
&BlockDeviceMapping.1.Ebs.SnapshotId=snap-6eba6e06 
&Name=MyImage
&AUTHPARAMS

Example Request

This example registers the AMI with an Amazon EBS snapshot as the root device, a separate snapshot as a secondary device, and an empty 100 GiB Amazon EBS volume as a storage device.

https://ec2.amazonaws.com/?Action=RegisterImage
&RootDeviceName=/dev/sda1
&BlockDeviceMapping.1.DeviceName=/dev/sda1
&BlockDeviceMapping.1.Ebs.SnapshotId=snap-6eba6e06
&BlockDeviceMapping.2.DeviceName=/dev/sdb
&BlockDeviceMapping.2.Ebs.SnapshotId=snap-823ea6df
&BlockDeviceMapping.3.DeviceName=/dev/sdc
&BlockDeviceMapping.3.Ebs.VolumeSize=100
&Name=MyImage
&AUTHPARAMS

Example Response

<RegisterImageResponse xmlns="http://ec2.amazonaws.com/doc/2011-12-15/">
  <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> 
  <imageId>ami-78a54043</imageId>
</RegisterImageResponse>