| Did this page help you? Yes No Tell us about it... |
Creates a bundled AMI by compressing, encrypting and signing a snapshot of the local machine's root file system.
To use ec2-bundle-vol, first you
must install the AMI tools on the instance you are bundling,
then run ec2-bundle-vol on that
instance, not on a local system. For information about getting
the AMI tools, go to Amazon EC2 AMI Tools.
![]() | 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. On a running instance, Amazon EC2 attempts to inherit product codes, kernel settings, RAM disk settings, and block device mappings with which the instance launched. |
ec2-bundle-vol -k
private_key -u
user_id -c
cert -r
architecture [-s
size] [-d
destination] [-e
exclude_directory_1,exclude_directory_1,...]
[-p ami_prefix] [-v
volume] [--ec2cert
cert_path] [--fstab
fstab_path]
[--generate-fstab] [--kernel
kernel-id] [--ramdisk
ramdisk_id]
[--block-device-mapping
block_device_mapping]
[--[no-]inherit] [--productcodes
product_code]
| Option | Description | Required |
|---|---|---|
|
|
The path to the user's PEM-encoded RSA key file. Example: |
Yes |
|
|
The user's AWS account ID without dashes. Do not use the Access Key ID. Example: |
Yes |
|
|
The user's PEM encoded RSA public key certificate file. Example: |
Yes |
|
|
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: Example: |
Yes |
|
|
The size, in MB (1024 * 1024 bytes), of the image file to create. The maximum size is 10240 MB. Default: 10240 Example: |
No |
|
|
The directory in which to create the bundle. Default: Example: |
No |
|
|
A list of absolute directory paths and
files to exclude from the bundle operation.
This parameter overrides the Example: Assuming the mount point of the volume is |
No |
|
|
A list of files to include in the bundle operation. This option overrides the exclusion of files that are by default filtered out because they might contain sensitive information. Use this option to explicitly include a file that might contain sensitive data — i.e., '*.sw', '*.swo', '*.swp', '*.pem', '*.priv', '*.gpg', '*.jks', '*/.ssh/authorized_keys', '*/.bash_history'. The files listed with the parameter will be bundled with the volume. Example: Assuming the mount point of the volume is |
No |
|
|
The filename prefix for bundled AMI files. Default: Example: |
No |
|
|
The absolute path to the mounted volume from which to create the bundle. Default: The root directory (/) Example: |
No |
|
|
Bundle all directories, including those on remotely mounted filesystems. Example: |
No |
|
|
The path to the Amazon EC2 X.509 public key certificate. Default:
Example: |
No |
|
|
The path to the fstab to bundle into the image. If this is not specified, Amazon EC2 bundles /etc/fstab. Example: |
No |
|
|
Causes Amazon EC2 to bundle the volume using an Amazon EC2-provided fstab. Example:
|
No |
|
|
The ID of the kernel to select. Example: |
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 the kernel requirements, go to the Resource Center and search for the kernel ID. Example: |
No |
|
|
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:
Example: Example: |
No |
|
|
Whether the image should inherit the instance's metadata (the default is to inherit). Bundling will fail if you enable inherit but the instance metadata is not accessible. Example:
|
No |
|
|
Product code to attach to the image at registration time. Example: |
No |
Status messages describing the stages and status of the bundling.
This example creates a bundled AMI by compressing, encrypting and signing a snapshot of the local machine's root file system.
$ec2-bundle-vol -d /mnt -k pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem -c cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem -u 111122223333 -r x86_64Copying / into the image file /mnt/image... Excluding: sys dev/shm proc dev/pts proc/sys/fs/binfmt_misc dev media mnt proc sys tmp/image mnt/img-mnt 1+0 records in 1+0 records out mke2fs 1.38 (30-Jun-2005) warning: 256 blocks unused. Splitting /mnt/image.gz.crypt... Created image.part.00 Created image.part.01 Created image.part.02 Created image.part.03 ... Created image.part.22 Created image.part.23 Generating digests for each part... Digests generated. Creating bundle manifest... Bundle Volume complete.