Random thoughts of a warped mind…

December 17, 2012

Set Name tags on Amazon EBS Volumes

Filed under: Amazon EC2,EC2,Linux,Ruby,Virtualization — Srinivas @ 17:06

If you are like me and hate scrolling hell AND have to deal with many many¬† EBS volumes, then its nice to have EBS volumes “named” to show their attachment info (i.e. which server instance is associated to them etc) and have this info updated via script – Its always a good idea to avoid ambiguity – especially when dealing with production file systems!

Here is a quick way to do that… See git repo for more details – All you need to do is update auth.yml to include your AWS auth keys and set the regions array to include the regions you have servers in. The code will ignore volumes that already have a ‘Name’ tag set and will mark EBS volumes that are not attached to any instance as ‘Unassociated’. It helps when you run this out of the cron from somewhere or just make it a habit to run this whenever new instances are spawned. This only modifies meta-data and will in no way touch the actual EBS storage or make any changes to associations etc.

Link to Github – label-ebs-vols

Powered by WordPress