1

PowerShell DSC Resources to Configure Switch Embedded Teaming and NAT Switch in Windows Server 2016

Earlier this year, I released a bunch of DSC resources packaged as cHyper-V resource module. The resources are focused on configuring Hyper-V networking. For example, you can use the resources in the cHyper-V module to configure a converged network switch on Hyper-V. These resources have been very handy for me and I built and re-built a few Hyper-V clusters with a lot of ease.

With the Server 2016 TP4 release, I wanted to take advantage of DSC as build my test labs. So, I wrote a couple of DSC resources and added to the cHyper-V resource module.

Switch Embedded Teaming (SET)

With Windows Server 2016, there is a new networking feature called Switch Embedded Teaming (SET). In the older method of creating a converged network, we created a native network team and then used that for VM switch. With SET, we can create a team of network adapters (up to 8) embedded within the virtual switch.

Here is the graphical representation of SET (from TechNet).

Using this DSC resource for creating Switch Embedded Teaming (SET) is straightforward. The following screenshot shows the available resource properties.

Here is the sample configuration that shows how to use the resource.

This is all you need to do. All members that should be a part of SET can be listed as a value of the NetAdapterName property. Setting AllowManagementOS to $true in the SET configuration creates an adapter in the management OS. The cVMNetworkAdapter is an option configuration. It is not required unless you want to add a second adapter to the management OS that is connected to the SET.

NAT switch Configuration

Starting with Server 2016 TP4, you can create a new VM switch type called NAT switch. This is mostly meant for container scenarios but there is nothing limiting you from taking advantage of this in a scenario that requires private connectivity within the VMs but needs external access for connecting to public Internet. This switch configuration is very simple and I wrapped up those steps in a DSC resource module.

cNatSwitch

The Name property identifies the name of the VM switch and the NATSubnetAddress properties identifies the address range that should be used for NATing.

Here is how you use this resource.

Looks like there are issues with the NAT switch configuration and NAT configuration overall. They don’t seem to be cleaning up well when we remove the configuration. So, you may find that using the same name or subnet address values for the switch creating multiple times will fail.

You can get these resource modules directly from my Github repository or from the PowerShell Gallery.

Go ahead and try these new resources. Feel free to create any bug report or feature requests as needed.

Filed in: Articles, Hyper-V, Online Only Tags: , ,

One Response to "PowerShell DSC Resources to Configure Switch Embedded Teaming and NAT Switch in Windows Server 2016"

Leave a Reply

Submit Comment

© 2017 PowerShell Magazine. All rights reserved. XHTML / CSS Valid.
Proudly designed by Theme Junkie.
%d bloggers like this: