I'm trying to run a KVM/QEMU VM under RHEL9 that uses a virtualized Infiniband card (VF) through SR-IOV from a pool of VFs. I can specify a certain VF's PCI device with hostdev and that works just fine, however that requires hardcoding the PCI bus/slot/etc. into the VM XML sheet. That'd be a problem when migrating the VM to another server. So I'd rather define a network pool of VFs as described in this RH doc that would assign a free VF to a newly started VM automatically.
I did everything as described in the docs and the network pool of 8 VFs from a single IB card works like it should:
# virsh net-dumpxml IB-passthrough
<network>
<name>IB-passthrough</name>
<uuid>8dce28fa-97ea-43d4-a82b-5923fa1a2a4f</uuid>
<forward mode='hostdev' managed='yes'>
<address type='pci' domain='0x0000' bus='0xc1' slot='0x00' function='0x1'/>
<address type='pci' domain='0x0000' bus='0xc1' slot='0x00' function='0x2'/>
<address type='pci' domain='0x0000' bus='0xc1' slot='0x00' function='0x3'/>
<address type='pci' domain='0x0000' bus='0xc1' slot='0x00' function='0x4'/>
<address type='pci' domain='0x0000' bus='0xc1' slot='0x00' function='0x5'/>
<address type='pci' domain='0x0000' bus='0xc1' slot='0x00' function='0x6'/>
<address type='pci' domain='0x0000' bus='0xc1' slot='0x00' function='0x7'/>
<address type='pci' domain='0x0000' bus='0xc1' slot='0x01' function='0x0'/>
</forward>
</network>
I write the following entry into the VM's XML:
<interface type='network'>
<source network='IB-passthrough'/>
</interface>
But after closing the XML editor, the entry gets automatically extended with mac
and address
entries:
<interface type='network'>
<mac address='52:54:00:44:db:0d'/>
<source network='IB-passthrough'/>
<address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
</interface>
Then the VM cannot be started since the MAC cannot be set:
# virsh start rhel9.2-testvm
error: Failed to start domain 'rhel9.2-testvm'
error: Cannot set interface MAC to 52:54:00:05:72:5c for ifname ibp193s0 vf 0: Operation not supported
Is there a way to omit that automatic MAC? Or the Interface MAC change? Or is there another problem that I'm missing?