WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

Re: [Xen-API] [xen-api-libs.hg:PATCH 0 of 2] Uuid stuff.

To: "deshantm@xxxxxxxxx" <deshantm@xxxxxxxxx>
Subject: Re: [Xen-API] [xen-api-libs.hg:PATCH 0 of 2] Uuid stuff.
From: Magnus Therning <magnus.therning@xxxxxxxxxxxxx>
Date: Fri, 30 Jul 2010 11:53:25 +0100
Cc: "xen-api@xxxxxxxxxxxxxxxxxxx" <xen-api@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 30 Jul 2010 03:53:40 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AANLkTi=vYjAaq0XU2dny_Q4ntVzCZ2xq4cekXdCpTPCv@xxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1280418411@xxxxxxxxxxxxxxxxxxxxxx> <AANLkTi=vYjAaq0XU2dny_Q4ntVzCZ2xq4cekXdCpTPCv@xxxxxxxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100721 Lightning/1.0b2pre Thunderbird/3.1.1
On 30/07/10 02:49, Todd Deshane wrote:
> On Thu, Jul 29, 2010 at 11:46 AM,  <magnus.therning@xxxxxxxxxxxxx> wrote:
>> Is this a direction that's worthwhile to pursue?
>> Would a make_uuid_urandom also be necessary?  (E.g. getting session
>> UUIDs from /dev/random might be too heavy weight for something that's
>> that short-lived.)
> 
> Would it be possible to use uuidgen for something that simple?
> 
> http://linux.die.net/man/1/uuidgen

Yes, it would, but I'm not sure that it'd simplify things that much.
Currently the code reads a few bytes from a device and then converts them into
a string of the appropriate format.  Using uuidgen would require spawning a
process on each UUID creation, and reading its stdout.  Given how frequently
xapi generates UUIDs I'd guess that this would cause a performance hit.

The issue at hand is that xapi uses entropy very liberally, and entropy is a
dear resource in dom0.  So it makes sense to try to conserve it a bit,
especially when noticing that UUIDs are used for so many things.  Splitting it
into three groups seems useful to me:

 1. UUIDs that are long-lived secrets (e.g. pool secret)
 2. UUIDs that identify objects, but in reality are short-lived secrets (e.g.
    sessions)
 3. UUIDs that identify objects (e.g. PBDs, VDIs, etc)

So, my initial thought was the following:

 1. Use UUIDs generated from /dev/random
 2. Use UUIDs generated from /dev/urandom
 3. Use UUIDs generated from OCaml's Random

Cheers,
M

-- 
Magnus Therning
magnus.therning@xxxxxxxxxxxxx          Jabber: magnusth@eng

There does not now, nor will there ever, exist a programming language
in which it is the least bit hard to write bad programs.
     -- Flon's Axiom

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api