views:

249

answers:

4

Is there a way to distinguish between sets of EC2 instances?

My use case is that I have a bunch of web tier machines and a bunch of search tier machines; currently the only way to track what each instance is doing is in a roll-your-own asset directory, like LDAP or a database.

Ideally, I'd like to be able to determine the role of a machine from the metadata available from the AWS APIs.

Currently, the only approach I've come up with is to have different machine roles in different security groups (even if it's not strictly required). Is there a better way?

+4  A: 

Update: EC2 now supports "tags" for categorising instances.

http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/index.html?Using_Tags.html


I've always used security groups for categorising. I don't see anything wrong with using them!

Groups not only allow categorising, they also allow different firewall rules. You can also have more than one group per instance, e.g. "production", "database"

Reference: http://docs.amazonwebservices.com/AWSEC2/2008-12-01/DeveloperGuide/index.html?ApiReference-SOAP-RunInstances.html

Gerald Kaszuba
That's actually a good idea. Since you can add as many as you want to an instance you could have a whole other set of them with no firewall settings and apply them as labels.
JohnFx
We use security groups for this as well. The beauty is that they are tags not buckets, so you can have a machine in "frontend" and "staging" and other machines in "frontend" and "production".
Kevin Peterson
+1  A: 

You might want to check out some third party tools like rightscale which adds some capability for managing cloud resources with additional metadata like meaningful labels on volumes and instances. I am only using the free version right now which is somewhat limited, but it still adds quite a bit over the Amazon provided management tools.

Amazon just announced their own console (https://console.aws.amazon.com/), which initially got me excited about the prospect of a free version of RightScale. However, it looks like it is just a Web UI that is functionally equivalent to ElasticFox. Oh well.

I am still keeping a spreadsheet locally to keep track of this mess. Also, this is extremely low tech, but I am dropping a text file on the desktop of each machine (under the admin account) with the purpose of the machine in the filename so I can tell them apart (the generated machine names are absolutely no help without a cheat sheet.)

JohnFx
A: 

I'd second John's vote to use a free RightScale account if you just want to keep tabs on your EC2 instances online. The paid version gives you a lot more functionality, but it can get quite expensive.

The new AWS Management Console is a nice UI and makes it easier than in ElasticFox to do common operations like launching instances, creating and attaching EBS volumes and so on, but I'm really surprised they didn't add the capability to label your instances and volumes. Those Amazon ID strings are not exactly easy to remember, are they ;-)

The AWS console does show the security group for each instance, so Gerald's suggestion of using the security group to identify different groups of instances would work there, but it's still not as good as having an editable label for each device.

gareth_bowles
A: 

While it's not in the AWS meta data, you could always use something like iClassify. It's designed to be the meta data repository for servers, EC2 or not.

Gary Richardson