Windows NIC Teaming using PowerShell (Part 6)

by [Published on 9 Jan. 2014 / Last Updated on 9 Jan. 2014]

This article continues to examine how to implement Windows NIC Teaming in a virtual machine using Windows PowerShell.

If you would like to read the other parts in this article series please go to:

Introduction

In the previous article of this series we began describing how to use Windows PowerShell to implement Windows NIC Teaming on a virtual machine running on a Hyper-V host. This article continues our discussion by examining what happens when one team member fails. 

Quick Review

As a quick review, our test environment has a virtual machine named SRV35 running on a Hyper-V host. Both the host and guest operating systems are Windows Server 2012 R2.

The host has two physical network adapters that provide Internet connectivity. The host also has four Hyper-V virtual switches configured, two of which are of the external type while the other two are internal and private.

The virtual machine has four virtual network adapters installed, each of which is assigned to a different virtual switch on the host.

The following table summarizes the network configurations of the Hyper-V host and virtual machine:

Name of   virtual network adapter

Virtual switch   assigned to adapter

Type of   virtual switch

Ethernet

vSwitch-1

External

Ethernet 2

vSwitch-PRI

Private

Ethernet 3

vSwitch-INT

Internal

Ethernet 4

vSwitch-2

External

Table 1

We have used the New-NetLbfoTeam to create a new NIC team in the virtual machine. This team has two members (Ethernet and Ethernet 4) and each of these members is assigned to a different external virtual switch on the host.

Testing the NIC team

Let's test the NIC team on the virtual machine to see if it works. We'll start by verifying that the virtual machine has connectivity with the Internet through the external virtual switches on the host. The following commands are all run in the guest operating system of the virtual machine:

PS C:\> ping www.xbox.com

Pinging e2820.dspb.akamaiedge.net [23.61.59.141] with 32 bytes of data:
Reply from 23.61.59.141: bytes=32 time=29ms TTL=55
Reply from 23.61.59.141: bytes=32 time=27ms TTL=55
Reply from 23.61.59.141: bytes=32 time=28ms TTL=55
Reply from 23.61.59.141: bytes=32 time=28ms TTL=55

Ping statistics for 23.61.59.141:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 27ms, Maximum = 29ms, Average = 28ms

As you can see, we can ping something on the Internet from our virtual machine, so the NIC team is working in the virtual machine.

Let's use the Get-NetAdapter cmdlet to verify the status of all the virtual network adapters in the virtual machine:

PS C:\> Get-NetAdapter  | Format-Table Name,Status

Name                                    Status
----                                    ------
VMTestTeam                              Up
Ethernet 4                              Up
Ethernet 3                              Up
Ethernet 2                              Up
Ethernet                                Up

The team and all four virtual network adapters are up and running in the virtual machine.

Now let's see what happens to our team if one of its members loses network connectivity. There are various ways we could simulate failure, for example we could:

  • Disable one of the team's virtual network adapters
  • Disconnect one of the team's virtual network adapters from its virtual switch
  • Disable one of the host's external virtual switches
  • Disconnect the LAN cable from one of the physical network adapters on the host

Let's try the first approach and disable the virtual network adapter named Ethernet. Recall that the NIC team in the virtual machine has two members: Ethernet and Ethernet 4. So if we disable the virtual network adapter named Ethernet, the team still has Ethernet 4 so it should still work but it's performance will be degraded.

PS C:\> Disable-NetAdapter -Name "Ethernet" -Confirm:$false

Let's check the status again of the virtual network adapters in the virtual machine:

PS C:\> Get-NetAdapter  | Format-Table Name,Status

Name                                    Status
----                                    ------
VMTestTeam                              Up
Ethernet 4                              Up
Ethernet 3                              Up
Ethernet 2                              Up
Ethernet                                Disabled

Now let's see what's happening in the UI:

Image
Figure 1: One team member has been disabled to simulate failure.

Let's see what we can learn about the team's current operational status using PowerShell:

PS C:\> Get-NetLbfoTeam

Name                   : VMTestTeam
Members                : {Ethernet 4, Ethernet}
TeamNics               : VMTestTeam
TeamingMode            : SwitchIndependent
LoadBalancingAlgorithm : TransportPorts
Status                 : Degraded

The last line of the output above tells us that the status of the team is Degraded. That's because only one of its two members is functioning.

Which one is down?

PS C:\> Get-NetLbfoTeamMember -Team VMTestTeam

Name                    : Ethernet 4
InterfaceDescription    : Microsoft Hyper-V Network Adapter #4
Team                    : VMTestTeam
AdministrativeMode      : Active
OperationalStatus       : Active
TransmitLinkSpeed(Gbps) : 10
ReceiveLinkSpeed(Gbps)  : 10
FailureReason           : NoFailure

Name                    : Ethernet
InterfaceDescription    : Microsoft Hyper-V Network Adapter
Team                    : VMTestTeam
AdministrativeMode      : Active
OperationalStatus       : Failed
TransmitLinkSpeed(Mbps) : 0
ReceiveLinkSpeed(Mbps)  : 0
FailureReason           : NicNotPresent

The command output above tells us that the OperationalStatus of the virtual network adapter named Ethernet is Failed.

Why is the status of the team Degraded?

PS C:\> Get-NetLbfoTeamNic -Team VMTestTeam

Name                    : VMTestTeam
InterfaceDescription    : Microsoft Network Adapter Multiplexor Driver
Team                    : VMTestTeam
VlanID                  :
Primary                 : True
Default                 : True
TransmitLinkSpeed(Gbps) : 10
ReceiveLinkSpeed(Gbps)  : 10

The command output above shows that the transmit and receive speeds for the team are 10 Gbps. Keep that in mind for a moment.

Is the team really still working?

PS C:\> ping www.xbox.com

Pinging e2820.dspb.akamaiedge.net [23.61.59.141] with 32 bytes of data:
Reply from 23.61.59.141: bytes=32 time=31ms TTL=55
Reply from 23.61.59.141: bytes=32 time=28ms TTL=55
Reply from 23.61.59.141: bytes=32 time=31ms TTL=55
Reply from 23.61.59.141: bytes=32 time=30ms TTL=55

Ping statistics for 23.61.59.141:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 28ms, Maximum = 31ms, Average = 30ms

As you can see from the above, the Ping command verifies that the virtual machine still has connectivity with the Internet, so the team must still be working although its performance is degraded.

Now let's re-enable the disabled virtual network adapter:

PS C:\> Enable-NetAdapter -Name "Ethernet" -Confirm:$false

Let's check the status of the team again:

PS C:\> Get-NetLbfoTeam

Name                   : VMTestTeam
Members                : {Ethernet 4, Ethernet}
TeamNics               : VMTestTeam
TeamingMode            : SwitchIndependent
LoadBalancingAlgorithm : TransportPorts
Status                 : Up

The team is working again. Let's check the link speed:

PS C:\> Get-NetLbfoTeamNic -Team VMTestTeam

Name                    : VMTestTeam
InterfaceDescription    : Microsoft Network Adapter Multiplexor Driver
Team                    : VMTestTeam
VlanID                  :
Primary                 : True
Default                 : True
TransmitLinkSpeed(Gbps) : 20
ReceiveLinkSpeed(Gbps)  : 20

Notice that the link speed has gone from 10 Gbps up to 20 Gbps. So now we know that a status of Degraded means that the team still works but its link speed is lowered because of failure of one of its team members.

In the next article we'll examine some considerations you need to be aware of when using Windows NIC Teaming in a virtual machine.

If you would like to read the other parts in this article series please go to:

The Author — Mitch Tulloch

Mitch Tulloch avatar

Mitch Tulloch is a widely recognized expert on Windows administration, networking, and security. He has been repeatedly awarded Most Valuable Professional (MVP) status by Microsoft for his outstanding contributions in supporting users who deploy and use Microsoft platforms, products and solutions.

Latest Contributions

Advertisement

Featured Links