我需要在KVM上运行两台ESXi主机,并为外部networking分配不同的外部IP。 所需的拓扑结构:
ESXI ESXI ↓ ↓ KVM KVM ↓ ↓ vIF vIF (own ip) (own ip) ↓ ↓ Physical NIC ↓ External Net
对于其他主机来说,与vNIC模型设置为Virtio设备的两个桥接虚拟接口将会有所斩获。 但ESXi不支持Virtio作为NIC模型,并且不会引发无法检测到networking适配器的抱怨。
有没有办法让虚拟接口与KVM上的ESXi配合使用? 我尝试将E1000作为NIC一起使用,但无法将ESXi连接到外部networking。
这是我尝试的configuration。 没有工作:
<interface type='bridged'> <source bridge='br0'/> <model type='virtio'/> #ESXi won't boot due to no adapter detected </interface> <interface type='bridged'> <source source='br0' /> <model type='e1000'/> #ESXi boots but no network connectivity </interface> <interface type='direct'> <source dev='br0' mode='bridged' /> <model type='e1000'/> #ESXi boots but no network connectivity </interface> <interface type='direct'> <source dev='br0' mode='passthrough' /> <model type='e1000'/> #ESXi boots but no network connectivity </interface> #Not applicable to my requirements as physical NIC would be passed to KVM <interface type='direct'> <source dev='enp2s0:0' mode='passthrough' /> <model type='e1000'/> </interface> <interface type='direct'> <source dev='br0' mode='bridged' /> <model type='e1000'/> #ESXi boots but no network connectivity </interface>
这是我的接口:
br0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 inet 192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 fe80::b8ca:7bff:fe23:e847 prefixlen 64 scopeid 0x20<link> ether ba:ca:7b:23:e8:47 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 4 bytes 300 (300.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 enp0s26u1u6: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.9 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 fe80::3be6:18f3:cdd7:d837 prefixlen 64 scopeid 0x20<link> ether a0:ce:c8:01:75:ef txqueuelen 1000 (Ethernet) RX packets 25284 bytes 1737100 (1.6 MiB) RX errors 0 dropped 6860 overruns 0 frame 0 TX packets 25208 bytes 29421441 (28.0 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.6 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 fe80::ca2d:afad:d824:1205 prefixlen 64 scopeid 0x20<link> ether 90:2b:34:9a:bf:67 txqueuelen 1000 (Ethernet) RX packets 3375628 bytes 4511208522 (4.2 GiB) RX errors 0 dropped 3301 overruns 0 frame 0 TX packets 1832807 bytes 847946426 (808.6 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 18 enp2s0:0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.255 ether 90:2b:34:9a:bf:67 txqueuelen 1000 (Ethernet) device interrupt 18
virtio-net不能用于ESXi,这是可以理解的,因为它们不太可能关心提供只与nested-virt有关的NIC的驱动程序。 e1000是一个标准的网卡types,所以我完全期望这个工作。 QEMU仿真中的一些错误总有可能使其与ESXi不兼容。
以下博客文章build议使用QEMU尝试“vmxnet3”NIC模型
https://xrsa.net/2014/08/25/running-vmware-esxi-under-ovirt/
这是QEMU也支持的vmware半虚拟化NIC模型。
您从这个configuration开始,这是正确的,但ESXi不能使用virtio NIC:
<interface type='bridged'> <source bridge='br0'/> <model type='virtio'/> #ESXi won't boot due to no adapter detected </interface>
但是,无论出于何种原因,您似乎没有将NIC模型types更改为e1000 ,也没有做任何其他更改 。 您尝试过的所有其他设置都具有正确的NIC型号,但其他设置不正确或不正确。
当然,你可以(也可能应该)也使用vmxnet3 NICtypes,libvirt和qemu已经支持很多年了。
所以,只改变模型types,不要改变任何东西。