ec2-bundle-image

ec2-bundle-image -k private_key -c ec2_cert -u user_id -i image_path -r {i386 | x86_64} [-d destination] [-p ami_prefix] [-b, --batch] [--kernel kernel-id] [--ramdisk ramdisk_id] [--block-device-mappingblock_device_mapping]

Create a bundled AMI from an operating system image created in a loopback file. For more information, see Creating an AMI through a Loopback File.

[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 ephemeral store) for instances bundled with the 2007-08-29 AMI tools and later. AMIs bundled before this release will continue to work normally.

[Note]Note

This tool does not support the Common 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 ec2_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 number without dashes. Do not use the Access Key ID.

Example: -u 495219933132

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 {i386 | x86_64}

Specifies 32-bit (m1.small) or 64-bit architecture (m1-large and m1-xlarge).

Default: None

Example: -r x86_64

Yes

-d, --destination destination

The directory in which to create the bundle.

Default: The current directory

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

No

-p, --prefix ami_prefix

The filename prefix for bundled AMI files.

Default: image

Example: -p my-image-is-special

No

--help

Display the help message.

Example: --help

No

--manual

Display the manual entry.

Example: --manual

No

-b, --batch

Runs without interaction and suppresses all warnings. Will attempt to automatically determine architecture.

Example: -b

No

--kernel kernel_id

The ID of the kernel to select. For information on finding available kernel IDs, see ec2-describe-images.

Example: 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: ari-badbad00

No

--block-device-mappings mappings

Specifies how block devices are exposed. .

Virtual name example: ephemeral0

Device name example: sdb

No

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

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 495219933132 -i image.img -d bundled/ -p fred -r x86_64
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...
Bundle Image complete.