Product SiteDocumentation Site

2.67. net-uuid

When given a network name, returns its corresponding UUID.
Usage
net-uuid --network network-name
Options
Table 2.13. Options
Name Required? Description
--network network-name
required
The name of the virtual network you want the UUID for.
The word "--network" itself is optional.

Availability
Available from libvirt 0.2.0 onwards
Platform or Hypervisor specific notes
None yet
Examples
virsh # net-uuid mynetwork
fa3642ab-e113-7eaa-528f-14ed78bca20
Returns the UUID of the virtual network named "mynetwork".
virsh # net-uuid --network mynetwork
fa3642ab-e113-7eaa-528f-14ed78bca20
Same as the previous example.
Example in context
Given a virtual network name, we can get its UUID:
virsh # net-uuid examplenetwork
bfbc4c69-7d6a-cc9a-904c-09910ce179c0
We can confirm by using the net-dumpxml command on the returned network UUID:
virsh # net-dumpxml bfbc4c69-7d6a-cc9a-904c-09910ce179c0 
<network> 
  <name>examplenetwork</name><-- the name is here 
  <uuid>b7005dec-be1a-fe9a-338a-0cb1301dfcfd</uuid><-- the UUID is here
  <forward mode='route'/>
  <bridge name='virbr100' stp='on' delay='1' />
  <ip address='10.10.120.1' netmask='255.255.255.0'>
  </ip>
</network>
Using net-uuid is more efficient than dumping the XML for the virtual network and manually extracting the uuid value.
See also
  • net-dumpxml - Outputs the XML configuration for a virtual network, to stdout
  • net-list - Lists the virtual networks libvirt is aware of