Using DSC to deploy Hyper-V converged virtual network – Creating a converged virtual switch (Part 2)
In an earlier article, I had introduced DSC resources that can be used to deploy a Hyper-V converged virtual network. In this series of articles, we will build the converged network configuration for what is shown below.
Here is a recap of configuration needed.
- Create a host network team.
- Create a VM switch using the host team (today’s article).
- Create host VM adapters in the management OS to connect to the VM switch and assign VLANs and bandwidth settings.
- Assign IP addresses and DNS addresses, as required.
In the earlier article, we created a network team named HostTeam. In today’s article, we will see how to create a converged virtual switch using this host team adapter.
Creating a converged virtual switch using cVMSwitch DSC resource
If you have not downloaded the new DSC resource modules yet, you can do so from my Github repo or using the Install-Module cmdlet in WMF 5.0. To create a converged virtual switch, we will need the cVMSwitch resource from the cHyper-V module.
The cVMSwitch resource is a fork from the xVMSwitch resource in the xHyper-V resource module. To be able to create a converged virtual switch, we need to set the MinimumBandwidthMode property. This is what the cVMSwitch resource enables.
The Name property is a mandatory one which identifies the VM switch and the Type property defines the type of switch – External or Internal or Private – to be created. The AllowManagementOS boolean property can be used to specify if a VM network adapter in the management OS or root partition should be created. The MinimumBandwidthMode property defines how the bandwidth reservation must be done. If you specify Absolute, the subsequent VM network adapter settings can be used to specify the absolute bandwidth reservation (in mbps). By using Weight as the MinimumBandwidthMode, you can specify a percentage value as the bandwidth reservation for the VM network adapters. We will see more about this in the next article. Finally, the NetAdapterName can be used to specify which host network adapter should be used to create an external VM switch. In our demonstration, this is the HostTeam adapter created using the cNetworkTeam resource.
Let us see the configuration script that creates the external converged VM switch for us.
In the above configuration, I have included both network team and the VM switch creation. I have also added the DependsOn property in the HostSwitch configuration to specify that the VM switch should be created only if the network team named HostTeam exists. Since I set the MinimumBandwidthMode to Weight, subsequent VM network adapter creation must specify the percentage of bandwidth reserve instead of absolute value.
This is it. For the converged virtual network, we have created the network team and the VM switch. In the later articles, we will see how to create the VM network adapters in the management OS and complete the converged virtual network configuration.Share on: