Amazon Elastic Compute Cloud
CLI 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...

ec2-bundle-image

Description

Create a bundled AMI from an operating system image created in a loopback file. For more information, go to the Amazon Elastic Compute Cloud User Guide.

[Note]Note

Scripts that require a copy of the public key from the launch key pair must obtain the key from the instance's metadata (not the key file in the instance store) for instances bundled with the 2007-08-29 AMI tools and later. AMIs bundled before this release will continue to work normally.

Syntax

ec2-bundle-image -k private_key -c cert -u user_id -i image_path -r {i386 | x86_64} [-d destination] [-p ami_prefix] [--ec2cert cert_path] [--kernel kernel-id] [--ramdisk ramdisk_id] [--block-device-mapping block_device_mapping]

Options

OptionDescriptionRequired

-k, --privatekey private_key

The path to the user's PEM-encoded RSA key file.

Example: -k pk-HKZYKTAIG2ECMXYIBH3HXV4ZBZQ55CLO.pem

Yes

-c, --cert cert

The user's PEM encoded RSA public key certificate file.

Example: -c cert-HKZYKTAIG2ECMXYIBH3HXV4ZBZQ55CLO.pem

Yes

-u, --user user_id

The user's AWS account ID without dashes. Do not use the Access Key ID.

Example: -u 999988887777

Yes

-i, --image image_path

The path to the image to bundle.

Example: -i /var/spool/my-image/version-2/debian.img

Yes

-r, --arch architecture

Image architecture. If you don't provide this on the command line, you'll be prompted to provide it when the bundling starts.

Valid Values: i386 | x86_64

Example: -r x86_64

Yes

-d, --destination destination

The directory in which to create the bundle.

Default: /tmp

Example: -d /var/run/my-bundle

No

-p, --prefix ami_prefix

The filename prefix for bundled AMI files.

Default: The name of the image file. For example, if the image path is /var/spool/my-image/version-2/debian.img, then the default prefix is debian.img.

Example: -p my-image-is-special

No

--ec2cert cert_path

The path to the Amazon EC2 X.509 public key certificate.

Default: /etc/ec2/amitools/cert-ec2.pem (varies, depending on tools)

Example: --ec2cert /etc/ec2/amiutil/cert-ec2.pem

No

--kernel kernel_id

The ID of the kernel to select.

Default: 2.6.16-xenU

Example: --kernel aki-ba3adfd3

No

--ramdisk ramdisk_id

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 Resource Center and search for the kernel ID.

Example: --ramdisk ari-badbad00

No

--block-device-mapping mappings

Default block-device-mapping scheme with which to launch the AMI. This defines how block devices are exposed to an instance of this AMI if the instance type supports the specified device.

The scheme is a comma-separated list of key=value pairs, where each key is a virtual name and each value is the desired device name. Virtual names include:

  • ami—The root file system device, as seen by the instance

  • root—The root file system device, as seen by the kernel

  • swap—The swap device, as seen by the instance

  • ephemeralN—The Nth ephemeral store

Example: --block-device-mapping ami=sda1,root=/dev/sda1,ephemeral0=sda2,swap=sda3

Example: --block-device-mapping ami=0,root=/dev/dsk/c0d0s0,ephemeral0=1

No

Output

Status messages describing the stages and status of the bundling process.

Example

This example creates a bundled AMI from an operating system image that was created in a loopback file.

$ ec2-bundle-image -k pk-HKZYKTAIG2ECMXYIBH3HXV4ZBZQ55CLO.pem -c cert-HKZYKTAIG2ECMXYIBH3HXV4ZBZQ55CLO.pem -u 999988887777 -i image.img -d bundled/ -p fred -r x86_64
Please specify a value for arch [i386]: 
Bundling image file...
Splitting bundled/fred.gz.crypt...
Created fred.part.00
Created fred.part.01
Created fred.part.02
Created fred.part.03
Created fred.part.04
Created fred.part.05
Created fred.part.06
Created fred.part.07
Created fred.part.08
Created fred.part.09
Created fred.part.10
Created fred.part.11
Created fred.part.12
Created fred.part.13
Created fred.part.14
Generating digests for each part...
Digests generated.
Creating bundle manifest...
ec2-bundle-image complete.