Created
October 30, 2014 04:52
-
-
Save dustymabe/3d53cfe6b9ae32c5e2fb to your computer and use it in GitHub Desktop.
ec2makeimage.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using ec2-api-tools cli to create ebs backed AMI | |
# get the cli from https://aws.amazon.com/developertools/Amazon-EC2/351 | |
# Download image | |
wget https://kojipkgs.fedoraproject.org//work/tasks/8933/7978933/Fedora-Cloud-Base-20141029-21_Beta.i386.raw.xz --no-check-certificate | |
# Uncompress image | |
unxz Fedora-Cloud-Base-20141029-21_Beta.i386.raw.xz | |
# export keys to env | |
export AWS_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxx | |
export AWS_SECRET_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | |
# Create ebs volume from image | |
ec2-import-volume Fedora-Cloud-Base-20141029-21_Beta.i386.raw -b dustyfedoratesting --owner-akid $AWS_ACCESS_KEY --owner-sak $AWS_SECRET_KEY --prefix Fedora-20141029-21-Beta-i386 -f raw -z us-east-1a | |
# After upload, use import-vol taskid to periodically check for when the volume has been created | |
ec2-describe-conversion-tasks import-vol-xxxxxxxx | |
# Once volume is created there will be a volume that exists (volume id in output) | |
# Create a snapshot from this volume: | |
ec2-create-snapshot vol-xxxxxxxx | |
# Gather snapshot id and monitor for when snapshot is ready | |
ec2-describe-snapshots snap-xxxxxxxx | |
# Now register AMI from snapshot | |
ec2-register --name dustyf21i386 --virtualization-type hvm --snapshot snap-xxxxxxxx | |
# Make the image public: | |
ec2-modify-image-attribute ami-xxxxxxxx -l -a all | |
# Now you can share ami-xxxxxxxx with others to use |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment