To get a functional and healthy Hyper-V environment, there are three crucial factors: proper configuration, monitoring, and backup and restore strategy. The goal of today´s article is the first part where we as IT Admins need to properly understand what Hyper-V offers through a built-in networking stack.
The same as physical network cards are used by computers and servers, virtual machines use virtual network cards to communicate with networks, known as vNIC. vNICs are configured based on the business needs and then assigned to the virtual machines. Hyper-V supports three types of virtual switches: external, internal, and private.
The External virtual switch enables connecting virtual machines with the rest of the physical or virtual network and the Internet. It is a common virtual switch used in most scenarios. If you are running DHCP in your network, your vNIC will get IPs automatically. If not, you will need to assign it manually.
The Internal virtual switch enables the communication between Hyper-V virtual machines and the host. It is mostly used for testing purposes as it acts as an isolated network segment.
The Private virtual switch provides communication only between virtual machines. Hyper-V host doesn’t see communication. This is the main difference comparing to the internal virtual switch. But, in both cases, internal and private virtual switch, you will need to configure network cards and IP addresses on both, host and virtual machines which is not the case for an external virtual switch.
The procedure of creating virtual switches is straightforward. I´ll show you how to do it in Windows Server 2019 / Hyper-V Server 2019, but the procedure and concept is also compatible with previous operating systems.
Please open Hyper-V Manager and on the right side of the window click Virtual Switch Manager. The Virtual Switch Manager will show you a list of the created virtual switches on the left side of the window, and allow you to create a new switch. Select what type of virtual switch you need to create and then click Create Virtual Switch.
In the new window, you need to define the name, add notes and choose a connection. If you are creating an External virtual switch, as I do, you will need to select a physical network card available on your host. External virtual switch will bind itself to a physical network card so that virtual machines can access a physical network.
Once you create a new virtual switch, you need to assign it to your virtual machine. You can do it by navigating to your virtual machine (right click > Settings) and then selecting virtual switch under Network Adapter > Virtual switch as shown in the screenshot below.
If you are creating a new virtual machine, you will see an option to select one of the available virtual network switches under Configure Networking. This was easy, isn’t it?
Two other important factors are monitoring and backup of your virtual machines. You can read more details about monitoring your Hyper-V host, virtual machines and other components on my tech article Get more visibility into Hyper-V Server with PRTG published by Paessler AG and other related articles on my blog. And the second part is having a backup of virtual machines that can be restored in minutes in case of failures. By using Altaro VM Backup, you can backup your virtual machines to your NAS or cloud storage. You can read more in my article Backup Hyper-V VMs to Synology and Azure Cloud Storage.
I hope you find this article useful. If so, you can share it with your network by clicking on the social media button below. In case of any questions, feel free to comment or contact me.