We're using amazon EC2 and we want to keep track of instaces. Is the Amazon EC2 instance-id unique forever? i.e. If a VM has an instance id of i-12345678 is there a guarantee that when that instance terminates, that instance id won't ever be used again?

link|improve this question

79% accept rate
feedback

3 Answers

up vote 6 down vote accepted

I asked Amazon, and this was their answer:

"Instance ids are unique. You'll never receive a duplicate id. However, the current format of the instance id is an implementation detail that is subject to change. If you use the instance id as a string, you should be fine."

It's important to note that you will never receive the same ID twice. However, since you can't connect to other people's instances, this will probably be sufficient.

link|improve this answer
And if you get a duplicate instance ID, it is a bug and you should report it to Amazon immediately. – jtimberman Sep 9 '09 at 7:21
feedback

I think @jedberg's answer is the right one. However, I would also point you to this article: http://www.jackofallclouds.com/2009/09/anatomy-of-an-amazon-ec2-resource-id/

which has a very in-depth analysis (albeit with some guesswork) of how Amazon ID's are constructed. The guy who wrote it doesn't work for Amazon, but you can tell he did his homework :-). IMO it's worth the read just for informational purposes.

link|improve this answer
feedback

I couldn't find anything online, but I wouldn't count on guaranteed uniqueness, even if the current format would accommodate >4 billion IDs.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.