前些日子在hyper-v主机上启用网卡的teaming功能时遇到了问题,hyper-v中的网卡使用的是用两块物理网卡做teaming后生成的虚拟网卡,发现虚拟机只能和宿主机通信,无法和外部网络通信,排除网卡设置问题后开始怀疑是Hyper-v不支持teaming网卡,上网google,首先查到微软对Hyper-V网卡群组的支持策略在KB968703中进行了说明:
Since Network Adapter Teaming is only provided by Hardware Vendors, Microsoft does not provide any support for this technology thru Microsoft Product Support Services. As a result, Microsoft may ask that you temporarily disable or remove Network Adapter Teaming software when troubleshooting issues where the teaming software is suspect.
If the problem is resolved by the removal of Network Adapter Teaming software, then further assistance must be obtained thru the Hardware Vendor.
看来微软是不管这个问题了,还是得找网卡的厂商来解决。继续在网上google,终于找到网卡厂商支持在hyper-v环境下做teaming的资料:
1 Broadcom have added support for NIC Teaming with Broadcom’s BASP6 v1.2.10 release in a Hyper-V environment.
2 HP  added support for NIC Teaming with HP Network Configuration Utility (NCU) version 9.35 or greater in a Hyper-V environment.
我的主机正是用Broadcom的网卡做的teaming,可为什么做好后虚拟机却无法和外界通信呢?网上google两天,终于发现解决办法:
Broad support the following team types:
· Smart Load Balancing and Failover (configured only for one primary and one standby adapter!!!)
· Link Aggregation (802.3AD)
· Generic Trunking (FEC/GEC)/802.3AD-Draft Static
clip_p_w_picpath001[7]
我的网卡选了Smart Load Balancing and Failover方式,因为只有这种方式的虚拟网卡才支持TOE技术。可是我忽略了configured only for one primary and one standby adapter 这个提示,Hyper-v对于采用Smart Load Balancing and Failover做teaming的两块网卡只能设成一块为主成员,另一块为备用成员的方式。
于是赶紧修改teaming,把两块网卡设成主备模式,虚拟机终于可以和外界通信了!
补充一下操作步骤:
1. Add the Hyper-V role
2. Install the NIC Teaming software
3. Configure the team
4. Configure virtual networking within Hyper-V
一定要保证先启用hyper-v,再做teaming!