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 |
---|---|---|
|
Full path to your AMI manifest in Amazon S3 storage. Type: String Default: None |
No |
|
The name of the AMI that was provided during image creation. Type: String Default: None Constraints: 3-128 alphanumeric characters, parenthesis (()), commas (,), slashes (/), dashes (-), or underscores(_) |
Yes |
|
The description of the AMI. Type: String Default: None Constraints: Up to 255 characters. |
No |
|
The architecture of the image. Type: String Valid Values: Default: None |
No |
|
The ID of the kernel to select. Type: String Default: 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: String Default: None |
No |
|
The root device name (e.g., /dev/sda1). Type: String Default: None |
No |
|
The device name (e.g., /dev/sdh). Type: String Default: None |
No |
|
The virtual device name. Type: String Default: None |
No |
|
The ID of the snapshot. Type: String Default: None |
No |
|
The size of the volume. Type: String Default: None |
No |
|
Specifies whether the Amazon EBS volume is deleted on instance termination. Type: Boolean Default: true |
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.
https://ec2.amazonaws.com/?Action=RegisterImage&ImageLocation=mybucket-myimage.manifest.xml&AuthParams
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.
https://ec2.amazonaws.com/?Action=RegisterImage&RootDeviceName=%2Fdev%2Fsda1&BlockDeviceMapping.1.DeviceName=%2Fdev%2Fsda1&BlockDeviceMapping.1.Ebs.SnapshotId=snap-6eba6e06&Name=MyImage&AuthParams
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.
https://ec2.amazonaws.com/?Action=RegisterImage&RootDeviceName=%2Fdev%2Fsda1&BlockDeviceMapping.1.DeviceName=%2Fdev%2Fsda1&BlockDeviceMapping.1.Ebs.SnapshotId=snap-6eba6e06&BlockDeviceMapping.2.DeviceName=%2Fdev%2Fsdb&BlockDeviceMapping.2.Ebs.SnapshotId=snap-823ea6df&BlockDeviceMapping.3.DeviceName=%2Fdev%2Fsdbc&BlockDeviceMapping.3.Ebs.VolumeSize=100&Name=MyImage&AuthParams
Example Response
<RegisterImageResponse xmlns="http://ec2.amazonaws.com/doc/2009-10-31/"> <imageId>ami-78a54043</imageId> </RegisterImageResponse>