-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Configuring Windows Server Hybrid Advanced Services Exam Ref AZ-801
By :
Hyper-V can be enabled in numerous ways on a Windows 10/11 operating system. With Hyper-V features built into Windows, this becomes an easy task to complete with only minor configuration changes needed. We will be running Hyper-V inside of a nested virtualization environment, and deeper details on this approach can be found at https://docs.microsoft.com/virtualization/hyper-v-on-windows/user-guide/nested-virtualization.
For the most straightforward and repeatable approach, we will be using instructions that help you enable Hyper-V using the Windows PowerShell method. Let’s begin the configuration using the following steps:
Important note
Virtual machines share memory with the Hyper-V host computing environment, so you will need enough memory to handle the workload for these labs. We recommend at least 8 GB of memory to successfully complete the lab exercises in this book.
PowerShell, and then right-clicking on the entry and selecting Run as Administrator. You may need to select Yes to accept the user account control popup to continue.systeminfo command and hit Enter to run the command:A hypervisor has been detected. Features required for Hyper-V will not be displayed, then you already have Hyper-V installed and can skip to Step 6 to continue network switch configuration for our Hyper-V lab:
Figure 1.10 – Hyper-V requirements indicating that a hypervisor has been detected
Figure 1.11 – Hyper-V requirements indicating that a hypervisor has not been detected
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
Important – when using Windows Server for your Hyper-V lab
If you choose to use Window Server as your operating system for this Hyper-V lab environment, you can utilize the following command to install both Hyper-V and the Hyper-V Management Console for use on Windows Server:
Install-WindowsFeature -Name Hyper-V -IncludeManagementTools
Get-VMSwitch
SwitchType value of External:
Figure 1.12 – Running the Get-VMSwitch PowerShell command to determine the existing virtual switches
SwitchType value of External – we will use this later in multiple important configuration changes in Step 9 that are specific to your configuration. Please skip to Step 9 to continue our configuration.(Get-NetAdapter | Where-Object {$_.Status -eq "Up" -and !$_.Virtual}).NameIssuing the previous Get-NetAdapter command will present the results shown in Figure 1.13:
Figure 1.13 – Running a PowerShell command to determine a network adapter connected to the internet
The results in your open Windows PowerShell instance should successfully identify the name of the current network interface you are using for your internet connection on this device. Verify that this is the interface that you want to use for this lab setup.
Optional – If you intend to use another network interface for this internet connection, enter the following command in Windows PowerShell and review the results returned in Figure 1.14:
Figure 1.14 – Running a PowerShell command to determine a network adapter connected to the internet
In the preceding instance, NetAdapterName was identified as Ethernet 12, but we may want to use Ethernet 14 instead. In this case, we will update the following command to be used later in Step 9:
New-VMSwitch -Name AZ801PacktLabExternal -AllowManagementOS $true -NetAdapterName Ethernet 14
Server2022.iso for our scripted lab deployment.
Figure 1.15 – Unblocking a recently downloaded ISO image file for use in our lab
C:\AZ801PacktLab\iso.mkdir C:\AZ801PacktLab
Set-Location C:\AZ801PacktLab
$VMName='AZ801PacktLab-DC-01','AZ801PacktLab-HV-01','AZ801PacktLab-HV-02','AZ801PacktLab-FS-01'
$VMExternalSwitch='AZ801PacktLabExternal'
$VMInternalSwitch='AZ801PacktLabInternal'
$VMIso='c:\AZ801PacktLab\iso\Server2022.iso'
New-VMSwitch -Name $VMExternalSwitch -AllowManagementOS $true -NetAdapterName (Get-NetAdapter | Where-Object {$_.Status -eq "Up" -and !$_.Virtual}).Name
New-VMSwitch -name $VMInternalSwitch -SwitchType Internal
Foreach ($VM in $VMName) {
New-VM -Name $VM -MemoryStartupBytes 2GB -BootDevice VHD -NewVHDPath ".\VMs\$VM.vhdx" -Path .\VMData -NewVHDSizeBytes 40GB -Generation 2 -Switch $VMInternalSwitch
if($VM -match '-HV-') {
Set-VMProcessor -VMName $VM -ExposeVirtualizationExtensions $true
Set-VMMemory -VMName $VM -DynamicMemoryEnabled $false
Get-VMNetworkAdapter -VMName $VM | Set-VMNetworkAdapter -MacAddressSpoofing On
}
Add-VMScsiController -VMName $VM
Add-VMDvdDrive -Path $VMIso -VMName $VM -ControllerNumber 1 -ControllerLocation 0
$VMDvd = Get-VMDvdDrive -VMName $VM
Set-VMFirmware -VMName $VM -FirstBootDevice $VMDvd
Set-VMKeyProtector -NewLocalKeyProtector -VMName $VM
Enable-VMTPM -VMName $VM
}
Hyper-V switch management and pre-existing virtual switches
Please note that if you have already been using Hyper-V on the device where you intend to build our lab environment, you will want to consider either removing your existing Hyper-V external switch or making the necessary script adjustments for the existing virtual switch name in your configuration.
Now that we have created all of the necessary virtual machines, we will need to install the Windows Server 2022 operating system on all of our virtual machines. Let’s begin the configuration using the following steps:
Hyper-V Manager, then select Open. You will be presented with a list of virtual machines that we have previously created via a script.
Figure 1.16 – Selecting a virtual machine to start in Hyper-V Manager
Figure 1.17 – Starting a virtual machine inside of the Virtual Machine Connection console
Figure 1.18 – Starting the Microsoft Server 2022 operating system setup
Figure 1.19 – Continuing the Windows Server 2022 operating system installation
Figure 1.20 – Selecting to use an evaluation version in the Windows Server 2022 installation
Figure 1.21 – Selecting to install the Windows Server 2022 Datacenter (Desktop Experience)
Figure 1.22 – Accepting the Microsoft Software license terms
Figure 1.23 – Selecting Custom: Install Microsoft Server Operating System only (advanced)
Figure 1.24 – Installing the operating system on the available disk
Figure 1.25 – Installing Microsoft Server Operating System
Packtaz801guiderocks as a passcode for all your lab virtual machines. You may also create your own passcode for these lab machines; just be sure to record the passcode in a password keeper for later use in the lab exercises:
Figure 1.26 – Setting a new password for the administrator account
Figure 1.27 – Adjusting the display configuration of the virtual machine
This concludes the initial Hyper-V lab setup for use throughout the rest of the book and will position you for success throughout all the lab exercises. There will be some additional steps needed throughout the following chapters in this book, and these steps will be detailed in the technical requirements at the beginning of each chapter.
Change the font size
Change margin width
Change background colour