RegisterImage
Description
Registers an AMI with Amazon EC2. Images must be registered before they can be launched. To launch instances, use the RunInstances
operation.
Each AMI is associated with an unique ID which is provided by the Amazon EC2 service through this operation. If needed, you can deregister an AMI at any time.
Note | |
---|---|
AMIs backed by Amazon EBS are automatically registered when you create the image. However, you can use this to register a snapshot of an instance backed by Amazon EBS. Amazon EBS snapshots are not guaranteed to be bootable. For information on creating AMIs backed by Amazon EBS, go to the |
Any modifications to an AMI backed by Amazon S3 invalidates this registration. If you make changes to an image, deregister the previous image and register the new image.
Request Parameters
Name | Description | Required |
---|---|---|
|
Type: RegisterImageType Ancestor: None Children: |
|
|
Full path to your AMI manifest in Amazon S3 storage. Type: xsd:string Default: None Ancestor: Children: None |
No |
|
The name of the AMI that was provided during image creation. Type: xsd:string Default: None Constraints: 3-128 alphanumeric characters, parenthesis (()), commas (,), slashes (/), dashes (-), or underscores(_) Ancestor: Children: None |
Yes |
|
The description of the AMI. Type: xsd:string Default: None Constraints: Up to 255 characters. Ancestor: Children: None |
No |
|
The architecture of the image. Type: xsd:string Valid Values: Default: None Ancestor: Children: None |
No |
|
The ID of the kernel to select. Type: xsd:string Default: None Ancestor: Children: None |
No |
|
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, go to the Type: xsd:string Default: None Ancestor: Children: None |
No |
|
The root device name (e.g., /dev/sda1). Type: xsd:string Default: None Ancestor: Children: None |
No |
|
Specifies how block devices are exposed to the instance. Each mapping is made up of a virtualName and a deviceName. Type: BlockDeviceMappingType Ancestor: Children: |
No |
|
Information for one block device mapping. Type: BlockDeviceMappingItemType Ancestor: Children: |
|
|
The device name (e.g., /dev/sdh). Type: xsd:string Default: None Ancestor: Children: None |
No |
|
The virtual device name. Type: xsd:string Default: None Ancestor: Children: None |
No |
|
Specifies parameters used to automatically setup Amazon EBS volumes when the instance is launched. Type: EbsBlockDeviceType Ancestor: Children: |
Yes |
|
The ID of the snapshot. Type: xsd:string Default: None Ancestor: Children: None |
No |
|
The size of the volume. Type: xsd:string Default: None Ancestor: Children: None |
No |
|
Specifies whether the Amazon EBS volume is deleted on instance termination. Type: xsd:boolean Default: true Ancestor: Children: None |
No |
|
Specifies the device name to suppress during instance launch. Type: EmptyElementType Ancestor: Children: |
No |
|
This element contains no options. Type: xsd:string Default: None Ancestor: Children: None |
No |
Response Elements
Name | Description |
---|---|
|
Type: RegisterImageResponseType Ancestor: None Children: |
|
The ID of the request. Type: xsd:string Ancestor: Children: None |
|
Unique ID of the newly registered machine image. Type: xsd:string Ancestor: Children: None |
Examples
Example Request
This example registers the AMI specified in the image.manifest.xml
manifest file.
<RegisterImage xmlns="http://ec2.amazonaws.com/doc/2009-10-31/"> <imageLocation>/mybucket/myimage.manifest.xml</imageLocation> </RegisterImage>
Example Response
<RegisterImageResponse xmlns="http://ec2.amazonaws.com/doc/2009-10-31/"> <imageId>ami-61a54008</imageId> </RegisterImageResponse>
Example Request
This example registers an Amazon EBS snapshot to create an AMI backed by Amazon EBS.
<RegisterImage xmlns="http://ec2.amazonaws.com/doc/2009-10-31/"> <name>MyImage</name> <kernelId>aki-f70657b2</kernelId> <ramdiskId>ari-ff0d5cba</ramdiskId> <rootDeviceName>/dev/sda1</rootDeviceName> <blockDeviceMapping> <item> <deviceName>/dev/sda1</deviceName> <ebs> <snapshotId>snap-6eba6e06</snapshotId> </ebs> </item> </blockDeviceMapping> </RegisterImage>
Example Response
<RegisterImageResponse xmlns="http://ec2.amazonaws.com/doc/2009-10-31/"> <imageId>ami-78a54023</imageId> </RegisterImageResponse>
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.
<RegisterImage xmlns="http://ec2.amazonaws.com/doc/2009-10-31/"> <name>MyImage</name> <rootDeviceName>/dev/sda1</rootDeviceName> <blockDeviceMapping> <item> <deviceName>/dev/sda1</deviceName> <ebs> <snapshotId>snap-6eba6e06</snapshotId> </ebs> </item> <item> <deviceName>/dev/sdb</deviceName> <ebs> <snapshotId>snap-823ea6df</snapshotId> </ebs> </item> <item> <deviceName>/dev/sdc</deviceName> <ebs> <volumeSize>100</volumeSize> </ebs> </item> </blockDeviceMapping> </RegisterImage>
Example Response
<RegisterImageResponse xmlns="http://ec2.amazonaws.com/doc/2009-10-31/"> <imageId>ami-78a54043</imageId> </RegisterImageResponse>