creating an EBS AMI
- Details
- Created on Saturday, 28 January 2012 17:42
- Last Updated on Saturday, 28 January 2012 17:56

Creating an AMI from an EBS Instance
There is a nice simple command to create an AMI from a running, or stopped EBS backed instance. It is ec2-create-image, which is outlined in the docs athttp://docs.amazonwebservices.com/AWSEC2/latest/CommandLineReference/index.html?ApiReference-cmd-RunInstances.html [1].
It is very simple and straight forward. First find out the instance name of your running EBS instance for example I had one called
i-bfd061d3.
To turn this EBS backed instance into an AMI we need to run the ec2-create-image command.
Here is an example of this command.
|
> ec2-create-image i-bfd061d3 --name NewName --description MyDescription
|
As is this command will shut down the instance, copy it, bring it back up then create an AMI based off that instance snapshot. It does take a while 10-15 minutes before the AMI is available for use
Also you can make an AMI without shutting down the instance by changing the following command to.
|
> ec2-create-image i-bfd061d3 --name NewName --description MyDescription --no-reboot
|
But as stated by AWS documents when this is set “file system integrity on the created image cannot be guaranteed”
Another note is that this AMI is backed by an snapshot, so you will be storing a few GB of data so that you can start up a machine from this AMI whenever you want.
So that is it, converting EBS instances to AMIs is that easy.
References
[1] ec2-create-image Docs
Visited 1/2011