聚合型的 NIC 小組的 NIC 設定Converged NIC Teamed NIC Configuration

適用於:Windows Server(以每年次管道)、Windows Server 2016Applies To: Windows Server (Semi-Annual Channel), Windows Server 2016

下列章節提供部署匯集 NIC 聯合 NIC 設定切換 Embedded 小組 (SET) 使用中的指示。The following sections provide instructions for deploying Converged NIC in a Teamed NIC configuration with Switch Embedded Teaming (SET). 本指南範例設定描述兩個 HYPER-V 主機、HYPER-V 主機 1 和 HYPER-V 主機 2。The example configuration in this guide depicts two Hyper-V hosts, Hyper-V Host 1, and Hyper-V Host 2.

測試連接之間來源和目的地資訊Test Connectivity Between Source and Destination

本節測試連接之間來源和目的地 HYPER-V 主機時所需的步驟。This section provides the steps required to test connectivity between source and destination Hyper-V hosts.

下圖描述兩個 HYPER-V 主機,HYPER-V 主機 1HYPER-V 主機 2The following illustration depicts two Hyper-V hosts, Hyper-V Host 1 and Hyper-V Host 2.

這兩個 HYPER-V 主機有兩個網路介面卡。Both Hyper-V hosts have two network adapters. 每個主機上, 一個介面卡連接到 192.168.1.x/24 子網路,並 192.168.2.x/24 子網路介面卡連接。On each host, one adapter is connected to the 192.168.1.x/24 subnet, and one adapter is connected to the 192.168.2.x/24 subnet.

HYPER-V 主機

測試 NIC 連接至 HYPER-V Virtual 開關切換至Test NIC Connectivity to the Hyper-V Virtual Switch

您可以使用此步驟,來確保實體而的您稍後將會建立 HYPER-V Virtual 參數,可連接目的主機。By using this step, you can ensure that the physical NIC, for which you will later create a Hyper-V Virtual Switch, can connect to the destination host.

這項測試層級 3 (L3)-或 IP 層級-以及層級 2 (L2) 區域網路使用示範連接 (VLAN)。This test demonstrates connectivity by using Layer 3 (L3) - or the IP layer - as well as the Layer 2 (L2) virtual local area networks (VLAN).

您可以使用下列 Windows PowerShell 命令,以取得的網路介面卡的屬性。You can use the following Windows PowerShell command to obtain the properties of the network adapter.

Get-NetAdapter -Name "Test-40G-1" | ft -AutoSize

以下是此命令的範例結果。Following are example results of this command.

名稱Name InterfaceDescriptionInterfaceDescription ifIndexifIndex 狀態Status MacAddressMacAddress LinkSpeedLinkSpeed
--1 測試 40 GTest-40G-1 Mellanox ConnectX-3 Pro 乙太網路卡Mellanox ConnectX-3 Pro Ethernet Adapter 1111 向上Up E4-1D-2D-07-43-D0E4-1D-2D-07-43-D0 40 Gbps40 Gbps

您可以使用其中一項下列命令,以取得額外的介面卡屬性,包括的 IP 位址。You can use one of the following commands to obtain additional adapter properties, including the IP address.

Get-NetIPAddress -InterfaceAlias "Test-40G-1"

Get-NetIPAddress -InterfaceAlias "TEST-40G-1" | Where-Object {$_.AddressFamily -eq "IPv4"} | fl InterfaceAlias,IPAddress

以下是範例結果的命令。Following are example results of these commands.

參數Parameter 值。Value
IPAddressIPAddress 192.168.1.3192.168.1.3
InterfaceIndexInterfaceIndex 1111
InterfaceAliasInterfaceAlias --1 測試 40 GTest-40G-1
AddressFamilyAddressFamily IPv4IPv4
輸入Type Unicast
PrefixLengthPrefixLength 2424

請確認 NIC 小組成員具有有效的 IP 位址Verify that NIC Team Member has a Valid IP Address

您可以使用此步驟,以確認其他 NIC 團隊或 (SET) 切換 Embedded 小組成員實體 Nic (pNICs) 也有有效的 IP 位址。You can use this step to verify that other NIC Team or Switch Embedded Team (SET) member physical NICs (pNICs) also have a valid IP address.

針對此步驟,您可以使用不同的子網路,\ (xxx.xxx。2.xxx 與 xxx.xxx。1。xxx),以幫助傳送此介面卡的目的地。For this step, you can use a separate subnet, (xxx.xxx.2.xxx vs xxx.xxx.1.xxx), to facilitate sending from this adapter to the destination.

或者,如果您在相同的子網路中找到這兩個 pNICs,Windows TCP/IP 堆疊負載平衡介面之間和簡單驗證變得更複雜。Otherwise, if you locate both pNICs on the same subnet, the Windows TCP/IP stack load balances among the interfaces and simple validation becomes more complicated.

您可以使用下列的 Windows PowerShell 命令,以取得的第二個網路介面卡的屬性。You can use the following Windows PowerShell command to obtain the properties of the second network adapter.

Get-NetAdapter -Name "Test-40G-2" | ft -AutoSize

以下是此命令的範例結果。Following are example results of this command.

名稱Name InterfaceDescriptionInterfaceDescription ifIndexifIndex 狀態Status MacAddressMacAddress LinkSpeedLinkSpeed
測試 40 G 2TEST-40G-2 Mellanox ConnectX-3 Pro 乙太網路...\ #2Mellanox ConnectX-3 Pro Ethernet A...#2 1313 向上Up E4-1D-2D-07-40-70E4-1D-2D-07-40-70 40 Gbps40 Gbps

您可以使用其中一項下列命令,以取得額外的介面卡屬性,包括的 IP 位址。You can use one of the following commands to obtain additional adapter properties, including the IP address.

Get-NetIPAddress -InterfaceAlias "Test-40G-2"

Get-NetIPAddress -InterfaceAlias "Test-40G-2" | Where-Object {$\_.AddressFamily -eq "IPv4"} | fl InterfaceAlias,IPAddress

以下是範例結果的命令。Following are example results of these commands.

參數Parameter 值。Value
IPAddressIPAddress 192.168.2.3192.168.2.3
InterfaceIndexInterfaceIndex 1313
InterfaceAliasInterfaceAlias 測試 40 G 2TEST-40G-2
AddressFamilyAddressFamily IPv4IPv4
輸入Type Unicast
PrefixLengthPrefixLength 2424

請確認其他 Nic 有有效的 IP 位址Verify that Additional NICs have Valid IP Addresses

您可以使用此步驟,以確保其他而具有有效的 IP 位址。You can use this step to ensure that the other NIC has a valid IP address.

針對此步驟,您可以使用不同的子網路,\ (xxx.xxx。2.xxx 與 xxx.xxx。1。xxx),以幫助傳送此介面卡的目的地。For this step, you can use a separate subnet, (xxx.xxx.2.xxx vs xxx.xxx.1.xxx), to facilitate sending from this adapter to the destination.

或者,如果您在相同的子網路中找到這兩個 pNICs,Windows TCP/IP 堆疊負載平衡介面之間和簡單驗證變得更複雜。Otherwise, if you locate both pNICs on the same subnet, the Windows TCP/IP stack load balances among the interfaces and simple validation becomes more complicated.

您可以使用下列的 Windows PowerShell 命令,以取得的第二個網路介面卡的屬性。You can use the following Windows PowerShell command to obtain the properties of the second network adapter.

Get-NetAdapter -Name "Test-40G-2" | ft -AutoSize

以下是此命令的範例結果。Following are example results of this command.

名稱Name InterfaceDescriptionInterfaceDescription ifIndexifIndex 狀態Status MacAddressMacAddress LinkSpeedLinkSpeed
測試 40 G 2TEST-40G-2 Mellanox ConnectX-3 Pro 乙太網路...\ #2Mellanox ConnectX-3 Pro Ethernet A...#2 1313 向上Up E4-1D-2D-07-40-70E4-1D-2D-07-40-70 40 Gbps40 Gbps

您可以使用其中一項下列命令,以取得額外的介面卡屬性,包括的 IP 位址。You can use one of the following commands to obtain additional adapter properties, including the IP address.

Get-NetIPAddress -InterfaceAlias "Test-40G-2"

Get-NetIPAddress -InterfaceAlias "Test-40G-2" | Where-Object {$_.AddressFamily -eq "IPv4"} | fl InterfaceAlias,IPAddress

以下是範例結果的命令。Following are example results of these commands.

參數Parameter 值。Value
IPAddressIPAddress 192.168.2.3192.168.2.3
InterfaceIndexInterfaceIndex 1313
InterfaceAliasInterfaceAlias 測試 40 G 2TEST-40G-2
AddressFamilyAddressFamily IPv4IPv4
輸入Type Unicast
PrefixLengthPrefixLength 2424

確保能通訊來源和目的地資訊Ensure that Source and Destination Can Communicate

您可以使用此步驟以確認雙向通訊 \ (ping 來源目的地和這兩個 systems\ 上反之亦然)。You can use this step to verify bi-directional communication (ping from source to destination and vice-versa on both systems). 下列範例中,測試-NetConnection使用 Windows PowerShell 命令時,但如果您想要您可以使用ping命令。In the following example, the Test-NetConnection Windows PowerShell command is used, but if you prefer you can use the ping command.

Test-NetConnection 192.168.1.5

以下是此命令的範例結果。Following are example results of this command.

參數Parameter 值。Value
電腦名稱ComputerName 192.168.1.5192.168.1.5
RemoteAddressRemoteAddress 192.168.1.5192.168.1.5
InterfaceAliasInterfaceAlias --1 測試 40 GTest-40G-1
SourceAddressSourceAddress 192.168.1.3192.168.1.3
PingSucceededPingSucceeded FalseFalse
PingReplyDetails (RTT)PingReplyDetails (RTT) 0 ms0 ms

有時候,您可能需要使用進階安全性順利執行這項測試 Windows 防火牆停用。In some cases, you might need to disable Windows Firewall with Advanced Security to successfully perform this test. 如果防火牆停用,記住安全性,請確定您的設定符合您組織的安全性的需求。If you disable the firewall, keep security in mind and ensure that your configuration meets your organization's security requirements.

下列範例命令可讓您要停用所有防火牆設定檔。The following example command allows you to disable all firewall profiles.

Set-NetFirewallProfile -All -Enabled False

停用防火牆之後,您可以使用下列命令以測試連接。After you disable the firewall, you can use the following command to test the connection.

Test-NetConnection 192.168.1.5

以下是此命令的範例結果。Following are example results of this command.

參數Parameter 值。Value
電腦名稱ComputerName 192.168.1.5192.168.1.5
RemoteAddressRemoteAddress 192.168.1.5192.168.1.5
InterfaceAliasInterfaceAlias --1 測試 40 GTest-40G-1
SourceAddressSourceAddress 192.168.1.3192.168.1.3
PingSucceededPingSucceeded FalseFalse
PingReplyDetails (RTT)PingReplyDetails (RTT) 0 ms0 ms

連接其他 Nic 驗證Verify Connectivity for Additional NICs

使用此步驟,您可以在所有後續 pNICs NIC 或一組小組中所包含的重複的上一個步驟。With this step, you can repeat the previous steps for all subsequent pNICs that are included in the NIC or SET team.

您可以使用下列命令來測試連接。You can use the following command to test the connection.

Test-NetConnection 192.168.2.5

以下是此命令的範例結果。Following are example results of this command.

參數Parameter 值。Value
電腦名稱ComputerName 192.168.2.5192.168.2.5
RemoteAddressRemoteAddress 192.168.2.5192.168.2.5
InterfaceAliasInterfaceAlias 測試 40 G 2Test-40G-2
SourceAddressSourceAddress 192.168.2.3192.168.2.3
PingSucceededPingSucceeded FalseFalse
PingReplyDetails (RTT)PingReplyDetails (RTT) 0 ms0 ms

設定 VlanConfigure VLANs

針對此步驟,Nic 可在存取模式。For this step, the NICs are in ACCESS mode. 但是當您在本文稍後建立 HYPER-V Virtual 切換 (vSwitch),VLAN 屬性會套用到 vSwitch 連接埠層級。However when you create a Hyper-V Virtual Switch (vSwitch) later in this guide, the VLAN properties are applied at the vSwitch port level.

切換可以主機多個 Vlan,因為它是所需的最上方的架 (ToR) 實體切換,將其設定主幹模式中的連接埠。Because a switch can host multiple VLANs, it is necessary for the Top of Rack (ToR) physical switch to have its port configured in Trunk mode.

如需如何設定主幹模式開關切換至上的指示,請洽詢您 ToR 切換文件。Consult your ToR switch documentation for instructions on how to configure Trunk mode on the switch.

下圖描述具有兩個每個的 VLAN 101 網路介面卡的兩個 HYPER-V 主機,而且 VLAN 102 設定中網路介面卡屬性。The following illustration depicts two Hyper-V hosts with two network adapters each that have VLAN 101 and VLAN 102 configured in network adapter properties.

設定的區域網路

這兩個 Nic 設定的 VLAN IdConfigure the VLAN IDs for both NICs

您可以使用此步驟來設定 VLAN Id Nic 安裝在您的 HYPER-V 主機。You can use this step to configure the VLAN IDs for NICs installed in your Hyper-V hosts.

協會,網路標準電子工程師 (IEEE) 根據實體的服務品質 (QoS) 屬性 NIC 處理嵌入 802.1Q 802.1 p 標頭 (VLAN) 標頭,當您設定的 VLAN id。According to the Institute of Electrical and Electronics Engineers (IEEE) networking standards, the Quality of Service (QoS) properties in the physical NIC act on the 802.1p header that is embedded within the 802.1Q (VLAN) header when you configure the VLAN ID.

設定 NIC 測試 40 G 1Configure NIC Test-40G-1

使用下列命令,設定 VLAN ID 的第一個 NIC、測試 40 G 1,然後檢視 [顯示設定。With the following commands, configure the VLAN ID for the first NIC, Test-40G-1, then view the resulting configuration.

Set-NetAdapterAdvancedProperty -Name "Test-40G-1" -RegistryKeyword VlanID -RegistryValue "101"
Get-NetAdapterAdvancedProperty -Name "Test-40G-1" | Where-Object {$_.RegistryKeyword -eq "VlanID"} | ft -AutoSize

以下是此命令的範例結果。Following are example results of this command.

名稱Name 顯示名稱DisplayName DisplayValueDisplayValue RegistryKeywordRegistryKeyword RegistryValueRegistryValue
--1 測試 40 GTEST-40G-1 VLAN IDVLAN ID 101101 VlanIDVlanID {101}{101}

請確定該 VLAN ID 生效的網路介面卡實作獨立使用下列命令重新開機網路介面卡。Ensure that the VLAN ID takes effect independent of the network adapter implementation by using the following command to restart the network adapter.

Restart-NetAdapter -Name "Test-40G-1"

您可以使用下列命令,以確保您的網路介面卡狀態的是再繼續。You can use the following command to ensure that the network adapter status is Up before proceeding.

Get-NetAdapter -Name "Test-40G-1" | ft -AutoSize

以下是此命令的範例結果。Following are example results of this command.

名稱Name InterfaceDescriptionInterfaceDescription ifIndexifIndex 狀態Status MacAddressMacAddress LinkSpeedLinkSpeed
--1 測試 40 GTest-40G-1 Mellanox ConnectX-3 Pro 乙太網路草原...Mellanox ConnectX-3 Pro Ethernet Ada... 1111 向上Up E4-1D-2D-07-43-D0E4-1D-2D-07-43-D0 40 Gbps40 Gbps

設定 NIC 測試 40 G 2Configure NIC Test-40G-2

使用下列命令,設定 VLAN ID 的第二個 NIC、測試 40 G 2,然後檢視 [顯示設定。With the following commands, configure the VLAN ID for the second NIC, Test-40G-2, then view the resulting configuration.

Set-NetAdapterAdvancedProperty -Name "Test-40G-2" -RegistryKeyword VlanID -RegistryValue "102"
Get-NetAdapterAdvancedProperty -Name "Test-40G-2" | Where-Object {$_.RegistryKeyword -eq "VlanID"} | ft -AutoSize

以下是此命令的範例結果。Following are example results of this command.

名稱Name 顯示名稱DisplayName DisplayValueDisplayValue RegistryKeywordRegistryKeyword RegistryValueRegistryValue
測試 40 G 2TEST-40G-2 VLAN IDVLAN ID 102102 VlanIDVlanID {102}{102}

請確定該 VLAN ID 生效的網路介面卡實作獨立使用下列命令重新開機網路介面卡。Ensure that the VLAN ID takes effect independent of the network adapter implementation by using the following command to restart the network adapter.

Restart-NetAdapter -Name "Test-40G-2"

您可以使用下列命令,以確保您的網路介面卡狀態的是再繼續。You can use the following command to ensure that the network adapter status is Up before proceeding.

Get-NetAdapter -Name "Test-40G-1" | ft -AutoSize

以下是此命令的範例結果。Following are example results of this command.

名稱Name InterfaceDescriptionInterfaceDescription ifIndexifIndex 狀態Status MacAddressMacAddress LinkSpeedLinkSpeed
測試 40 G 2Test-40G-2 Mellanox ConnectX-3 Pro 乙太網路草原...Mellanox ConnectX-3 Pro Ethernet Ada... 1111 向上Up E4-1D-2D-07-43-D1E4-1D-2D-07-43-D1 40 Gbps40 Gbps

請確認連接Verify Connectivity

您可以使用本節之後重新啟動網路介面卡,請確認連接。You can use this section to verify connectivity after the network adapters are restarted. 您可以確認連接之後申請這兩個介面卡的 VLAN 標記。You can confirm connectivity after applying the VLAN tag to both adapters. 如果連接失敗,您可以檢查 VLAN 設定或目的參與相同 VLAN 切換。If connectivity fails, you can inspect the switch VLAN configuration or destination participation in the same VLAN.

重要

您上一節中執行步驟後,可能需要幾秒鐘的裝置重新開機,並在網路上推出。After you perform the steps in the previous section, it might take several seconds for the device to restart and become available on the network.

請確認連接的 NIC 測試-40 G-1Verify connectivity for NIC Test-40G-1

請確認連接的第一個而,您可以執行下列命令。To verify connectivity for the first NIC, you can run the following command.

Test-NetConnection 192.168.1.5

以下是此命令的範例結果。Following are example results of this command.

參數Parameter 值。Value
電腦名稱ComputerName 192.168.1.5192.168.1.5
RemoteAddressRemoteAddress 192.168.1.5192.168.1.5
InterfaceAliasInterfaceAlias --1 測試 40 GTest-40G-1
SourceAddressSourceAddress 192.168.1.5192.168.1.5
PingSucceededPingSucceeded 為 trueTrue
PingReplyDetails (RTT)PingReplyDetails (RTT) 0 ms0 ms

請確認連接的 NIC 測試-40 G-2Verify connectivity for NIC Test-40G-2

您可以使用本節適用於 NIC 測試-40 G-2 測試連接。You can use this section to test connectivity for NIC Test-40G-2.

您可以使用下列命令的第二個 NIC 測試連接You can use the following command to test connectivity for the second NIC.

Test-NetConnection 192.168.2.5

以下是此命令的範例結果。Following are example results of this command.

參數Parameter 值。Value
電腦名稱ComputerName 192.168.2.5192.168.2.5
RemoteAddressRemoteAddress 192.168.2.5192.168.2.5
InterfaceAliasInterfaceAlias 測試 40 G 2Test-40G-2
SourceAddressSourceAddress 192.168.2.3192.168.2.3
PingSucceededPingSucceeded 為 trueTrue
PingReplyDetails (RTT)PingReplyDetails (RTT) 0 ms0 ms

A測試-NetConnection失敗或 ping 失敗,您執行之後,就會發生重新開機-NetAdapter並不常用,因此等網路介面卡完全初始化,然後再試一次。A Test-NetConnection failure or ping failure that occurs immediately after you perform Restart-NetAdapter is not uncommon, so wait for the network adapter to fully initialize, and then try again.

如果 VLAN 101 連接運作,但無法運作的 VLAN 102 連接,可能是開關切換至該需要設定為在您想要的 VLAN 上允許連接埠流量的問題。If the VLAN 101 connections work, but the VLAN 102 connections don’t work, the problem might be that the switch needs to be configured to allow port traffic on the desired VLAN. 您可以檢查此暫時 VLAN 101,來設定失敗介面卡及重複連接測試。You can check for this by temporarily setting the failing adapters to VLAN 101, and repeating the connectivity test.

設定服務 (QoS) 品質Configure Quality of Service (QoS)

下一個步驟是設定服務品質 (QoS),需要先安裝 Windows Server 2016 功能資料中心橋接 (DCB)。The next step is to configure Quality of Service (QoS), which requires that you first install the Windows Server 2016 feature Data Center Bridging (DCB).

下圖成功設定中的上一個步驟的 Vlan 後描述您的 HYPER-V 主機。The following illustration depicts your Hyper-V hosts after successfully configuring VLANs in the previous step.

設定品質服務

安裝資料中心橋接 (DCB)Install Data Center Bridging (DCB)

您可以使用此步驟,安裝以及 DCB。You can use this step to install and enable DCB. 在大部分案例中,這個步驟是選擇性的 iWarp 實作,但必須 fabric 縮放,例如跨-架案例。In most cases, this step is optional for iWarp implementations, but it's necessary at the fabric scale, such as for cross-rack scenarios.

您可以在每個您的 HYPER-V 主機上安裝 DCB 使用下列命令。You can use the following command to install DCB on each of your Hyper-V hosts.

Install-WindowsFeature Data-Center-Bridging

以下是此命令的範例結果。Following are example results of this command.

成功Success 需要重新開機Restart Needed 結束代碼Exit Code 功能結果Feature Result
為 trueTrue 否]No 成功Success {資料中心橋接}{Data Center Bridging}

設定 SMB 直接 QoS 原則Set the QoS policies for SMB-Direct

您可以使用下列命令來設定 SMB 直接 QoS 原則。You can use the following command to configure QoS policies for SMB Direct.

New-NetQosPolicy "SMB" -NetDirectPortMatchCondition 445 -PriorityValue8021Action 3

以下是此命令的範例結果。Following are example results of this command.

參數Parameter 值。Value
名稱Name SMBSMB
擁有者Owner 群組原則 (Machine)Group Policy (Machine)
NetworkProfileNetworkProfile 所有All
優先順序Precedence 127127
JobObjectJobObject  
NetDirectPortNetDirectPort 445445
PriorityValuePriorityValue 33

設定介面的其他資料傳輸原則Set policies for other traffic on the interface

您可以使用下列命令,將 QoS 額外的原則。You can use the following command to set additional QoS policies.

New-NetQosPolicy "DEFAULT" -Default -PriorityValue8021Action 0

以下是此命令的範例結果。Following are example results of this command.

參數Parameter 值。Value
名稱Name 預設值DEFAULT
擁有者Owner 群組原則 (Machine)Group Policy (Machine)
NetworkProfileNetworkProfile 所有All
優先順序Precedence 127127
範本Template 預設值Default
JobObjectJobObject  
PriorityValuePriorityValue 00

打開 smb 流程控制項Turn on Flow Control for SMB

您可以使用下列命令,讓 SMB 流程控制項以及檢視結果。You can use the following commands to enable SMB flow control and to view the results.

Enable-NetQosFlowControl -priority 3
Get-NetQosFlowControl

以下是此命令的範例結果。Following are example results of this command.

高優先順序Priority 支援Enabled PolicySetPolicySet IfIndexIfIndex IfAliasIfAlias
00 FalseFalse 全球Global    
11 FalseFalse 全球Global    
22 FalseFalse 全球Global    
33 為 trueTrue 全球Global    
44 FalseFalse 全球Global    
55 FalseFalse 全球Global    
66 FalseFalse 全球Global    
77 FalseFalse 全球Global    

如果您的結果不符這些結果因為 3 以外的項目 true Enabled 值,您必須執行下一個步驟。If your results do not match these results because items other than 3 have an Enabled value of True, you must perform the next step. 如果結果相符這些範例結果唯一的項目 3 有 Enabled 的值為 true,不需要執行下一個步驟,並可以跳到下讓 QoS 目標和目的地資訊的網路介面卡的If your results match these example results, and only item 3 has an Enabled value of True, you do not need to perform the next step, and can skip down to Enable QoS for the target and destination network adapters.

確定已停用其他流量類別 (Optional) 流量控制Ensure Flow Control is Disabled for Other Traffic Classes (Optional)

您不需要執行此步驟,如果FlowControl無法進行流量類別 0,1,2,4,5,6 和 7。You do not need to perform this step if FlowControl is not enabled for traffic classes 0,1,2,4,5,6, and 7.

如果FlowControl已的任何資料傳輸類別 3 以外 \(0,1,2,4,5,6,並 7\),您必須停用FlowControl這些類別。If FlowControl is already enabled for any traffic classes other than 3 (0,1,2,4,5,6, and 7), you must disable FlowControl for these classes.

注意

在複雜的設定,其他流量類別可能需要流程控制項,不過在這些案例中已超出範圍本指南。Under more complex configurations, the other traffic classes might require flow control, however these scenarios are outside the scope of this guide.

您可以使用下列命令,來停用流量類別 0,1,2,4,5,6,以及 7 SMB 流程控制項並檢視結果。You can use the following commands to disable SMB flow control for traffic classes 0,1,2,4,5,6, and 7, and to view the results.

Disable-NetQosFlowControl -priority 0,1,2,4,5,6,7
Get-NetQosFlowControl

以下是此命令的範例結果。Following are example results of this command.

高優先順序Priority 支援Enabled PolicySetPolicySet IfIndexIfIndex IfAliasIfAlias
00 FalseFalse 全球Global    
11 FalseFalse 全球Global    
22 FalseFalse 全球Global    
33 為 trueTrue 全球Global    
44 FalseFalse 全球Global    
55 FalseFalse 全球Global    
66 FalseFalse 全球Global    
77 FalseFalse 全球Global    

讓 QoS 本機和目的地的網路介面卡Enable QoS for the local and destination network adapters

這個步驟中,您可以讓 QoS 本機和目的地的網路介面卡。With this step you can enable QoS for both the local and destination network adapters. 請確定您執行下列命令,這兩個您的 HYPER-V 主機上。Ensure that you run these commands on both of your Hyper-V hosts.

讓 QoS NIC 測試 40 G 1Enable QoS for NIC Test-40G-1

您可以使用下列命令,讓 QoS 並檢視您的設定的結果。You can use the following commands to enable QoS and view the results of your configuration.

Enable-NetAdapterQos -InterfaceAlias "Test-40G-1"
Get-NetAdapterQos -Name "Test-40G-1"

以下是此命令的範例結果。Following are example results of this command.

名稱:測試-40 G-1支援: True功能:Name: TEST-40G-1 Enabled: True Capabilities:

參數Parameter 硬體Hardware 目前Current
MacSecBypassMacSecBypass NotSupportedNotSupported NotSupportedNotSupported
DcbxSupportDcbxSupport None None
NumTCs(Max/ETS/PFC)NumTCs(Max/ETS/PFC) 8/8/88/8/8 8/8/88/8/8

OperationalTrafficClasses:OperationalTrafficClasses:

TCTC TSATSA 頻寬Bandwidth 優先順序Priorities
00 [嚴格]Strict   0-70-7

OperationalFlowControl:優先順序 3 功能的OperationalClassifications:OperationalFlowControl: Priority 3 Enabled OperationalClassifications:

通訊協定Protocol 連接埠日類型Port/Type 高優先順序Priority
預設值Default   00
NetDirectNetDirect 445445 33

讓 QoS NIC 測試 40 G 2Enable QoS for NIC Test-40G-2

您可以使用下列命令,讓 QoS 並檢視您的設定的結果。You can use the following commands to enable QoS and view the results of your configuration.

Enable-NetAdapterQos -InterfaceAlias "Test-40G-2"
Get-NetAdapterQos -Name "Test-40G-2"

以下是此命令的範例結果。Following are example results of this command.

名稱:測試 40 G 2支援: True功能:Name: TEST-40G-2 Enabled: True Capabilities:

參數Parameter 硬體Hardware 目前Current
MacSecBypassMacSecBypass NotSupportedNotSupported NotSupportedNotSupported
DcbxSupportDcbxSupport None None
NumTCs(Max/ETS/PFC)NumTCs(Max/ETS/PFC) 8/8/88/8/8 8/8/88/8/8

OperationalTrafficClasses:OperationalTrafficClasses:

TCTC TSATSA 頻寬Bandwidth 優先順序Priorities
00 [嚴格]Strict   0-70-7

OperationalFlowControl:優先順序 3 功能的OperationalClassifications:OperationalFlowControl: Priority 3 Enabled OperationalClassifications:

通訊協定Protocol 連接埠日類型Port/Type 高優先順序Priority
預設值Default   00
NetDirectNetDirect 445445 33

配置 SMB 直接 (RDMA) 50%的頻寬保留的項目Allocate 50% of the Bandwidth Reservation to SMB Direct (RDMA)

您可以使用下列命令一半頻寬預定的指派給 SMB 直接存取。You can use the following commands to assign half of the bandwidth reservation to SMB Direct.

New-NetQosTrafficClass "SMB" -priority 3 -bandwidthpercentage 50 -algorithm ETS

以下是此命令的範例結果。Following are example results of this command.

名稱Name 演算法Algorithm Bandwidth(%)Bandwidth(%) 高優先順序Priority PolicySetPolicySet IfIndexIfIndex IfAliasIfAlias
SMBSMB ETSETS 5050 33 全球Global    

您可以使用下列命令,以檢視頻寬保留的資訊。You can use the following command to view bandwidth reservation information.

Get-NetQosTrafficClass | ft -AutoSize

以下是此命令的範例結果。Following are example results of this command.

名稱Name 演算法Algorithm Bandwidth(%)Bandwidth(%) 高優先順序Priority PolicySetPolicySet IfIndexIfIndex IfAliasIfAlias
[預設值][Default] ETSETS 5050 0-2,4-70-2,4-7 全球Global    
SMBSMB ETSETS 5050 33 全球Global    

建立流量類別承租人 IP 傳輸 (optional)Create Traffic Classes for Tenant IP Traffic (optional)

您可以使用此步驟來建立兩個額外的流量類別承租人 IP 傳輸。You can use this step to create two additional traffic classes for tenant IP traffic.

當您執行以下的範例命令時,如果您想要您可以略過的「IP1」和「IP2「值。When you run the following example commands, you can omit the “IP1” and “IP2” values if you prefer.

New-NetQosTrafficClass "IP1" -Priority 1 -bandwidthpercentage 10 -algorithm ETS

以下是此命令的範例結果。Following are example results of this command.

名稱Name 演算法Algorithm Bandwidth(%)Bandwidth(%) 高優先順序Priority PolicySetPolicySet IfIndexIfIndex IfAliasIfAlias
IP1IP1 ETSETS 1010 11 全球Global    
New-NetQosTrafficClass "IP2" -Priority 2 -bandwidthpercentage 10 -algorithm ETS

以下是此命令的範例結果。Following are example results of this command.

名稱Name 演算法Algorithm Bandwidth(%)Bandwidth(%) 高優先順序Priority PolicySetPolicySet IfIndexIfIndex IfAliasIfAlias
IP2IP2 ETSETS 1010 22 全球Global    

您可以使用下列命令,以檢視 QoS 流量類別。You can use the following command to view QoS traffic classes.

Get-NetQosTrafficClass | ft -AutoSize

以下是此命令的範例結果。Following are example results of this command.

名稱Name 演算法Algorithm Bandwidth(%)Bandwidth(%) 高優先順序Priority PolicySetPolicySet IfIndexIfIndex IfAliasIfAlias
[預設值][Default] ETSETS 3030 0,4-70,4-7 全球Global    
SMBSMB ETSETS 5050 33 全球Global    
IP1IP1 ETSETS 1010 11 全球Global    
IP2IP2 ETSETS 1010 22 全球Global    

設定 (Optional) 偵錯工具Configure Debugger (Optional)

您可以使用此步驟進行偵錯工具。You can use this step to configure the debugger.

根據預設,附加偵錯工具封鎖 NetQos。By default, the attached debugger blocks NetQos. 您可以使用下列命令覆寫偵錯工具,以及檢視結果。You can use the following commands to override the debugger and view the results.

Set-ItemProperty HKLM:"\SYSTEM\CurrentControlSet\Services\NDIS\Parameters" AllowFlowControlUnderDebugger -type DWORD -Value 1 –Force

Get-ItemProperty HKLM:"\SYSTEM\CurrentControlSet\Services\NDIS\Parameters" | ft AllowFlowControlUnderDebugger

以下是此命令的範例結果。Following are example results of this command.

AllowFlowControlUnderDebugger
-----------------------------
1

測試 RDMA (Mode 1)Test RDMA (Mode 1)

您可以使用此步驟,以確保建立 vSwitch 和轉換為 RDMA (Mode 2) 之前 fabric 已正確設定。You can use this step to ensure that the fabric is correctly configured prior to creating a vSwitch and transitioning to RDMA (Mode 2).

下圖描述目前 HYPER-V 主機的狀態。The following illustration depicts the current state of the Hyper-V hosts.

測試 RDMA

若要確認 RDMA 設定,您可以執行下列命令。To verify the RDMA configuration, you can run the following command.

Get-NetAdapterRdma | ft -AutoSize

以下是此命令的範例結果。Following are example results of this command.

名稱Name InterfaceDescriptionInterfaceDescription 支援Enabled
--1 測試 40 GTEST-40G-1 VPI Mellanox ConnectX-4 介面卡 #2Mellanox ConnectX-4 VPI Adapter #2 為 trueTrue
測試 40 G 2TEST-40G-2 VPI Mellanox ConnectX-4 介面卡Mellanox ConnectX-4 VPI Adapter 為 trueTrue

判斷您的目標介面卡的 ifIndex 值Determine the ifIndex value of your target adapter

您可以使用下列命令來探索 ifIndex 目標介面卡的值。You can use the following command to discover the ifIndex value of the target adapter.

Get-NetIPConfiguration -InterfaceAlias "TEST*" | ft InterfaceAlias,InterfaceIndex,IPv4Address

以下是此命令的範例結果。Following are example results of this command.

InterfaceAliasInterfaceAlias InterfaceIndexInterfaceIndex IPv4AddressIPv4Address
--1 測試 40 GTEST-40G-1 1414 {192.168.1.3}{192.168.1.3}
測試 40 G 2TEST-40G-2 1313 {192.168.2.3}{192.168.2.3}

下載 DiskSpd.exe 和 PowerShell 指令碼Download DiskSpd.exe and a PowerShell Script

若要繼續時,您必須先下載下列項目。To continue, you must first download the following items.

執行 PowerShell 指令碼Run the PowerShell script

當您執行的 Windows PowerShell 指令碼 Test-Rdma.ps1 時,您可以傳送 ifIndex 值指令碼,以及遠端相同的 VLAN 上介面卡的 IP 位址。When you run the Test-Rdma.ps1 Windows PowerShell script, you can pass the ifIndex value to the script, along with the IP address of the remote adapter on the same VLAN.

您可以使用下列命令範例為 14 ifIndex 指令碼執行的網路介面卡 192.168.1.5。You can use the following example command to run the script with an ifIndex of 14 on the network adapter 192.168.1.5.

C:\TEST\Test-RDMA.PS1 -IfIndex 14 -IsRoCE $true -RemoteIpAddress 192.168.1.5 -PathToDiskspd C:\TEST\Diskspd-v2.0.17\amd64fre\

VERBOSE: Diskspd.exe found at C:\TEST\Diskspd-v2.0.17\amd64fre\\diskspd.exe
VERBOSE: The adapter TEST-40G-1 is a physical adapter
VERBOSE: Underlying adapter is RoCE. Checking if QoS/DCB/PFC is configured on each physical adapter(s)
VERBOSE: QoS/DCB/PFC configuration is correct.
VERBOSE: RDMA configuration is correct.
VERBOSE: Checking if remote IP address, 192.168.1.5, is reachable.
VERBOSE: Remote IP 192.168.1.5 is reachable.
VERBOSE: Disabling RDMA on adapters that are not part of this test. RDMA will be enabled on them later.
VERBOSE: Testing RDMA traffic now for. Traffic will be sent in a parallel job. Job details:
VERBOSE: 0 RDMA bytes written per second
VERBOSE: 0 RDMA bytes sent per second
VERBOSE: 662979201 RDMA bytes written per second
VERBOSE: 37561021 RDMA bytes sent per second
VERBOSE: 1023098948 RDMA bytes written per second
VERBOSE: 8901349 RDMA bytes sent per second
VERBOSE: Enabling RDMA on adapters that are not part of this test. RDMA was disabled on them prior to sending RDMA traffic.
VERBOSE: RDMA traffic test SUCCESSFUL: RDMA traffic was sent to 192.168.1.5

注意

如果 RDMA 流量失敗,RoCE 案例具體而言,洽詢您 ToR 切換設定適當的必須符合的主機設定 PFC 日 ETS 設定。If the RDMA traffic fails, for the RoCE case specifically, consult your ToR Switch configuration for proper PFC/ETS settings that should match the Host settings. 請參考 QoS 參考值本文件。Refer to the QoS section in this document for reference values.

判斷您的目標介面卡的 ifIndex 值Determine the ifIndex value of your target adapter

您可以使用下列命令來探索 ifIndex 目標介面卡的值。You can use the following command to discover the ifIndex value of the target adapter.

Get-NetIPConfiguration -InterfaceAlias "TEST*" | ft InterfaceAlias,InterfaceIndex,IPv4Address

以下是此命令的範例結果。Following are example results of this command.

InterfaceAliasInterfaceAlias InterfaceIndexInterfaceIndex IPv4AddressIPv4Address
--1 測試 40 GTEST-40G-1 1414 {192.168.1.3}{192.168.1.3}
測試 40 G 2TEST-40G-2 1313 {192.168.2.3}{192.168.2.3}

您可以使用下列命令範例 ifIndex 13 的指令碼執行的網路介面卡 192.168.2.5。You can use the following example command to run the script with an ifIndex of 13 on the network adapter 192.168.2.5.

C:\TEST\Test-RDMA.PS1 -IfIndex 13 -IsRoCE $true -RemoteIpAddress 192.168.2.5 -PathToDiskspd C:\TEST\Diskspd-v2.0.17\amd64fre\
VERBOSE: Diskspd.exe found at C:\TEST\Diskspd-v2.0.17\amd64fre\\diskspd.exe
VERBOSE: The adapter TEST-40G-2 is a physical adapter
VERBOSE: Underlying adapter is RoCE. Checking if QoS/DCB/PFC is configured on each physical adapter(s)
VERBOSE: QoS/DCB/PFC configuration is correct.
VERBOSE: RDMA configuration is correct.
VERBOSE: Checking if remote IP address, 192.168.2.5, is reachable.
VERBOSE: Remote IP 192.168.2.5 is reachable.
VERBOSE: Disabling RDMA on adapters that are not part of this test. RDMA will be enabled on them later.
VERBOSE: Testing RDMA traffic now for. Traffic will be sent in a parallel job. Job details:
VERBOSE: 0 RDMA bytes written per second
VERBOSE: 0 RDMA bytes sent per second
VERBOSE: 541185606 RDMA bytes written per second
VERBOSE: 34821478 RDMA bytes sent per second
VERBOSE: 954717307 RDMA bytes written per second
VERBOSE: 35040816 RDMA bytes sent per second
VERBOSE: Enabling RDMA on adapters that are not part of this test. RDMA was disabled on them prior to sending RDMA traffic.
VERBOSE: RDMA traffic test SUCCESSFUL: RDMA traffic was sent to 192.168.2.5

建立 HYPER-V Virtual 開關切換至Create a Hyper-V Virtual Switch

建立 HYPER-V Virtual 切換 (vSwitch) 在您的 HYPER-V 主機上,您可以使用此一節。You can use this section to create a Hyper-V Virtual Switch (vSwitch) on your Hyper-V hosts.

下圖與 vSwitch 描述 HYPER-V 主機 1。The following illustration depicts Hyper-V Host 1 with a vSwitch.

建立 HYPER-V Virtual 開關切換至

建立 vSwitch 切換 Embedded 小組 (SET) 模式Create a vSwitch in Switch Embedded Teaming (SET) mode

您可以使用下列範例命令來建立將開關切換至獨立團隊名為VMSTEST HYPER-V 主機 1。You can use the following example command to create a SET switch independent team named VMSTEST on Hyper-V Host 1. 這兩個測試-40 G 1 及測試 40 G 2,此電腦上的網路介面卡] 會新增至設定小組這個命令。Both of the network adapters on this computer, TEST-40G-1 and TEST-40G-2, are added to the SET team with this command.

New-VMSwitch –Name "VMSTEST" –NetAdapterName "TEST-40G-1","TEST-40G-2" -EnableEmbeddedTeaming $true -AllowManagementOS $true

以下是此命令的範例結果。Following are example results of this command.

名稱Name SwitchTypeSwitchType NetAdapterInterfaceDescriptionNetAdapterInterfaceDescription
VMSTESTVMSTEST 外部External 聯合介面Teamed-Interface

您可以使用此命令檢視實體介面卡小組中設定。You can use this command to view the physical adapter team in SET.

Get-VMSwitchTeam -Name "VMSTEST" | fl

以下是此命令的範例結果。Following are example results of this command.

名稱: VMSTEST Id: ad9bb542-dda2-4450-a00e-f96d44bdfbec NetAdapterInterfaceDescription: {Mellanox ConnectX-3 Pro 乙太網路卡、Mellanox ConnectX-3 Pro 乙太網路卡 #2} TeamingMode: SwitchIndependent LoadBalancingAlgorithm:動態Name: VMSTEST Id: ad9bb542-dda2-4450-a00e-f96d44bdfbec NetAdapterInterfaceDescription: {Mellanox ConnectX-3 Pro Ethernet Adapter, Mellanox ConnectX-3 Pro Ethernet Adapter #2} TeamingMode: SwitchIndependent LoadBalancingAlgorithm: Dynamic

顯示兩個主機但 vNIC 檢視Display two views of the Host vNIC

您可以使用下列兩個命令主機但 vNIC 的兩個不同的檢視。You can use the following two commands for two different views of the Host vNIC.

若要顯示的主機但 vNIC 屬性,您可以使用這個命令。You can use this command to display properties of the Host vNIC.

Get-NetAdapter

以下是此命令的範例結果。Following are example results of this command.

|名稱 |InterfaceDescription | ifIndex |狀態 |MacAddress |LinkSpeed ||Name |InterfaceDescription |ifIndex |Status |MacAddress |LinkSpeed| |---- ------------------------ --------------------|-------|------|----------|---------| | |vEthernet (VMSTEST)vEthernet (VMSTEST)|HYPER-V Virtual 乙太網路卡 #2Hyper-V Virtual Ethernet Adapter #2 |2828 |向上Up|E4-1D-2D-07-40-71E4-1D-2D-07-40-71|80 Gbps80 Gbps|

您可以使用此命令來顯示其他主機但 vNIC 屬性。You can use this command to display additional properties of the Host vNIC.

Get-VMNetworkAdapter -ManagementOS

以下是此命令的範例結果。Following are example results of this command.

名稱Name IsManagementOsIsManagementOs VMNameVMName SwitchNameSwitchName MacAddressMacAddress 狀態Status IPAddressesIPAddresses
VMSTESTVMSTEST 為 trueTrue VMSTESTVMSTEST E41D2D074071E41D2D074071 {確定}{Ok}  

網路連接到遠端的 VLAN 101 介面卡的測試Test the network connection to the remote VLAN 101 adapter

您可以使用此命令來連接遠端 VLAN 101 介面卡的測試。You can use this command to test the connection to the remote VLAN 101 adapter.

Test-NetConnection 192.168.1.5

以下是此命令的範例結果。Following are example results of this command.

WARNING: Ping to 192.168.1.5 failed -- Status: DestinationHostUnreachable

ComputerName   : 192.168.1.5
RemoteAddress  : 192.168.1.5
InterfaceAlias : vEthernet (CORP-External-Switch)
SourceAddress  : 10.199.48.170
PingSucceeded  : False
PingReplyDetails (RTT) : 0 ms

重新 Vlan 設定Reconfigure VLANs

若要移除實體而 VLAN 存取設定,並設定使用 vSwitch VLANID,您可以使用此步驟。You can use this step to remove the ACCESS VLAN setting from the physical NIC and to set the VLANID using the vSwitch.

您必須移除 VLAN 存取設定,以防止這兩個自動-標記輸出流量不正確的 VLAN ID 使用與從篩選輸入流量的不符存取 VLAN 收到You must remove the ACCESS VLAN setting to prevent both auto-tagging the egress traffic with the incorrect VLAN ID and from filtering ingress traffic which doesn’t match the ACCESS VLAN ID.

若要移除存取 VLAN 設定,您可以使用下列命令。You can use the following commands to remove the ACCESS VLAN setting.

Set-NetAdapterAdvancedProperty -Name "Test-40G-1" -RegistryKeyword VlanID -RegistryValue "0"
Set-NetAdapterAdvancedProperty -Name "Test-40G-2" -RegistryKeyword VlanID -RegistryValue "0"

您可以使用下列命令,來設定使用 vSwitch 特定 Windows PowerShell 命令 VLANID 並檢視這個動作的結果。You can use the following commands to set the VLANID using the vSwitch specific Windows PowerShell commands and to view the results of this action.

Set-VMNetworkAdapterVlan -VMNetworkAdapterName "VMSTEST" -VlanId "101" -Access -ManagementOS
Get-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName "VMSTEST"

以下是此命令的範例結果。Following are example results of this command.

VMName VMNetworkAdapterName 模式 VlanListVMName VMNetworkAdapterName Mode VlanList


   VMSTEST              Access 101     

您可以使用下列命令測試網路連接到檢視結果。You can use the following command to test the network connection and view the results.

Test-NetConnection 192.168.1.5

ComputerName   : 192.168.1.5
RemoteAddress  : 192.168.1.5
InterfaceAlias : vEthernet (VMSTEST)
SourceAddress  : 192.168.1.3
PingSucceeded  : True
PingReplyDetails (RTT) : 0 ms

如果您的結果不類似的範例結果且抓取失敗訊息」警告:無法 Ping 192.168.1.5-狀態:DestinationHostUnreachable,「確認 [vEthernet (VMSTEST)」適當的 IP 位址,執行下列命令。If your results are not similar to the example results and ping fails with the message "WARNING: Ping to 192.168.1.5 failed -- Status: DestinationHostUnreachable," confirm that the “vEthernet (VMSTEST)” has the proper IP address by running the following command.

Get-NetIPAddress -InterfaceAlias "vEthernet (VMSTEST)"

如果未的 IP 位址設定,您可以使用下列命令以修正此問題,並檢視您的動作的結果。If the IP address is not set, you can use the following command to correct the issue and view the results of your actions.

New-NetIPAddress -InterfaceAlias "vEthernet (VMSTEST)" -IPAddress 192.168.1.3 -PrefixLength 24

IPAddress : 192.168.1.3
InterfaceIndex: 37
InterfaceAlias: vEthernet (VMSTEST)
AddressFamily : IPv4
Type  : Unicast
PrefixLength  : 24
PrefixOrigin  : Manual
SuffixOrigin  : Manual
AddressState  : Tentative
ValidLifetime : Infinite ([TimeSpan]::MaxValue)
PreferredLifetime : Infinite ([TimeSpan]::MaxValue)
SkipAsSource  : False
PolicyStore   : ActiveStore

重新命名管理 NICRename the Management NIC

您可以使用此區段重新命名管理而,並 RDMA 之後使用不同的主機但 vNIC 執行個體。You can use this section to rename the Management NIC, and later use separate Host vNIC instances for RDMA.

您可以執行下列命令,而管理重新命名,並檢視某些 NIC 屬性。You can run the following commands to rename the Management NIC and view some NIC properties.

Rename-VMNetworkAdapter -ManagementOS -Name “VMSTEST” -NewName “MGT”
Get-VMNetworkAdapter -ManagementOS

以下是此命令的範例結果。Following are example results of this command.

名稱Name IsManagementOsIsManagementOs VMNameVMName SwitchNameSwitchName MacAddressMacAddress 狀態Status IPAddressesIPAddresses
CORP-外部開關切換至CORP-External-Switch 為 trueTrue   CORP-外部開關切換至CORP-External-Switch 001B785768AA001B785768AA {確定}{Ok}  
MGTMGT 為 trueTrue   VMSTESTVMSTEST E41D2D074071E41D2D074071 {確定}{Ok}  

您可以執行下列命令,可檢視某些其他 NIC 屬性。You can run the following command to view some additional NIC properties.

Get-NetAdapter

以下是此命令的範例結果。Following are example results of this command.

名稱Name InterfaceDescriptionInterfaceDescription ifIndexifIndex 狀態Status MacAddressMacAddress LinkSpeedLinkSpeed
vEthernet (MGT)vEthernet (MGT) HYPER-V Virtual 乙太網路卡 #2Hyper-V Virtual Ethernet Adapter #2 2828 向上Up E4-1D-2D-07-40-71E4-1D-2D-07-40-71 80 Gbps80 Gbps

測試 HYPER-V Virtual 切換 RDMATest Hyper-V Virtual Switch RDMA

下圖描述您的 HYPER-V 主機,包括 HYPER-V 主機 1 vSwitch 目前狀態。The following illustration depicts the current state of your Hyper-V hosts, including the vSwitch on Hyper-V Host 1.

測試 HYPER-V Virtual 開關切換至

設定優先順序主機但 vNIC 上標記補充先前的 VLAN 設定Set Priority tagging on the Host vNIC to complement the previous VLAN settings

您可以使用下列命令範例設定優先順序主機但 vNIC 上標記,並檢視您的動作的結果。You can use the following example commands to set priority tagging on the Host vNIC and view the results of your actions.

Set-VMNetworkAdapter -ManagementOS -Name "MGT" -IeeePriorityTag on
Get-VMNetworkAdapter -ManagementOS -Name "MGT" | fl Name,IeeePriorityTag


Name: MGT
IeeePriorityTag : On

有兩個主機 vNICs 建立 RDMACreate two Host vNICs for RDMA

您可以使用下列命令範例建立 RDMA 兩個主機 vNICs 和連接 vSwitch VMSTEST 它們。You can use the following example commands to create two host vNICs for RDMA and connect them to the vSwitch VMSTEST.

Add-VMNetworkAdapter –SwitchName "VMSTEST" –Name SMB1 –ManagementOS
Add-VMNetworkAdapter –SwitchName "VMSTEST" –Name SMB2 –ManagementOS

若要檢視管理 NIC 屬性,您可以使用下列命令範例。You can use the following example command to view Management NIC properties.

Get-VMNetworkAdapter -ManagementOS

以下是此命令的範例結果。Following are example results of this command.

名稱Name IsManagementOsIsManagementOs VMNameVMName SwitchNameSwitchName MacAddressMacAddress 狀態Status IPAddressesIPAddresses
CORP-外部開關切換至CORP-External-Switch 為 trueTrue CORP-外部開關切換至CORP-External-Switch 001B785768AA001B785768AA {確定}{Ok}  
MgtMgt 為 trueTrue VMSTESTVMSTEST E41D2D074071E41D2D074071 {確定}{Ok}  
SMB1SMB1 為 trueTrue VMSTESTVMSTEST 00155D30AA0000155D30AA00 {確定}{Ok}  
SMB2SMB2 為 trueTrue VMSTESTVMSTEST 00155D30AA0100155D30AA01 {確定}{Ok}  

指定 SMB 主機 vNICs IP 位址Assign an IP address to the SMB Host vNICs

您可以使用這個區段 IP addressrd 給 SMB 主機 vNICs vEthernet (SMB1) 和 vEthernet (SMB2)。You can use this section to assign IP addressrd to the SMB Host vNICs vEthernet (SMB1) and vEthernet (SMB2).

測試 40 G 2 實體卡與測試-40 G-1 仍然可以存取的 VLAN 101 與 102 設定。The TEST-40G-1 and TEST-40G-2 physical adapters still have an ACCESS VLAN of 101 and 102 configured. 因此,介面卡標記的流量-和 ping 成功。Because of this, the adapters tag the traffic - and ping succeeds.

之前,您會設定為零,這兩個 pNIC VLAN Id,然後為 VLAN 101 VMSTEST vSwitch。Previously, you configured both pNIC VLAN IDs to zero, then set the VMSTEST vSwitch to VLAN 101. 在那之後,您仍然可以使用 MGT 但 vNIC ping 遠端 VLAN 101 介面卡,但目前有不 VLAN 102 成員。After that, you were still able to ping the remote VLAN 101 adapter by using the MGT vNIC, but there are currently no VLAN 102 members.

您現在可以使用下列命令範例移除實體而防止這兩個自動-標記輸出資料傳輸與不正確的 VLAN ID 和防止篩選輸入流量的 VLAN 存取設定,不符合存取 VLAN id。Now you can use the following example command to remove the ACCESS VLAN setting from the physical NIC to prevent it from both auto-tagging the egress traffic with the incorrect VLAN ID and to prevent it from filtering ingress traffic that doesn’t match the ACCESS VLAN ID.

您可以使用下列命令範例完成這些目標加入新的 IP 位址介面 vEthernet (SMB1),並檢視結果。You can use the following example command to accomplish these goals by addtion a new IP address to interface vEthernet (SMB1), and view the results.

New-NetIPAddress -InterfaceAlias "vEthernet (SMB1)" -IPAddress 192.168.2.111 -PrefixLength 24

IPAddress : 192.168.2.111
InterfaceIndex: 40
InterfaceAlias: vEthernet (SMB1)
AddressFamily : IPv4
Type  : Unicast
PrefixLength  : 24
PrefixOrigin  : Manual
SuffixOrigin  : Manual
AddressState  : Invalid
ValidLifetime : Infinite ([TimeSpan]::MaxValue)
PreferredLifetime : Infinite ([TimeSpan]::MaxValue)
SkipAsSource  : False
PolicyStore   : PersistentStore

您可以使用下列命令範例遠端 VLAN 102 介面卡的測試及檢視結果。You can use the following example command to test the remote VLAN 102 adapter and view the results.

Test-NetConnection 192.168.2.5 

ComputerName   : 192.168.2.5
RemoteAddress  : 192.168.2.5
InterfaceAlias : vEthernet (SMB1)
SourceAddress  : 192.168.2.111
PingSucceeded  : True
PingReplyDetails (RTT) : 0 ms

您可以使用下列命令範例新增新的 IP 位址的介面 vEthernet (SMB2),以及檢視結果。You can use the following example command to add a new IP address for interface vEthernet (SMB2), and view the results.

New-NetIPAddress -InterfaceAlias "vEthernet (SMB2)" -IPAddress 192.168.2.222 -PrefixLength 24 

IPAddress : 192.168.2.222
InterfaceIndex: 44
InterfaceAlias: vEthernet (SMB2)
AddressFamily : IPv4
Type  : Unicast
PrefixLength  : 24
PrefixOrigin  : Manual
SuffixOrigin  : Manual
AddressState  : Invalid
ValidLifetime : Infinite ([TimeSpan]::MaxValue)
PreferredLifetime : Infinite ([TimeSpan]::MaxValue)
SkipAsSource  : False
PolicyStore   : PersistentStore

您不需要建立通訊因為測試連接再試一次。You do not need to test the connection again because communication is established.

RDMA 主機 vNICs 置於 VLAN 102Place the RDMA Host vNICs on VLAN 102

您可以使用本節 RDMA 主機 vNICs 給 VLAN 102。You can use this section to assign the RDMA Host vNICs to VLAN 102.

因為「MGT「主機但 vNIC 位於 VLAN 101,您可以使用下列命令範例 RDMA 主機 vNICs 置於預先存在 VLAN 102 並檢視您的動作的結果。Because the “MGT” Host vNIC is located on VLAN 101, you can use the following example commands to place the RDMA Host vNICs on the pre-existing VLAN 102 and view the results of your actions.

Set-VMNetworkAdapterVlan -VMNetworkAdapterName "SMB1" -VlanId "102" -Access -ManagementOS
Set-VMNetworkAdapterVlan -VMNetworkAdapterName "SMB2" -VlanId "102" -Access -ManagementOS

Get-VMNetworkAdapterVlan -ManagementOS

VMName VMNetworkAdapterName Mode VlanList
------ -------------------- ---- --------
   SMB1 Access   102 
   Mgt  Access   101 
   SMB2 Access   102 
   CORP-External-Switch Untagged

檢查以基礎實體 Nic SMB2 與對應的 SMB1Inspect the Mapping of SMB1 and SMB2 to the underlying Physical NICs

您可以使用本節檢查 SMB1 和以在 vSwitch 設定小組基礎實體 Nic SMB2 對應。You can use this section to inspect the mapping of SMB1 and SMB2 to the underlying physical NICs under the vSwitch SET Team. 實體 Nic 至主機但 vNIC 的關聯,而且隨機受重新建立和破壞期間。The association of Host vNIC to Physical NICs is random and subject to rebalancing during creation and destruction.

在這個情況您可以使用間接機制來查看目前的關聯。In this circumstance you can use an indirect mechanism to check the current association.

SMB1 及 SMB2 的 MAC 位址的相關聯的 NIC 小組成員測試 40 G 2。The MAC addresses of SMB1 and SMB2 are associated with the NIC Team member TEST-40G-2. 因為測試-40 G-1 不需要相關聯的 SMB 主機但 vNIC,且將不會允許使用的 RDMA 流量連結 SMB 主機但 vNIC 對應,直到不理想。This is not ideal because Test-40G-1 does not have an associated SMB Host vNIC, and will not allow for utilization of RDMA traffic over the link until an SMB Host vNIC is mapped to it.

若要查看這項資訊,您可以使用下列命令範例。You can use the following example commands to view this information.

Get-NetAdapterVPort (Preferred)

Get-NetAdapterVmqQueue

Name   QueueID MacAddressVlanID Processor VmFriendlyName
----   ------- ---------------- --------- --------------
TEST-40G-1 1   E4-1D-2D-07-40-71 1010:17
TEST-40G-2 1   00-15-5D-30-AA-00 1020:17
TEST-40G-2 2   00-15-5D-30-AA-01 1020:17

Get-VMNetworkAdapter -ManagementOS

Name IsManagementOs VMName SwitchName   MacAddress   Status IPAddresses
---- -------------- ------ ----------   ----------   ------ -----------
CORP-External-Switch True  CORP-External-Switch 001B785768AA {Ok}  
Mgt  True  VMSTEST  E41D2D074071 {Ok}  
SMB1 True  VMSTEST  00155D30AA00 {Ok}  
SMB2 True  VMSTEST  00155D30AA01 {Ok}  

因為您未尚未執行對應下列兩個命令應該返回任何資訊。Both commands below should return no information because you have not yet performed mapping.

Get-VMNetworkAdapterTeamMapping -ManagementOS -SwitchName VMSTEST -VMNetworkAdapterName SMB1
Get-VMNetworkAdapterTeamMapping -ManagementOS -SwitchName VMSTEST -VMNetworkAdapterName SMB2

您可以使用下列命令範例地圖 SMB1 和 SMB2 分開實體 NIC 小組的成員,並檢視您的動作的結果。You can use the following example commands to map SMB1 and SMB2 to separate physical NIC team members, and to view the results of your actions.

重要

確定您已完成此步驟進行之前,或將會失敗,您的實作。Ensure that you complete this step before proceeding, or your implementation will fail.

Set-VMNetworkAdapterTeamMapping -ManagementOS -SwitchName VMSTEST -VMNetworkAdapterName "SMB1" -PhysicalNetAdapterName "Test-40G-1"
Set-VMNetworkAdapterTeamMapping -ManagementOS -SwitchName VMSTEST -VMNetworkAdapterName "SMB2" -PhysicalNetAdapterName "Test-40G-2"

Get-VMNetworkAdapterTeamMapping -ManagementOS -SwitchName VMSTEST

NetAdapterName : Test-40G-1
NetAdapterDeviceId : {BAA9A00F-A844-4740-AA93-6BD838F8CFBA}
ParentAdapter  : VMInternalNetworkAdapter, Name = 'SMB1'
IsTemplate : False
CimSession : CimSession: .
ComputerName   : 27-3145G0803
IsDeleted  : False

NetAdapterName : Test-40G-2
NetAdapterDeviceId : {B7AB5BB3-8ACB-444B-8B7E-BC882935EBC8}
ParentAdapter  : VMInternalNetworkAdapter, Name = 'SMB2'
IsTemplate : False
CimSession : CimSession: .
ComputerName   : 27-3145G0803
IsDeleted  : False

確認 MAC 關聯Confirm the MAC associations

您可以使用下列命令範例,以確認您先前建立的 MAC 關聯。You can use the following example commands to confirm the MAC associations you have created previously.

Get-NetAdapterVmqQueue

Name   QueueID MacAddressVlanID Processor VmFriendlyName
----   ------- ---------------- --------- --------------
TEST-40G-1 1   E4-1D-2D-07-40-71 1010:17
TEST-40G-1 2   00-15-5D-30-AA-00 1020:17
TEST-40G-2 1   00-15-5D-30-AA-01 1020:17

因為這兩個主機 vNICs 上相同的子網路並具有相同的 VLAN ID (102),您就可以驗證通訊從遠端系統中,並檢視您的動作的結果。Because both Host vNICs reside on the same subnet and have the same VLAN ID (102), you can validate communication from the remote system, and view the results of your actions.

重要

在遠端電腦上,執行下列命令。Run the following commands on the remote computer.

Test-NetConnection 192.168.2.111


ComputerName   : 192.168.2.111
RemoteAddress  : 192.168.2.111
InterfaceAlias : Test-40G-2
SourceAddress  : 192.168.2.5
PingSucceeded  : True
PingReplyDetails (RTT) : 0 ms

Test-NetConnection 192.168.2.222

ComputerName   : 192.168.2.222
RemoteAddress  : 192.168.2.222
InterfaceAlias : Test-40G-2
SourceAddress  : 192.168.2.5
PingSucceeded  : True
PingReplyDetails (RTT) : 0 ms 


Set-VMNetworkAdapter -ManagementOS -Name "SMB1" -IeeePriorityTag on
Set-VMNetworkAdapter -ManagementOS -Name "SMB2" -IeeePriorityTag on
Get-VMNetworkAdapter -ManagementOS -Name "SMB*" | fl Name,SwitchName,IeeePriorityTag,Status

Name: SMB1
SwitchName  : VMSTEST
IeeePriorityTag : On
Status  : {Ok}

Name: SMB2
SwitchName  : VMSTEST
IeeePriorityTag : On
Status  : {Ok}


Get-NetAdapterRdma -Name "vEthernet*" | sort Name | ft -AutoSize

Name  InterfaceDescription Enabled
----  -------------------- -------
vEthernet (SMB2)  Hyper-V Virtual Ethernet Adapter #4  False  
vEthernet (SMB1)  Hyper-V Virtual Ethernet Adapter #3  False  
vEthernet (MGT)   Hyper-V Virtual Ethernet Adapter #2  False   


Enable-NetAdapterRdma -Name "vEthernet (SMB1)"
Enable-NetAdapterRdma -Name "vEthernet (SMB2)"
Get-NetAdapterRdma -Name "vEthernet*" | sort Name | fl *


Name  InterfaceDescription Enabled
----  -------------------- -------
vEthernet (SMB2)  Hyper-V Virtual Ethernet Adapter #4  True   
vEthernet (SMB1)  Hyper-V Virtual Ethernet Adapter #3  True  
vEthernet (MGT)   Hyper-V Virtual Ethernet Adapter #2  False

驗證從遠端系統 RDMA 功能Validate RDMA functionality from the remote system

您可以使用本節驗證本機系統都有 vSwitch,請從遠端系統 RDMA 功能,因此測試這兩個介面卡的 vSwitch 設定小組的成員。You can use this section to validate RDMA functionality from the remote system to the local system, which has a vSwitch, thereby testing both adapters that are members of the vSwitch SET team.

因為這兩個主機 vNICs \(SMB1 和 SMB2\)已指派給 VLAN 102,您可以選取 VLAN 102 遠端系統上的介面卡。Because both Host vNICs (SMB1 and SMB2) are assigned to VLAN 102, you can select the VLAN 102 adapter on the remote system.

此程序 NIC 測試 40 G-2 會 RDMA SMB1 (192.168.2.111) 和 SMB2 (192.168.2.222)。In this process, the NIC Test-40G-2 does RDMA to SMB1 (192.168.2.111) and SMB2 (192.168.2.222).

選用:您可能需要此系統防火牆停用。Optional: You might need to disable the Firewall on this system. 如需詳細資訊,請洽詢您 fabric 的原則。Consult your fabric policy for details.

Set-NetFirewallProfile -All -Enabled False

Get-NetAdapterAdvancedProperty -Name "Test-40G-2"

Name  DisplayNameDisplayValue   RegistryKeyword RegistryValue  
----  -----------------------   --------------- -------------  
.
.
Test-40G-2VLAN ID102VlanID  {102} 

Get-NetAdapter

Name  InterfaceDescriptionifIndex Status   MacAddress LinkSpeed
----  --------------------------- ------   ---------- ---------
Test-40G-2Mellanox ConnectX-3 Pro Ethernet A...#3   3 Up   E4-1D-2D-07-43-D140 Gbps


Get-NetAdapterRdma

Name  InterfaceDescription Enabled
----  -------------------- -------
Test-40G-2Mellanox ConnectX-3 Pro Ethernet Adap... True   


C:\TEST\Test-RDMA.PS1 -IfIndex 3 -IsRoCE $true -RemoteIpAddress 192.168.2.111 -PathToDiskspd C:\TEST\Diskspd-v2.0.17\amd64fre\
VERBOSE: Diskspd.exe found at C:\TEST\Diskspd-v2.0.17\amd64fre\\diskspd.exe
VERBOSE: The adapter Test-40G-2 is a physical adapter
VERBOSE: Underlying adapter is RoCE. Checking if QoS/DCB/PFC is configured on each physical adapter(s)
VERBOSE: QoS/DCB/PFC configuration is correct.
VERBOSE: RDMA configuration is correct.
VERBOSE: Checking if remote IP address, 192.168.2.111, is reachable.
VERBOSE: Remote IP 192.168.2.111 is reachable.
VERBOSE: Disabling RDMA on adapters that are not part of this test. RDMA will be enabled on them later.
VERBOSE: Testing RDMA traffic now for. Traffic will be sent in a parallel job. Job details:
VERBOSE: 34251744 RDMA bytes sent per second
VERBOSE: 967346308 RDMA bytes written per second
VERBOSE: 35698177 RDMA bytes sent per second
VERBOSE: 976601842 RDMA bytes written per second
VERBOSE: Enabling RDMA on adapters that are not part of this test. RDMA was disabled on them prior to sending RDMA traffic.
VERBOSE: RDMA traffic test SUCCESSFUL: RDMA traffic was sent to 192.168.2.111


C:\TEST\Test-RDMA.PS1 -IfIndex 3 -IsRoCE $true -RemoteIpAddress 192.168.2.222 -PathToDiskspd C:\TEST\Diskspd-v2.0.17\amd64fre\
VERBOSE: Diskspd.exe found at C:\TEST\Diskspd-v2.0.17\amd64fre\\diskspd.exe
VERBOSE: The adapter Test-40G-2 is a physical adapter
VERBOSE: Underlying adapter is RoCE. Checking if QoS/DCB/PFC is configured on each physical adapter(s)
VERBOSE: QoS/DCB/PFC configuration is correct.
VERBOSE: RDMA configuration is correct.
VERBOSE: Checking if remote IP address, 192.168.2.222, is reachable.
VERBOSE: Remote IP 192.168.2.222 is reachable.
VERBOSE: Disabling RDMA on adapters that are not part of this test. RDMA will be enabled on them later.
VERBOSE: Testing RDMA traffic now for. Traffic will be sent in a parallel job. Job details:
VERBOSE: 0 RDMA bytes written per second
VERBOSE: 0 RDMA bytes sent per second
VERBOSE: 485137693 RDMA bytes written per second
VERBOSE: 35200268 RDMA bytes sent per second
VERBOSE: 939044611 RDMA bytes written per second
VERBOSE: 34880901 RDMA bytes sent per second
VERBOSE: Enabling RDMA on adapters that are not part of this test. RDMA was disabled on them prior to sending RDMA traffic.
VERBOSE: RDMA traffic test SUCCESSFUL: RDMA traffic was sent to 192.168.2.222

從本機 RDMA 流量遠端電腦的測試Test for RDMA traffic from the local to the remote computer

在本區段中您就可以驗證 RDMA 流量的本機電腦上傳送到遠端電腦。In this section you can verify that RDMA traffic is sent from the local computer to the remote computer.

測試及檢視流量,您可以使用下列命令範例。You can use the following example commands to test and view the traffic flow.

Get-NetAdapter | ft –AutoSize

Name  InterfaceDescriptionifIndex Status   MacAddress LinkSpeed
----  --------------------------- ------   ---------- ---------
vEthernet (SMB2)  Hyper-V Virtual Ethernet Adapter #4  45 Up   00-15-5D-30-AA-0380 Gbps
vEthernet (SMB1)  Hyper-V Virtual Ethernet Adapter #3  41 Up   00-15-5D-30-AA-0280 Gbps


C:\TEST\Test-RDMA.PS1 -IfIndex 41 -IsRoCE $true -RemoteIpAddress 192.168.2.5 -PathToDiskspd C:\TEST\Diskspd-v2.0.17\amd64fre\
VERBOSE: Diskspd.exe found at C:\TEST\Diskspd-v2.0.17\amd64fre\\diskspd.exe
VERBOSE: The adapter vEthernet (SMB1) is a virtual adapter
VERBOSE: Retrieving vSwitch bound to the virtual adapter
VERBOSE: Found vSwitch: VMSTEST
VERBOSE: Found the following physical adapter(s) bound to vSwitch: TEST-40G-1, TEST-40G-2
VERBOSE: Underlying adapter is RoCE. Checking if QoS/DCB/PFC is configured on each physical adapter(s)
VERBOSE: QoS/DCB/PFC configuration is correct.
VERBOSE: RDMA configuration is correct.
VERBOSE: Checking if remote IP address, 192.168.2.5, is reachable.
VERBOSE: Remote IP 192.168.2.5 is reachable.
VERBOSE: Disabling RDMA on adapters that are not part of this test. RDMA will be enabled on them later.
VERBOSE: Testing RDMA traffic now for. Traffic will be sent in a parallel job. Job details:
VERBOSE: 0 RDMA bytes written per second
VERBOSE: 0 RDMA bytes sent per second
VERBOSE: 0 RDMA bytes written per second
VERBOSE: 15250197 RDMA bytes sent per second
VERBOSE: 896320913 RDMA bytes written per second
VERBOSE: 33947559 RDMA bytes sent per second
VERBOSE: 912160540 RDMA bytes written per second
VERBOSE: 34091930 RDMA bytes sent per second
VERBOSE: Enabling RDMA on adapters that are not part of this test. RDMA was disabled on them prior to sending RDMA traffic.
VERBOSE: RDMA traffic test SUCCESSFUL: RDMA traffic was sent to 192.168.2.5


C:\TEST\Test-RDMA.PS1 -IfIndex 45 -IsRoCE $true -RemoteIpAddress 192.168.2.5 -PathToDiskspd C:\TEST\Diskspd-v2.0.17\amd64fre\
VERBOSE: Diskspd.exe found at C:\TEST\Diskspd-v2.0.17\amd64fre\\diskspd.exe
VERBOSE: The adapter vEthernet (SMB2) is a virtual adapter
VERBOSE: Retrieving vSwitch bound to the virtual adapter
VERBOSE: Found vSwitch: VMSTEST
VERBOSE: Found the following physical adapter(s) bound to vSwitch: TEST-40G-1, TEST-40G-2
VERBOSE: Underlying adapter is RoCE. Checking if QoS/DCB/PFC is configured on each physical adapter(s)
VERBOSE: QoS/DCB/PFC configuration is correct.
VERBOSE: RDMA configuration is correct.
VERBOSE: Checking if remote IP address, 192.168.2.5, is reachable.
VERBOSE: Remote IP 192.168.2.5 is reachable.
VERBOSE: Disabling RDMA on adapters that are not part of this test. RDMA will be enabled on them later.
VERBOSE: Testing RDMA traffic now for. Traffic will be sent in a parallel job. Job details:
VERBOSE: 0 RDMA bytes written per second
VERBOSE: 0 RDMA bytes sent per second
VERBOSE: 385169487 RDMA bytes written per second
VERBOSE: 33902277 RDMA bytes sent per second
VERBOSE: 907354685 RDMA bytes written per second
VERBOSE: 33923662 RDMA bytes sent per second
VERBOSE: Enabling RDMA on adapters that are not part of this test. RDMA was disabled on them prior to sending RDMA traffic.
VERBOSE: RDMA traffic test SUCCESSFUL: RDMA traffic was sent to 192.168.2.5

最後一列在此輸出中,「RDMA 流量測試成功:RDMA 流量已傳送至 192.168.2.5,「示範,您已成功在您的介面卡設定匯集 NIC。The final line in this output, "RDMA traffic test SUCCESSFUL: RDMA traffic was sent to 192.168.2.5," demonstrates that you have successfully configured Converged NIC on your adapter.

本指南所有主題All topics in this guide

本指南包含下列主題。This guide contains the following topics.