Since I do not want to pay money for my testing, the free limit size is 10G.
I can know the root device root for some default AMI such as
Amazon Linux AMI 2012.03
The Amazon Linux AMI 2012.03 is an EBS-backed, PV-GRUB image. It includes Linux 3.2, AWS tools, and repository access to multiple versions of MySQL, PostgreSQL, Python, Ruby, and Tomcat.
Root Device Size: 8 GB
And the last row displayed 8GB.
However, if I find AMI in Community Page, it does not show the root device size.
Can anyone know how to use the instance such as centOS that is not provided by default but it is under 10GB so that I can still free use?
To determine the size each EBS volume associated with an AMI, use ec2-describe-images, with the image-id. Part of the output is the block device mapping, which includes the device, snapshot, and size in GB. For example, Amazon's Linux AMI (ami-e565ba8c), would result in the following:
We can see that this AMI attached its root EBS volume (derived from snap-dbb6e5a1) to /dev/sda1 and that the size is 8GB.
Another example (a random CentOS AMI) - 6GB root device:
An example from my non-default region (my default region is us-east-1) - 10GB root device:
Finally, if I take one of my own AMIs which has multiple attached EBS volumes (10GB, 5GB, 3GB), the output is:
The same command does let you apply filters to perform some basic searching on the AMIs. See the AWS documentation for the possible filters and their usage if you are interested.
To use ec2-describe-instances, you need to setup the API tools - they can be setup on either Windows or Linux and are command line tools.
--filter
is one of the parameters you pass the command, it allows you to narrow the search results by matching select criteria. Amazon details the installation of the API tools in their documentation. Note that the API tools do not need to be setup on an instance - they can run from any computer.For instance, to get all public, EBS backed, 64-bit images, that contain 'centos' in the name:
To get all public, EBS backed, 64-bit images, that contain 'centos' in the name and that have an 8, 9, or 10GB EBS volume, you can use:
Note, the above command will return AMIs that have multiple EBS volumes, if any of those volumes meet the criteria. You can always further filter your results using
grep
, should you desire.As always, don't run AMIs from unknown sources. If you want a CentOS AMI, I would actually suggest sticking with Amazon's Linux. It is based on CentOS/RHEL (fully compatible with the binaries from EPEL), well maintained (packages are updated regularly, the current versions of many popular packages are available), is the officially supported AMI of EC2, and is very lightweight (comes with the bare minimum to start with - doesn't take too much space, uses little memory).
Sloppy method to find details of all 8GB images
sample output in east region
You have to install the AWS tools. The official one is here:
http://aws.amazon.com/developertools/351
If you install them as per the instructions you'll have a command line interface that will allow you to control the instance(s) from your local command line.