Book Image

Configuring Windows Server Hybrid Advanced Services Exam Ref AZ-801

By : Chris Gill
Book Image

Configuring Windows Server Hybrid Advanced Services Exam Ref AZ-801

By: Chris Gill

Overview of this book

Configuring Windows Server Hybrid Advanced Services Exam Ref AZ-801 helps you master various cloud and data center management concepts in detail, helping you grow your expertise in configuring and managing Windows Server in on-premises, hybrid, and cloud-based workloads. Throughout the book, you'll cover all the topics needed to pass the AZ-801 exam and use the skills you acquire to advance in your career. With this book, you’ll learn how to secure your on-premises Windows Server resources and Azure IaaS workloads. First, you’ll explore the potential vulnerabilities of your resources and learn how to fix or mitigate them. Next, you'll implement high availability Windows Server virtual machine workloads with Hyper-V Replica, Windows Server Failover Clustering, and Windows File Server. You’ll implement disaster recovery and server migration of Windows Server in on-premises and hybrid environments. You’ll also learn how to monitor and troubleshoot Windows Server environments. By the end of this book, you'll have gained the knowledge and skills required to ace the AZ-801 exam, and you'll have a handy, on-the-job desktop reference guide.
Table of Contents (31 chapters)
1
Part 1: Exam Overview and the Current State of On-Premises, Hybrid, and Cloud Workflows
3
Part 2: Secure Windows Server On-Premises and Hybrid Infrastructures
9
Part 3: Implement and Manage Windows Server High Availability
13
Part 4: Implement Disaster Recovery
17
Part 5: Migrate Servers and Workloads
23
Part 6: Monitor and Troubleshoot Windows Server Environments

Setting up a lab environment using Hyper-V

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:

  1. We must first validate that the device we are using meets the following hardware requirements:
    • The operating system must be running either Windows 10 or Windows 11 Enterprise, Pro, or Education versions; Windows Server (version 2012 R2 or later) can also be used
    • The installed 64-bit processor (either AMD or Intel) supports Second Level Address Translation (SLAT)
    • The installed CPU supports the VM Monitor Mode Extension (called VT-x on Intel-based CPUs)
    • A minimum of 4 GB of memory installed

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.

  • The following configurations will need to be enabled in the system BIOS (each manufacturer will have a slightly different way to enter the boot/BIOS configuration menus, so it is best to search for and identify configuration instructions pertaining to your specific device model):
    • A feature called Virtualization Technology (each motherboard manufacturer may have a different label for this, e.g., Intel ® Virtualization Technology or Intel VT-d where appropriate)
    • A feature called Hardware Enforced Data Execution Prevention
  1. Once the above requirements are met, we can continue with the setup of the intended device by opening Windows PowerShell as an administrator. This can be done by opening the Windows start menu, typing 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.
  2. Enter the systeminfo command and hit Enter to run the command:
    • At the bottom of the returned result set, if you receive the message shown in Figure 1.10 saying 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.10 – Hyper-V requirements indicating that a hypervisor has been detected

  • At the bottom of the result set returned, if you receive a list of four requirements as shown in Figure 1.11, confirm that all requirements result in a Yes response validating that all requirements for Hyper-V have been met on this device:
Figure 1.11 – Hyper-V requirements indicating that a hypervisor has not been detected

Figure 1.11 – Hyper-V requirements indicating that a hypervisor has not been detected

  1. Reusing the already open administrative Windows PowerShell, enter the following command to enable the Hyper-V components on your device:
    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

  1. When you are prompted to reboot the device, please choose Yes. Note that you may be required to reboot the device multiple times to complete the setup and configuration.
  2. If this is the first time you have installed Hyper-V on this device, you can proceed to Step 7:
    • If you are unsure or have an existing virtual switch configured, reuse the already open administrative Windows PowerShell and enter the following command:
      Get-VMSwitch
    • Carefully review the results returned, per Figure 1.12, to determine whether any of the existing virtual switches have a SwitchType value of External:
Figure 1.12 – Running the Get-VMSwitch PowerShell command to determine the existing virtual switches

Figure 1.12 – Running the Get-VMSwitch PowerShell command to determine the existing virtual switches

  • Capture the name of the existing virtual switch that has a 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.
  1. Next, we will determine the network adapter for the device that you will utilize for connecting to the internet. Reusing the already open administrative Windows PowerShell, enter the following command and review the results returned in Figure 1.13:
    (Get-NetAdapter | Where-Object {$_.Status -eq "Up" -and !$_.Virtual}).Name

Issuing 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

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

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
  1. Visit https://www.microsoft.com/evalcenter/evaluate-windows-server-2022-preview to download an evaluation copy of Windows Server 2022. The following steps will help you ensure that the newly downloaded evaluation software is safely unblocked for use on your system:
    • Once the ISO file has finished downloading, you will need to rename the ISO to Server2022.iso for our scripted lab deployment.
    • Locate and right-click on the newly downloaded file and select Properties. In the properties, click the General tab near the bottom. There is a security section where you will select the checkbox for Unblock. Select OK to continue:
Figure 1.15 – Unblocking a recently downloaded ISO image file for use in our lab

Figure 1.15 – Unblocking a recently downloaded ISO image file for use in our lab

  • Copy the downloaded file into C:\AZ801PacktLab\iso.
  1. Use PowerShell to create a demo VM:
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:

  1. Install Windows Server 2022 on the VM:
    • Open the Windows Start menu and search for Hyper-V Manager, then select Open. You will be presented with a list of virtual machines that we have previously created via a script.
    • Connect to one of our four virtual machines by right-clicking and selecting Connect…, as displayed in the following screenshot:
Figure 1.16 – Selecting a virtual machine to start in Hyper-V Manager

Figure 1.16 – Selecting a virtual machine to start in Hyper-V Manager

  • From the Virtual Machine Connection window, we can either select the Start button in the center of the screen or select the green Start button in the taskbar at the top of the screen:
Figure 1.17 – Starting a virtual machine inside of the Virtual Machine Connection console

Figure 1.17 – Starting a virtual machine inside of the Virtual Machine Connection console

  1. Ensure that you press a key inside Virtual Machine Connection to begin the operating system’s installation quickly after the virtual machine boots. If you do not receive a Microsoft Server Operating System Setup screen, you will need to reset the VM and attempt to boot into the DVD again to begin the installation.
  2. In Microsoft Server Operating System Setup, select Next to continue:
Figure 1.18 – Starting the Microsoft Server 2022 operating system setup

Figure 1.18 – Starting the Microsoft Server 2022 operating system setup

  1. On the following page, select Install Now:
Figure 1.19 – Continuing the Windows Server 2022 operating system installation

Figure 1.19 – Continuing the Windows Server 2022 operating system installation

  1. In Activate Microsoft Server Operating System Setup, select I don’t have a product key to continue our installation as shown in the following screenshot. Please note that these evaluation virtual machines will have 180 days before they are no longer licensed under the evaluation period:
Figure 1.20 – Selecting to use an evaluation version in the Windows Server 2022 installation

Figure 1.20 – Selecting to use an evaluation version in the Windows Server 2022 installation

  1. On the Select the operating system you want to install screen, change your selection to Windows Server 2022 Datacenter (Desktop Experience), and select Next to continue:
Figure 1.21 – Selecting to install the Windows Server 2022 Datacenter (Desktop Experience)

Figure 1.21 – Selecting to install the Windows Server 2022 Datacenter (Desktop Experience)

  1. On the Applicable notices and license terms page, select I accept… and then select Next to continue:
Figure 1.22 – Accepting the Microsoft Software license terms

Figure 1.22 – Accepting the Microsoft Software license terms

  1. On the Which type of installation do you want? page, select Custom: Install Microsoft Server Operating System only (advanced) as shown in the following screenshot:
Figure 1.23 – Selecting Custom: Install Microsoft Server Operating System only (advanced)

Figure 1.23 – Selecting Custom: Install Microsoft Server Operating System only (advanced)

  1. Select Next on the Where do you want to install the operating system? page:
Figure 1.24 – Installing the operating system on the available disk

Figure 1.24 – Installing the operating system on the available disk

  1. Monitor the Status page to confirm that the installation succeeds:
Figure 1.25 – Installing Microsoft Server Operating System

Figure 1.25 – Installing Microsoft Server Operating System

  1. After the virtual machine reboots a few times, you will return to the Customize settings screen and be prompted for an administrator passcode. We recommend you use 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.26 – Setting a new password for the administrator account

  1. When prompted to adjust the display configuration, choose an appropriate resolution for your virtual machine, and then select Connect, as shown in the following screenshot:
Figure 1.27 – Adjusting the display configuration of the virtual machine

Figure 1.27 – Adjusting the display configuration of the virtual machine

  1. Power down the virtual machine.
  2. Repeat the preceding steps for each of the four virtual machines within Hyper-V Manager to complete the lab setup.

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.