http://www.jackofallclouds.com/2009/09/anatomy-of-an-amazon-ec2-resource-id/
Each time you allocate a resource using EC2 – an instance, a volume or a snapshot – you receive a unique identifier. This is the EC2 resource ID. Have you ever wondered what this ID represents? Well, I did. After noticing similarities between the IDs of resources requested in close succession, I started digging.
http://blog.rightscale.com/2009/10/05/amazon-usage-estimates/
First of all, Guy’s analysis contains one significant error which is due to the limited data set he had access to. Before May 2009 EC2 issued even and odd instance IDs, not just even ones as he mentions. Since that date EC2 issued only even IDs until it switched to only odd ones in early September. The even/odd switches don’t seem to correlate with ID boundaries, perhaps Amazon switches between two active/standby reservation systems or something else is going on.
The formula to convert an EC2 ID into a sequential launch number as far as we call tell is:
Given an aws id as i-11223333
Assign p1 the 1’s, p2 the 2’s and p3 the 3’s
Also assign p31 the first two 3’s and p32 the last two 3’s
Compute:
c1 = (p1 ^ p32) ^ 0×69
c2 = (p2 ^ p31) ^ 0xe5
c3 = p3 ^ 0×4000
And finally concatenate c1-c2-c3. (This does not include the even/odd adjustments)
The upshot of Guy’s error is that he underestimates the launches by almost 2x!