Amazon Elastic Compute Cloud
CLI Reference (API Version 2013-02-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...

ec2-migrate-bundle

Description

Copies a bundled AMI from one region to another.

Important

This tool is replaced by ec2-migrate-image.

 

During migration, Amazon EC2 replaces the kernel and RAM disk in the manifest file with a kernel and RAM disk designed for the destination region. Unless the --no-mapping parameter is given, the DescribeRegions and DescribeImages operations might be used to perform automated mappings. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB: A New Amazon Kernel Image in the Amazon Elastic Compute Cloud User Guide. To get the AMI tools, go to Amazon EC2 AMI Tools.  

Syntax

ec2-migrate-bundle -k private_key -c cert -a access_key_id -s secret_key --bucket source_s3_bucket --destination-bucket destination_s3_bucket --manifest manifest_path [--location location] [--ec2cert ec2_cert_path] [--kernel kernel-id] [--ramdisk ramdisk_id] [--no-mapping] [--region mapping_region_name]

Options

OptionDescription

-k, --privatekey private_key

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

Required: Yes

Example: -k pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem

-c, --cert cert

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

Required: Yes

Example: -c cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem

-a, --access-key access_key_id

The AWS access key ID.

Required: Yes

Example: -a AKIAIOSFODNN7EXAMPLE

-s, --secret-key secret_key

The AWS secret access key.

Required: Yes

Example: -s wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

-b, --bucket source_s3_bucket

The source Amazon S3 bucket where the AMI is located, followed by an optional '/'-delimited path prefix.

Required: Yes

Example: --bucket myawsbucket

-d, --destination-bucket destination_s3_bucket

The destination Amazon S3 bucket, followed by an optional '/'-delimited path prefix. If the destination bucket does not exist, it is created.

Required: Yes

Example: --destination-bucket myotherawsbucket

-m, --manifest manifest

The location of the Amazon S3 source manifest.

Default: None

Required: Yes

Example: --manifest my-ami.manifest.xml

--location location

The location of the destination Amazon S3 bucket.

If the bucket exists and the location is specified, the tool exits with an error. if the specified location does not match the actual location. If the bucket exists and no location is specified, the tool uses the bucket's location. If the bucket does not exist and the location is specified, the tool creates the bucket in the specified location. If the bucket does not exist and location is not specified, the tool creates the bucket without a location constraint (in the US).

Valid Values: US | EU | us-west-1 | ap-southeast-1

Default: US

Required: No

Example: --location EU

--acl {public-read | aws-exec-read}

The access control list policy of the bundled image.

Valid Values: public-read | aws-exec-read

Default: aws-exec-read

Required: No

Example: --acl public-read

--retry

Automatically retries on all Amazon S3 errors, up to five times per operation.

Required: No

Example: --retry

--kernel kernel_id

The ID of the kernel to select.

Required: No

Example: --kernel aki-ba3adfd3

--ramdisk ramdisk_id

The ID of the RAM disk to select.

Note

It is recommended that PV-GRUB be used instead of kernels and RAM disks. For more information, go to PV-GRUB: A New Amazon Kernel Image in the Amazon Elastic Compute Cloud User Guide.

Required: No

Example: --ramdisk ari-badbad00

--no-mapping

Disables automatic mapping of kernels and RAM disks.

Required: No

Example: --no-mapping

--region

Region to look up in the mapping file. If no region is specified, Amazon EC2 attempts to determine the region from the location of the Amazon S3 bucket.

Required: No

Example: --region eu-west-1

Output

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

Example

This example copies the AMI specified in the my-ami.manifest.xml manifest from the US to the EU.

$ ec2-migrate-bundle --cert cert-THUMBPRINT.pem --privatekey pk-THUMBPRINT.pem --access-key AKIAIOSFODNN7EXAMPLE --secret-key wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY --bucket myawsbucket --destination-bucket myotherawsbucket --manifest my-ami.manifest.xml --location EU
Downloading manifest my-ami.manifest.xml from myawsbucket to /tmp/ami-migration-my-ami.manifest.xml/my-ami.manifest.xml ...
Copying 'my-ami.part.00'...
Copying 'my-ami.part.01'...
Copying 'my-ami.part.02'...
Copying 'my-ami.part.03'...
Copying 'my-ami.part.04'...
Copying 'my-ami.part.05'...
Copying 'my-ami.part.06'...
Copying 'my-ami.part.07'...
Copying 'my-ami.part.08'...
Copying 'my-ami.part.09'...
Copying 'my-ami.part.10'...
Your new bundle is in S3 at the following location:
myotherawsbucket/my-ami.manifest.xml