[libvirt-users] Host and Guest UUID ?

Lars Kellogg-Stedman lars at redhat.com
Thu Aug 13 20:20:53 UTC 2015


On Thu, Aug 13, 2015 at 07:30:22PM +0000, Jean-Pierre Ribeauville wrote:
> Are there some kind of UUIDs for Host and Guest ?
> If yes , how may I  retrieve them programmatically ?
> 
> My goal is to trace GUEST migrations.

Guests have a UUID, it's part of the XML description, e.g.,

    $ virsh dumpxml myguest | head -3
    <domain type='kvm' id='10'>
      <name>myguest</name>
        <uuid>b392ddf3-ed7a-4a4d-ba22-159d87bd601d</uuid>

You can get this using the virDomainGetUUID() api call.

Hosts have a UUID that is visible via the 'capabilities' information:

    $ virsh capabilities | head -4
    <capabilities>

      <host>
          <uuid>65bf8701-5216-11cb-baa9-9ee038331cdf</uuid>

This information is available via the virConnectGetCapabilities() api call.

-- 
Lars Kellogg-Stedman <lars at redhat.com> | larsks @ {freenode,twitter,github}
Cloud Engineering / OpenStack          | http://blog.oddbit.com/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20150813/b0ffee21/attachment.sig>


More information about the libvirt-users mailing list