Good day, Cloud Gurus,
and welcome back for this lesson
where we're going to take a look at Hyper-V networking.
Let's take a look at what we're going to cover.
First up we'll explore virtual network adapters.
Then we'll take a look at the Hyper-V virtual switch,
and then we'll do a high-level overview
of the advanced Hyper-V networking capabilities,
and then we'll wrap up
with a bit of a Hyper-V networking demo.
Let's get started.
Now you can provide network connectivity
to your virtual machines
using virtual network adapters.
And Hyper-V VMs can have one or more virtual adapters
and these virtual adapters support
most of the features you're used to
with physical network adapters
including things like virtual LANs or VLANs.
But they also support additional features
like bandwidth management.
There are 2 types of network adapters to be aware of.
The first is the legacy network adapter
and legacy network adapters pretend to be
an Intel network adapter
and really existed only in earlier versions of Hyper-V
to provide support for older operating systems.
Legacy network adapters are only available
with Generation 1 virtual machines
and are used to perform operating system installations
by performing a network boot
using a network based deployment service
like Windows deployment services
only on Generation 1 VMs.
And then there are the newer and faster network adapter
sometimes referred to as the synthetic network adapter.
These can be used with both Generation 1
and Generation 2 VMs,
but they don't support network boot on Generation 1 VMs.
Now your network adapters
are connected to a virtual switch
to provide network connectivity
between the VMs, the Hyper-V hosts,
and potentially the external physical network.
And there are 3 types of Hyper-V virtual switches.
The first to be aware of
is the private virtual switch.
It provides communication between each of the VMs
on the Hyper-V host.
It's useful to completely isolate the network traffic
for the virtual machines
from the host and the physical network.
The next virtual switch type to be aware of
is the internal virtual switch.
And as the name implies
it allows network communication between the VMs
and the Hyper-V hosts.
And there's actually a trick
to allow physical network access
using the internal virtual switch.
But we'll hold on that thought for now
and we'll take a look at that later on in this section
when we take a look at nested virtualization.
And the last and most commonly used switch type
in a production environment
is the external virtual switch.
As you would expect
the external virtual switch
provides access between your Vms,
the Hyper-V hosts, and the physical network.
And just one more quick note on virtual switches
you can extend the functionality
of a virtual switch
using virtual switch extensions
that allow you to capture, filter,
and forward your network traffic.
Now there are a range of advanced networking capabilities
available for Hyper-V hosts
the associated switches,
and the virtual network adapters,
and the VMs connected to them.
And Microsoft has been busy adding these features
over many versions of Window server.
And a lot of these features have actually been backported
from the features Microsoft themselves require
to run Hyper-V
as the back end for Azure VMs.
Let's cover off a few of the most prominent features.
The first is Router Guard.
It prevents router advertisement messages
from leaking out of VMs
to the physical network
and disrupting network routing.
And then there's DHCP Guard
and it offers a similar level of protection
but is used to prevent DHCP
or IP address assignment messages
from reaching the physical network.
And we'll be covering DHCP later on in this course too,
so don't worry if that term is unfamiliar at all.
And you can also team your network adapters together
for improved redundancy and performance.
The latest way to do this
is with Hyper-V switches
using switch embedded teaming
and we'll take a look at this in the demo.
And speaking of performance
with supported hardware
you can enable single root IO virtualization
on your network adapters
to improve the performance
by allowing virtual machine traffic
to bypass the virtual switch.
SR-IOV can only be configured
when creating a new virtual switch.
So you can't add this feature to an existing virtual switch.
Virtual machine queue
and the new virtual machine multi-queue
also improve network performance
for your virtual machines.
It works slightly differently to SR-IOV
but provides similar benefits.
Virtual machine queue assigns a queue
or multiple queues
with virtual machine multi-queue to a VM
to reduce packet sorting and overhead.
And virtual machine queue also requires supporting hardware.
And the final performance feature to be aware of
is IPSec task offloading.
And it requires support from the guest operating system
and network adapter
to offload the processing overhead associated with IPSec
from the virtual machine
to the host network adapter.
All right let's take a look at a demo
of configuring Hyper-V networking.
In this demo,
we have our existing Hyper-V server, CORP-BNE-HVO1.
And this Hyper-V host
has 3 network adapters attached to it.
The first network adapter will be used by the Hyper-V host
and then we'll use the other two adapters
to create a switch embedded network team,
which will create a new virtual switch
with the pair of network adapters.
And we have an existing virtual machine
and we will connect that virtual machine
to the new virtual switch
by attaching its virtual network adapter
to the virtual switch.
Let's take a look.
All right so here we are on our Hyper-V host
and I've gone ahead and launched Server Manager
and I've also gone ahead
and selected the local server on the left-hand menu.
Now let's go ahead and take a look
at the network interfaces on this server.
And we have our 3 network interfaces.
Let's quickly determine which of these is used by our host.
So I'm just going to right-click on Ethernet2
because it looks like it's being used by our host
and I'll just select Status
and then I'll select Details.
Okay and I can see that this has the IP address
that I want to use for our host.
So I'm going to go ahead and close this
and then I'll close again
and I'm going to rename this network adapter to host.
And now I'm going to rename
each of the other network adapters
to Guest1 and Guest2.
All right, now let's quickly take a look
at NIC Teaming in server manager.
Now previously, you used to team your network adapters
for Hyper-V using the network teaming feature
in Server Manager,
but now, for switch-embedded teaming
you actually configure that using PowerShell.
But you can still use network teaming within Server Manager
to configure network teaming
for say the host network adapter.
But for your virtual machines,
you use PowerShell
and switch embedded teaming.
Let's go ahead and launch Hyper-V manager
so I can show you where you configure your virtual switches.
So I'll just click Start
and then Administrative Tools.
And then I'll launch Hyper-V manager
and I'll select our host on the left-hand side.
And then we've got our virtual switch manager.
And then you can see here where you can create
an external, internal, or private virtual switch.
But to create a switch embedded network team,
we need to use PowerShell.
So I'm going to go ahead and close this
and then we'll go ahead and launch PowerShell.
And now to create our switch embedded network team
I'm going to use the new VMSwitch PowerShell cmdlet.
I'll provide a name for the switch
and I'll provide a list of the network adapters
that we want to use.
To get a list of the network adapters
I'm going to run, Get-NetAdapter,
and then we can run New-VMSwitch
provide a name for our virtual switch
and then we'll provide a list of the network adapters
that we want to use.
We can go ahead and run that.
All right our new virtual switch is now available
let's go ahead and minimize PowerShell
and we'll take a look in Hyper-V Manager.
We'll go into the Virtual Switch Manager again
and we can see we have our new network team virtual switch
and it's all grayed out in here
because it has to be configured using PowerShell.
So we can go ahead and cancel this.
Now let's go ahead and create a dummy virtual machine
and then we'll connect it to that virtual network.
So I'll just right-click the Hyper-V host, select New,
and then Virtual Machine.
And then I'll just click Finish
to accept the defaults.
And now let's open the settings for this virtual machine.
So you can navigate here to open settings
and you can also right-click the virtual machine
and select Settings.
And you can see here
we have our network adapter
and we can connect that to our virtual switch.
Then we can go ahead and click Apply.
All right, that concludes this demo.
We've successfully configured
a new switch embedded network team
and then connected a virtual machine to that virtual switch.
Let's wrap up with a bit of a summary
of what we've covered in this lesson.
All right so what have we covered?
Virtual network adapters provide network connectivity
for your Hyper-V virtual machines.
And virtual adapters connect to virtual switches
to provide connectivity between virtual machines
the Hyper-V host and the physical network.
And you can use an external virtual switch
to provide connectivity for your virtual machines
to the physical network.
And you can use switch embedded teaming
to combine network adapters
for higher performance and availability.
All right, that concludes this lesson.
Thanks for being with me.
And I hope you found it useful.
And I look forward to seeing you on the next lesson.