[CentOS] How to generate UUID for Xen?

Wed Dec 19 00:08:44 UTC 2007
Ross Cavanagh <ross-cavanagh at bm-sms.co.jp>

Kai Schaetzl wrote:
> Steve Thompson wrote on Tue, 18 Dec 2007 11:42:53 -0500 (EST):
>
>   
>> Just remove the UUID from the config file and start the VM; no need to 
>> destroy it.
>>     
>
> Well, I had to shut it down before it could use a different UUID. That's 
> what I meant.
> I removed the UUID from all config files now, thanks for the tip!
>
> Kai
>
>   
I use uuidgen to generate a random uuid, and then use this python script 
to generate a random mac address.

I think this was on a help page somewhere that I stumbled across.

#! /usr/bin/python
# macgen.py script generates a MAC address for Xen guests
#
import random
mac = [ 0x00, 0x16, 0x3e,
random.randint(0x00, 0x7f),
random.randint(0x00, 0xff),
random.randint(0x00, 0xff) ]
print ':'.join(map(lambda x: "%02x" % x, mac))