Amazon Elastic Compute Cloud Developer Guide Using the AMI Tools Invoking a utility with the --help parameter displays a summary and list of command line parameters. For example: # ec2-bundle-image --help Using the AMI Tools Once a machine image has been created it must be bundled as an AMI for use with Amazon EC2, as follows. Use ec2-bundle-image to bundle an image that you have prepared in a loopback file, as described in the previous section. # ec2-bundle-image -i my-image.img -k pk-HKZYKTAIG2ECMXYIBH3HXV4ZBZQ55CLO.pem -c cert-HKZYKTAIG2ECMXYIBH3HXV4ZBZQ55CLO.pem -u 12345678 This will create the bundle files: image.part.00 image.part.01 ... image.part.NN image.manifest.xml Alternatively an AMI could be created by snapshotting the local machine root file system and bundling it all at once by using ec2-bundle-vol. (note: you will need to have root privileges to do this and SELinux must be disabled). Use ec2-bundle-vol to re-bundle a (modified) running instance of an existing AMI, as described in the previous section. # ec2-bundle-vol -k pk-HKZYKTAIG2ECMXYIBH3HXV4ZBZQ55CLO.pem -c cert- HKZYKTAIG2ECMXYIBH3HXV4ZBZQ55CLO.pem -s 1000 -u 495219933132 As with ec2-bundle-image, ec2-bundle-vol will create image parts files and a manifest file. Note If selinux is enabled when ec2-bundle-vol is run, the filesystem creation step may fail. Selinux should be disabled while this is done. Uploading a Bundled AMI The bundled AMI needs to be uploaded for storage in Amazon S3 before it can be accessed by Amazon EC2. Use ec2-upload-bundle to upload the bundled AMI that you created as described above. S3 stores data objects in buckets, which are similar in concept to directories. Buckets must have globally unique names. The ec2-upload-bundle utility will upload the bundled AMI to a specified bucket. If the specified bucket does not exist it will be created. However, if the specified bucket already exists, and belongs to another user, then ec2-upload-bundle will fail. # ec2-upload-bundle -b my-bucket -m image.manifest.xml -a my- aws-access-key-id -s my-secret-key-id The AMI manifest file and all image parts are uploaded to S3. The manifest file is encrypted with the Amazon EC2 public key before being uploaded. Building Shared AMIs API Version 2007-03-01 11
The new reader is still in beta!
(c) 2013 Tizra. All Rights reserved.