Product SiteDocumentation Site

2.64. net-name

When given a virtual network UUID, returns its corresponding virtual network name.
Usage
net-name --network network-UUID
Options
Table 2.10. Options
Name Required? Description
--network network-UUID
required
The UUID of the virtual network you want the name 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-name b7005dec-be1a-fe9a-338a-0cb1301dfcfd
Returns the name of the virtual network having a UUID of "b7005dec-be1a-fe9a-338a-0cb1301dfcfd".
virsh # net-name --network b7005dec-be1a-fe9a-338a-0cb1301dfcfd
Same as the above example.
Example in context
Given a virtual network UUID, we can determine which virtual network it belongs to:
virsh # net-name b7005dec-be1a-fe9a-338a-0cb1301dfcfd
examplenetwork
We can confirm by using the net-dumpxml command on the returned network name:
virsh # net-dumpxml examplenetwork
<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-name is more efficient than dumping the XML for the virtual network and manually extracting the name value.
See also
  • net-dumpxml - Outputs the XML configuration for a virtual network, to stdout