[libvirt] Usage of UUID

Daniel P. Berrange berrange at redhat.com
Mon May 18 13:30:41 UTC 2009

On Fri, May 15, 2009 at 12:31:39PM -0300, Eduardo Otubo wrote:
> Hello all,
> When I started to implement phyp driver, I use to handle the UUID as a
> normal 'unsigned char *' with a LPAR value called "logical_serial_num"
> that is a string in the format "067BE8B2", an identifier.

What is the level of uniqueness provided by logical_serial_num.
The docs i see on ibm.com just say 

     A globally unique string for this partition"

is it unique per host, or across the whole world. What is the number
of bytes expected ? Just 4 bytes seems rather small for a globally
unqiue identifier to me. A UUID in libvirt terms has 16 bytes.
If LPARs can't be migrated between different hosts, then perhaps
you can combine the LPAR serial num, with some unique identifier of
the host machine, to provide a 16 byte UUID.

Alternatively, if it is possible to associate extra configuration
values with the LPAR management tools, then you could add a auto
generated UUID config value the first time an LPAR is seen. We
take that latter approach for OpenVZ driver, adding a UUID field
to its master config file.

> In the last comments I got from danpb and DV, they called my attention
> to const string at UUID handling and some funtcions that must be
> implemented: domainDumpXML, listDefinedDomains and numOfDefinedDomains. 

Any place where you have a virDomainPtr object need a UUID available
because that's one of the unique identifiers associated with that

> My question is: Once I don't have information from my hypervisor about
> UUID, do I have to handle UUID at "list" or "list --all" commands? Or I
> should keep and handle this information only when defining a domaing at
> libvirt?
> I mean, in my point of view, there is no need to generate and store a
> UUID while just listing LPARs in the remote server. What I should do is
> to generate a random UUID (and store it) just when the user decides to
> define it at libvirt.

A UUID is the primary (best) unique identifier for a virtual machine
and we use it quite extensively, so you can't really do without it.

|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

More information about the libvir-list mailing list