Amazon EC2 AMI Tools

Developer Tools>Amazon EC2>Amazon EC2 AMI Tools
Community Contributed Software

  • Amazon Web Services provides links to these packages as a convenience for our customers, but software not authored by an "@AWS" account has not been reviewed or screened by AWS.
  • Please review this software to ensure it meets your needs before using it.

The Amazon EC2 AMI Tools are command-line utilities to bundle an Amazon Machine Image (AMI), create an AMI from an existing machine or installed volume, and upload a bundled AMI to Amazon S3.

Details

Submitted By: Max@AWS
AWS Products Used: Other
Languages(s): Other
License: http://aws.amazon.com/asl/
Created On: August 25, 2006 7:56 PM GMT
Last Updated: May 7, 2014 11:13 PM GMT

Download

Download the latest Amazon EC2 AMI Tools from Amazon S3:

The Amazon EC2 AMI Tools are available in the Amazon Linux AMI repositories as the aws-amitools-ec2 package.

Archived previous versions:

  • Version 1.4.0.9 -- ZIP or RPM.

Changelog

Version 1.5.3

  • Fixed ec2-upload-bundle behavior when the upload bucket doesn't exist.
  • ec2-upload-bundle now works with S3 buckets that contain dots '.'
  • Removed dependency on 'which' shell builtin.

Version 1.5.2

  • We have added support for the China (Beijing) region.
  • We have added support for rebundling partitioned images. MBR/GPT partitioned AMIs may now be rebundled, which means that supported instance-store HVM AMIs may now be rebundled.
  • Users can now execute an arbitrary script via the --script flag. This script is executed after image cloning has been completed. An example use case would be a complex find command used to remove specific files from the cloned image before bundling begins.
  • For example, if we had a bash script named rm-priv.sh with the following contents:

    #!/bin/bash
    mnt_dir="${1}"
    find "${mnt_dir}" -type f -name "*.priv" -exec rm -f {} \;
    
    We could use it like this:

    sudo ec2-bundle-vol -arch x86_64 --user XXXXXXXXXXXX --cert cert.pem --privatekey pk.pem --script /home/ec2-user/rm-priv.sh

  • The EC2 AMI Tools should run as expected on systems with either Ruby 1.8, Ruby 1.9, or Ruby 2.0.
  • Fixed bugs with --include and --exclude wildcard behavior. For example, sudo ec2-bundle-vol --arch x86_64 --user XXXXXXXXXXXX --cert cert.pem --privatekey pk.pem --exclude /root/.ssh,/home/ec2-user/.ssh --include "/home/ec2-user/files/*.pem"
  • We have added a --clone-only flag to ec2-bundle-vol. This allows users to stop the bundling procedure right after a copy of the user-specified volume has been created, and is useful for debugging if an image isn't bundling properly.
  • We have added --grub-config to ec2-bundle-vol. This enables specifying a specific grub configuration file to use during bundling, and is an alternative to directly editing the instance's grub configuration. At this time, only legacy grub(0.97) configuration files are supported.
  • This version of the tools has been used to successfully re-bundle Amazon Linux AMI 2013.03 & 2013.09, Ubuntu 12.04 LTS, CentOS 6.4, SLES 11 SP3, and RHEL 6.4 (with SELinux disabled).

Known Issues

  • When rebundling EBS-backed HVM AMIs as instance-store, use --block-device-mapping ami=sda,root=/dev/sda1,ephemeral0=sdb,ephemeral1=sdc,ephemeral2=sdd,ephemeral3=sde
  • The EC2 AMI Tools will fail to generate a bootable image on systems that have SELinux enabled, due to permission errors at boot time. SELinux will need to be disabled before the bundling process begins, and a reboot will be required.

Questions or Issues?

Please review the AMI Creation Guide or post a message to the EC2 forum, and we will be happy to assist.

License Notice

Copyright 2008 Amazon.com, Inc. or its affiliates. All Rights Reserved. All of the code, software libraries, applications, updates, tools, and other information and materials made available for download from this web page ("Software") are licensed under the Amazon Software License (the "License"). You may not use the Software except in compliance with the License. A copy of the License is located at http://aws.amazon.com/asl/ or in the "license" file accompanying the Software. The Software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.