In the previous post, we examined how Hyper-V virtual switches are created using the Hyper-V Manager and Powershell.

In this third and last part of the Hyper-V virtual switch overview, let’s look at managing Hyper-V virtual switches. We will also take a look at the tools used, both from a GUI perspective and the command line as well as best practices when doing so.

Protect Your Data with BDRSuite

Cost-Effective Backup Solution for VMs, Servers, Endpoints, Cloud VMs & SaaS applications. Supports On-Premise, Remote, Hybrid and Cloud Backup, including Disaster Recovery, Ransomware Defense & more!

Table of Contents

  1. Managing Hyper-V Virtual Switches
  2. Manage Hyper-v Virtual Machine with Hyper-V Manager
  3. Manage Hyper-v Virtual Machine with Failover Cluster Manager
  4. Manage Hyper-v Virtual Machine with PowerShell
  5. Configuring VLAN connectivity
  6. Concluding Thoughts

Managing Hyper-V Virtual Switches

Hyper-V has a number of different tools that are used in managing the Hyper-V infrastructure. These include a wide range of both free and paid tools that can help organizations effectively provision and manage the Hyper-V network infrastructure.

For the most part, most of the tools used are free and out-of-the-box tools that can effectively provide Hyper-V virtual switch management.

Download Banner

We will look at the following:

  • Hyper-V Manager
  • Failover Cluster Manager
  • PowerShell
  • Configuring VLAN connectivity

The above tools cover the gamut of needs related to Hyper-V management, including Hyper-V virtual switches, from the very basic, to large scale enterprise environments with many Hyper-V clusters, hosts, etc.

Let’s look at these different tools one-by-one to see how they weigh into the overall creation and management of Hyper-V virtual switches.

Manage Hyper-v Virtual Machine with Hyper-V Manager

Hyper-V Manager is included when you install the Hyper-V Role on a Hyper-V host. The Hyper-V manager is the most basic tool you use to interface with Hyper-V configuration and provisioning. You can use Hyper-V manager to manage one host locally or you can add additional Hyper-V hosts that you want to provision or manage over the network from a single Hyper-V Manager installation on a server.

Hyper-V Manager contains a “sub” management console for managing Hyper-V virtual switches. This is called the Virtual Switch Manager. It is found under the Actions pane in the Hyper-V Manager.

Hyper-V Virtual Switch

Launching the Virtual Switch Manager in Hyper-V

In the Hyper-V Virtual Switch Manager, it provides an intuitive way to create new Hyper-V virtual switches.

Hyper-V Virtual Switch

Creating a new Hyper-V virtual switch using the Hyper-V Manager

In the Virtual Switch Manager, you see all the available switch types that can be configured for handling traffic in the Hyper-V host. The switch types are:

  • External
  • Internal
  • Private

Generally, the External virtual switch type is the most commonly used and configured switch in the Hyper-V environment. The External virtual switch is the type of switch that allows traffic to traverse between virtual machines and the external physical network. The interface is very simple to provision a new switch. Simply click the New virtual network switch link, name the new virtual switch, set the connection type along with the physical adapter backing the connection. Additionally, you can set the VLAN ID for the management operating system if needed.

Hyper-V Virtual Switch

Creating a new External virtual switch in Hyper-V Virtual Switch Manager


Manage Hyper-v Virtual Machine with Failover Cluster Manager

In most production environments, Hyper-V is running in a cluster configuration which means there are multiple Hyper-V hosts that are managed via Windows Failover Clustering. Virtual machines can then be protected with Failover Cluster high-availability mechanisms which allow healthy Hyper-V hosts to assume virtual machines that were running on a failed host.

By default, the Failover Cluster Manager is the in-the-box tool used to manage and interact with the Windows Failover Cluster hosting Hyper-V virtual machines. There are certain features and functionality related to Hyper-V networking that is configured at the Failover Cluster level. These include configuring networks for cluster and the Live Migration network.

Understanding the scope of the Hyper- network when Hyper-V clusters are involved is essential to understanding the overall management and configuration of the Hyper-V environment. Below, Failover Cluster Manager is pulled up showing the configured networks on the Hyper-V cluster.

You can view the properties of the networks; however, these are created by the networks that are available on the Hyper-V host itself. Once the networks are provisioned from the host perspective, you can assign them to different functions, such as Live Migration.

Hyper-V Virtual Switch

Viewing the Hyper-V Failover Cluster Networks configured

Under the Actions pane, you will see the Live Migration Settings which allow configuring the network(s) you want to use for Live Migration.

Hyper-V Virtual Switch

Launching the Live Migration Settings in Failover Cluster Manager

Under the Live Migration Settings, you will see the Networks for Live Migration listed, which default are all of them.

Hyper-V Virtual Switch

Configuring the networks used for Live Migration in Hyper-V Failover Cluster Manager


Manage Hyper-v Virtual Machine with PowerShell

PowerShell is the de facto scripting language for Windows environments (also compatible with Linux now) for managing, configuring, and provisioning resources. This is certainly true with the Hyper-V environment as well. Just about anything that can be managed and configured in Hyper-V GUI tools can be managed and configured in PowerShell. Additionally, there are things that can be configured in PowerShell that can’t be configured in the GUI tools and can certainly be done more easily.

Automation is the key to successfully keeping pace in most environments today. PowerShell scripting in Hyper-V environments certainly allows administrators to leverage powerful automation at scale. This is especially helpful when there are many hosts, perhaps hundreds or more. Manually making changes across large environments simply is not practical.

Using PowerShell one-liner cmdlets, Hyper-V virtual switches can easily be configured.

Below are the three cmdlets needed to configure the three different types of Hyper-V virtual switches.

  • New-VMSwitch -name ExternalSwitch -NetAdapterName Ethernet -AllowManagementOS $true
  • New-VMSwitch -name InternalSwitch -SwitchType Internal
  • New-VMSwitch -name PrivateSwitch -SwitchType Private


Configuring VLAN connectivity

One of the requirements that many organizations have is trunking VLANs on physical switches. VLANs are used to segment layer 2 traffic to a specific subnet. This reduces broadcast domains, helps to improve security, and improves manageability. The need to utilize VLANs with Hyper-V virtual switches can exist as well.

There are a couple of configurations to keep in mind when configuring VLAN with Hyper-V:

  • To configure a particular VLAN ID for Hyper-V management traffic, specify that VLAN ID in the Virtual Switch properties in Hyper-V Manager using the Virtual Switch Manager dialog.

Hyper-V Virtual Switch

Configuring a VLAN for Hyper-V Management

  • To configure a particular VLAN ID for a virtual machine, specify that VLAN ID in the VM Network Adapter properties in Hyper-V Manager in the Settings of that virtual machine.

Hyper-V Virtual Switch

Configuring the VLAN ID on a Hyper-V virtual machine

By having the flexibility to configure the VLAN IDs on both the management operating system and the virtual machines themselves, administrators have quite a bit of flexibility in configuring the Hyper-V environment and “plumbing” traffic throughout the environment connected to the physical network. Understanding the capabilities and options helps to manage network traffic according to the needs of the business.

Concluding Thoughts

Creating Hyper-V virtual switches and Managing them is an extremely important aspect of Hyper-V management. The Hyper-V virtual switch is the virtual software component of the hypervisor that allows interfacing the virtual machines with the physical network and allowing traffic to flow in and out of the virtualized environment. There are many tools that provide various abilities to manage the Hyper-V virtual switch. These include the Hyper-V Manager, PowerShell, and Failover Cluster Manager. Additionally, VLANs provide the capability to segment traffic of the guest virtual machines as well as the management operating system as needed. VLAN trunking is a capability that has long been used in the physical network. It is great that administrators have this ability in the Hyper-V virtual switch as well to provide the networking capabilities needed for the packet flow.

Related Posts:
Hyper-V Virtual Switch Part 1 : Overview
Hyper-V Virtual Switch – Part 2 – Creating Hyper-V Virtual Switches

Follow our Twitter and Facebook feeds for new releases, updates, insightful posts and more.

Rate this post