Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 21 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.

share|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
I don't know what they're actually doing, but this would fit the current 32-bit version:… (see section "A Non-Repeating Pseudo-Random Number Generator"). Then, when they get to the end, they can shift to something else (more bits, different digits ([g-v] instead of [0-9a-f], for example), something). – lindes May 6 '15 at 23:53

I think @jedberg's answer is the right one. However, I would also point you to this article:

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.

share|improve this answer

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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