我正在尝试在 RHEL9 下运行 KVM/QEMU VM,该 VM 通过 SR-IOV 从 VF 池中使用虚拟化 Infiniband 卡 (VF)。我可以使用 hostdev 指定某个 VF 的 PCI 设备,并且运行正常,但是这需要将 PCI 总线/插槽/等硬编码到 VM XML 表中。将 VM 迁移到另一台服务器时,这会成为一个问题。因此,我宁愿定义一个 VF 网络池,如本 RH 文档中所述,它会自动将空闲的 VF 分配给新启动的 VM。
我按照文档中描述的一切进行操作,并且来自单个 IB 卡的 8 个 VF 的网络池正常运行:
# 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>
我将以下条目写入虚拟机的 XML:
<interface type='network'>
<source network='IB-passthrough'/>
</interface>
但关闭 XML 编辑器后,条目会自动扩展mac
并address
显示以下条目:
<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>
然后由于无法设置 MAC 地址,虚拟机无法启动:
# 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
有没有办法省略自动 MAC?或者接口 MAC 更改?或者还有其他我遗漏的问题?