Good day, Cloud Gurus,
and welcome back for this introductory lesson on Hyper-V.
Let's take a look at what we're going to cover.
First up, we'll do a bit of an introduction to Hyper-V.
We'll cover off the installation and management of Hyper-V.
And we'll take a look at a demo of installing Hyper-V
and exploring the Hyper-V management console.
We'll also cover all virtual machine generations.
And finally, we'll wrap up with a look
at the most recent changes to Hyper-V's
hypervisor scheduler.
Let's get started.
Now, we introduced virtualization and hypervisors
way back at the start of the course.
So to quickly recap,
a hypervisor is a software layer
that allows you to divide up the resources of a server;
things like processor, storage,
and memory between virtual machines,
which are additional operating systems
running on the same hardware.
Now, Hyper-V is Microsoft's hypervisor.
When you deploy the Hyper-V role to a Windows server,
it becomes a Hyper-V host.
And the virtual machines are referred to as guests,
just like guests staying in a Hyper-V hotel.
Now, there are some requirements
to run Hyper-V on a physical server,
and these include things like a 64-bit processor
with second-level address translation, or SLAT,
Intel or AMD virtualization technology,
and a processor with VM monitor mode extensions,
hardware enforced data execution prevention,
and sufficient hardware to support the virtual machines,
including ample disk space and memory capacity.
And for your guest operating systems,
they can run all of the major Linux distributions
or they can run Windows,
be it either Windows Server
or Windows clients like Windows 10.
Now, Hyper-V can be deployed on Windows clients.
And the version of Hyper-V that is installed
on Windows 10 or Windows 11
is referred to as Client Hyper-V.
Now, we're not going to take a look
at Client Hyper-V in this section,
but I want you to be aware that it's there
and it's super handy if you want to run up
a copy of Windows Server on your laptop.
And as we mentioned, you can deploy it
on Windows Server as a server role.
And there used to be a separate standalone Hyper-V server.
But as of Windows Server 2019, that is no longer available.
So you can now only install Hyper-V directly
on top of Windows Server.
And where possible, you should deploy Hyper-V
using the Server Core installation option,
and like all Windows Server roles,
you can install Hyper-V using Server Manager,
PowerShell, or the Windows Admin Center.
And for management,
Hyper-V has a dedicated management console,
which is Hyper-V Manager.
But you can also manage Hyper-V using PowerShell
and the Windows Admin Center.
And in my experience, you'll use a mixture of these tools
depending on your requirements at the time.
It's also important to know
that Hyper-V uses WS-Management, or WSMan,
which you'll remember back
from our PowerShell remoting lessons.
And as we know, WSMan allows us to authenticate
using either CredSSP or Kerberos.
And depending on the use case,
Hyper-V will use either of these to authenticate you.
All right, let's take a quick look at a demo.
In this demo, we will install the Hyper-V role
on a new server, CORP-BNE-HV01.
And because we'll be spending quite a bit of time
in Hyper-V Manager throughout this section,
we'll take a moment to explore it
and get familiar with it in this demo.
Let's jump in.
All right, so here we are logged on
to our soon to be new Hyper-V server.
We'll go ahead and launch PowerShell.
And then I'm just going to run the systeminfo command,
because this allows you to view
whether the server would be capable
of running Hyper-V or not.
So I'm just going to go ahead and run systeminfo.
And then right down at the bottom
is where you see the Hyper-V requirements.
Now, you can see here it's saying
that a hypervisor has been detected
and features required for Hyper-V will not be displayed.
The reason it's displaying this
is because I'm actually using nested Hyper-V
to demo Hyper-V to you,
and we're going to cover nested Hyper-V
right at the end of this section.
But for now, let's go ahead
and install Hyper-V on this server.
And to do that, we'll run Install-WindowsFeature,
specify the Hyper-V role,
and specify that we want to include the management tools.
We can go ahead and press Enter to run that.
I'll just speed this installation up a little bit.
And now, as you can see here,
we need to restart the server
to finish the installation of Hyper-V.
So we'll go ahead and run
the Restart-Computer PowerShell cmdlet.
All right, and we'll come back once that server's restarted.
All right, the server's finished restarting.
Let's go ahead and launch Hyper-V Manager.
So we'll just click on Start
and then we'll select Administrative Tools,
and then we'll launch Hyper-V Manager.
I'll just expand Hyper-V Manager out a little bit.
All right, now let's go ahead
and create a dummy virtual machine.
I'm going to go ahead and select my Hyper-V host
in the left-hand pane,
and then I'm going to select New and then Virtual Machine.
Now, I don't need to actually configure the virtual machine
to show you what I want to show you in this demo.
So I'm just going to go ahead and click Finish
to accept all the defaults for our new virtual machine.
All right, now, as you can see here,
in the left-hand pane,
you get a list of all the Hyper-V hosts
that you're connected to with Hyper-V Manager,
and you can right-click and connect
to additional Hyper-V hosts.
And in the middle pane, at the top,
you get a list of your virtual machines running
on the selected Hyper-V host.
And right in the center, you get a list of checkpoints
for the selected virtual machine,
and we'll cover checkpoints in a future lesson.
And then down the bottom, you get all the details
of the virtual machine that you have selected,
including a summary, memory,
networking and replication information.
And then over in the right-hand pane,
you get actions to perform on the Hyper-V host
in the top right.
And then in the bottom right,
you get actions to perform
on the virtual machine that you have selected.
All right, now I know that was very quick,
but I just wanted to quickly show you
the Hyper-V management console,
because I find a lot of people get confused
by the Hyper-V host actions
and the Hyper-V virtual machine actions
in that right-hand pane when they first start using Hyper-V.
So that concludes this demo.
Let's continue on with the lesson.
When Hyper-V first became available in Windows Server 2008,
we got access to what's now called
Generation 1 virtual machines.
And Generation 1 virtual machines
use a virtualized BIOS, which is now considered legacy,
and more traditional hardware emulated through software,
including a virtual floppy disk,
for anyone that's old enough to know what that is.
And Generation 1 VMs provided support
for 32-bit guest operating systems.
Now, Generation 1 VMs support all the versions
of Windows Server that are available today.
And they also support most of the major Hyper-V features.
And then we have Generation 2 VMs,
which were introduced as part of Windows Server 2012 R2.
Generation 2 VMs support only
64-bit guest operating systems
and they add support for the hot-add of hardware,
including adding disks and network adapters
without having to reboot the guest virtual machine.
They also add support for secure boot
with UEFI firmware replacing the BIOS,
and support for shielded VMs which protect the VMs
from the administrator of the Hyper-V host.
You also need Generation 2 VMs
if you want to support the latest,
highly available Hyper-V storage technology,
which is Storage Spaces Direct.
And Generation 2 VMs support larger boot volumes
up to 64 terabytes in size.
Now, if you remember back to our lessons
on Azure virtual machines,
some of this might to start sound familiar,
and that's because of course,
Microsoft runs Hyper-V to provide virtual machines on Azure.
Now let's quickly cover off one more important topic
around virtual machine resources.
As we mentioned at the start of this lesson,
VMs have to share resources on the Hyper-V host,
but the Hyper-V host has to share these resources too.
This is achieved in Hyper-V
by allocating a partition to each VM
and a separate partition
for the host operating system called the root partition.
For memory and disk, this is mostly straightforward.
You can carve out memory and disk
and make sure that each guest virtual machine
has independent access to the data stored in memory or disk.
But the processor is a little different.
To boost the performance of modern processors,
that've added what's known
as simultaneous multi-threading, or SMT.
And this allows multiple processors
to share a single CPU core.
With Hyper-V, that means that different virtual machines
can share the same processor core.
And this use of CPU cores is referred to
as the classic scheduler.
And then came along a bunch of CPU vulnerabilities
that ruined everything.
These vulnerabilities allow a VM
to potentially peak at a VM in a separate partition.
So in Windows Server 2019,
Microsoft introduced the core scheduler.
With the core scheduler,
virtual machines in different partitions
do not share CPU cores.
But because of this, it can lead to reduced performance.
Now, you can also enable the core scheduler
on Windows Server 2016
if it has the latest updates installed.
All right, let's take a look at
some of the key takeaways from this lesson.
Install the Hyper-V role on server core wherever possible
and don't install any other server roles
on your Hyper-V hosts.
And you can manage Hyper-V with Hyper-V Manager,
the Hyper-V PowerShell module and Windows Admin Center.
And you should use Generation 2 VMs
for improved security features like secure boot.
And you should use the core hypervisor scheduler
on all your Hyper-V hosts, where it is supported,
to improve the security posture of your Hyper-V hosts.
All right, thanks for being with me in this lesson.
I hope you found it useful
and I look forward to seeing you in the next lesson.