We use a machine_code variable to help generate random numbers per hit on a server. We have always deployed manually, so this gets set by us. And as we usually only have 5-10 boxes at a time. We could literally reuse numbers as boxes got replaced.
We're not moving towards using amazon's auto scaling group, which will use an image of our server. Problem here is I can't work out how I can get a unique number for that box.
I was originally going to maybe use the instance-id from within the box, but that isnt a straight forward number.
My next thought was, on each box's init(), it would talk to it's Load Balancer, pull all boxes, and then loop through till it found it's self, then use that loop counter as its machine_code. This obviously is limited.
I'm really not 100% sure how to go about this, if anyone has any ideas? Or if my proposal of looping the current load balancer to get a number, would be ok.
I wasn't sure where else to ask this question.