[Libvir] Guest Identification

Daniel Veillard veillard at redhat.com
Thu Aug 10 20:17:19 UTC 2006


On Thu, Aug 10, 2006 at 04:11:36PM -0400, Juan Walker wrote:
> Hi,
> 
> I'm trying to find a good way to correlate a domain to the machine it's
> running on. Can I use libvir or some other method on a domU to get some
> information that uniquely identifies it? Perhaps something that I can get
> from the XML running on dom0?

  Domains have an unique identifier which you can extract:
    http://libvirt.org/html/libvirt-libvirt.html#virDomainGetUUID

> The solution would be to use libvir to get the list of domains and then get
> the xml which includes the mac address. Then every domain on my network

  The MAC address can be specified in the config file, it's less likely
to be unique, use the UUID. The only caveat is that domain0 has a 0 filled
UUID, and that will be the case on all nodes :-\

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard at redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/




More information about the libvir-list mailing list