[libvirt-users] Ordering multiple network interfaces on vms

john fisher john at jpfisher.net
Thu Dec 6 19:42:18 UTC 2012


On a hypervisor with multiple interfaces, we'd like to make those interfaces available to each of multiple VMs.
We have both bridged interfaces and SRIOV interfaces, no NAT interfaces.

When we create a vm in virsh using an xml file with no network elements, but having interface elements, we get the
interfaces in the vm, but the ordering of eth devices does not match the ordering on the hypervisor and we aren't sure
the ordering is repeatable either. In other words, eth0 in the HV is thingA and eth1 is thingB, but on the VM eth0 is
thingC eth1 is thingD and eth4 is thingA so forth.

we have 12 interfaces so ordering or naming is important and confusing.

We've tried to use the PCI bus numbers as seen in lspci on the HV, but no luck.

Do we need to start using network elements in the vm's xml file or separately to control the ordering? Whats the usual
practice here?

Sample xml:

<interface type='hostdev'>
      <source dev='eth3' mode='vepa'>
          <address type='pci' domain='0x0000' bus='0x16' slot='0x10' function='0x1'/>
      </source>
      <target dev='macvtap0'/>    
    </interface>
    <interface type='bridge'>
      <source bridge='br4'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

Thanks!

-- 
John Fisher




More information about the libvirt-users mailing list