0% found this document useful (0 votes)
398 views

Lab Manual: Windows Server 2016 Hyper-V

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
398 views

Lab Manual: Windows Server 2016 Hyper-V

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 194

Windows Server 2016: Hyper-V Foundation Technologies

Lab Manual

Participant guide

© 2020 Microsoft Corporation. All rights reserved.

This training package content is proprietary and confidential, and is intended only for users described in the training materials. Some elements of this document
are subject to change. This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.

This content and information is provided to you under a Non-Disclosure Agreement and cannot be distributed. Copying or disclosing all or any portion of the
content and/or information included in this package is strictly prohibited. Complying with all applicable copyright laws is the responsibility of the user. Without
limiting the rights under copyright, no part of this document may be reproduced, stored in, or introduced into a retrieval system, or transmitted in any form or by
any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as
expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks,
copyrights, or other intellectual property.

The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious. No association
with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred.

The names of actual companies and products mentioned herein may be the trademarks of their respective owners.

Microsoft and the Microsoft products and services listed are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or
other countries.
Table of Contents
Module 2, Lab1: Hyper-V Introduction................................................................................................................... 6
Exercise 1. : Configure Enhanced Session mode on Management VM..........................................7
Task 1: Open Hyper-V Manager and check VM states.........................................................................7
Task 2: Start HVWS-Management................................................................................................................ 8
Task 3: Connect to HVWS-Management................................................................................................... 8
Task 4: Enable Enhanced Session mode........................................................................................................ 8
Task 5 Log on to HVWS-Management.......................................................................................................... 9
Exercise 2. : Explore Lab Configuration.................................................................................................... 11
Task 1: Start Windows Server 2012 R2 Core and experience first boot.......................................11
Task 2: Experience Windows Server 2016 Core and Windows Server Nano startup..............13
Task 3: Start other “CL” VMs with PowerShell....................................................................................... 14
Task 4: Explore HVWS-Cl1Node1 configuration................................................................................... 17
Task 5: Inspect HVWS-Cl1Node1 settings in Hyper-V console......................................................30
Task 6: Is your lab broken? Rebuild If needed...................................................................................... 32
Task 7: Enable performance monitoring for Module 7......................................................................33
Exercise 3. : Management best practices................................................................................................. 33
Task 1: Connect to Management VM....................................................................................................... 34
Task 2: Install Administration Tools........................................................................................................... 35
Exercise 4. : Server Management Basics................................................................................................... 38
Task 1: Add Managed Servers..................................................................................................................... 38
Task 2: Server Manager basics..................................................................................................................... 40
Module 3, Lab1: Create Failover Cluster using GUI tools.............................................................................. 42
Exercise 1. : Deploy required roles and features................................................................................... 43
Task 1: Install Required roles – Install Hyper-V..................................................................................... 43
Task 2: Install required features (Failover Clustering).........................................................................45
Task 3: Install roles on CL1W12Node2 with PowerShell....................................................................48
Task 4: Prepare the storage.......................................................................................................................... 50
Task 5: Create Failover Cluster..................................................................................................................... 55
Task 6: Explore the Cluster and configure Cluster Shared Volumes.............................................59
Task 7: Browse Cluster Shared volumes and rename CSV Mountpoints to match Volume
Name 62
Exercise 2. : Create Clustered VMs............................................................................................................. 64
Task 1: Create a VM using the GUI Wizard............................................................................................. 64
Task 2: Add Virtual Disk to the VM – Copy VHD.................................................................................. 69
Task 3: Add Virtual Disk to the VM – Configure VM to use VHD...................................................71
Task 4: Create VM using PowerShell......................................................................................................... 73
Module 3, Lab2: Upgrade Cluster1 to Windows Server 2016......................................................................75
Exercise 1. : Prepare new nodes to be ready to join a cluster.........................................................76
Task 1: Install required roles......................................................................................................................... 76
Task 2: Configure networking...................................................................................................................... 77
Exercise 2. : Roll the cluster upgrade........................................................................................................ 78
Task 1: Check Cluster version with PowerShell..................................................................................... 78
Task 2: Evict cluster node with Failover Cluster Manager and add the new one.....................79
Task 3: Check Cluster version with PowerShell..................................................................................... 87
Task 4: Evict old cluster node and add new one with PowerShell.................................................88
Task 5: Check cluster version and update............................................................................................... 89
Task 6: Check VM configuration version and update.........................................................................89
Task 7: Update VM version with PowerShell.......................................................................................... 94
Task 8: Configure VMs and shutdown old cluster nodes..................................................................94
Module 3, Lab3: Create Second Cluster with PowerShell.............................................................................. 96
Task 1: Deploy Cluster.................................................................................................................................... 97
Task 2: Explore your new 4 node cluster................................................................................................. 98
Module 3, Lab4: Mobility......................................................................................................................................... 100
Exercise 1. : Perform different migration types on Cluster1..........................................................101
Task 1: Perform live migration of MyVM1............................................................................................ 101
Task 2: Perform Storage live migration of MyVM1...........................................................................102
Task 3: Move machines there and back with PowerShell...............................................................105
Exercise 2. : Storage live migrate VMs to different cluster.............................................................106
Task 1: Configure Kerberos constrained delegation.........................................................................106
Task 2: Configure Kerberos authentication for live migration......................................................109
Task 3: Evacuate MyVM2 to another cluster....................................................................................... 113
Exercise 3. : Configure required settings and Live Migrate Storage using PowerShell.......120
Task 1: Configure Kerberos Constrained delegation........................................................................121
Task 2: Validate settings via the GUI...................................................................................................... 121
Task 3: Configure Live Migration Authentication..............................................................................122
Task 4: Validate settings with GUI........................................................................................................... 122
Task 5: Evacuate Cluster1 to Cluster2 with PowerShell...................................................................123
Task 6: Evacuate Cluster2 to Cluster1 with PowerShell...................................................................124
Module 4, Lab1: Networking.................................................................................................................................. 125
Exercise 1. : Configure Converged networking...................................................................................127
Task 1: Explore current configuration.................................................................................................... 127
Task 2: Create additional Virtual Network Adapters and configure them...............................130
Task 3: Explore networks in Failover Cluster Manager....................................................................133
Task 4: Configure Cluster Networks with PowerShell......................................................................136
Task 5: Connect all VMs to SETSwitch.................................................................................................... 137
Module 6, Lab1: Stretch Cluster and Storage Replica..................................................................................138
Exercise 1. : Install all prerequisites using PowerShell......................................................................140
Task 1: Install required roles, create virtual switch, Setup Cluster, configure witness.........140
Task 2: Configure Fault domains and format disks...........................................................................142
Task 3: Validate settings using Failover Cluster Manager..............................................................142
Task 4: Add cluster disk to Cluster Shared volumes and create VMs........................................144
Exercise 2. : Enable Synchronous Replication to second site........................................................147
Task 5: Enable replication of Cluster Shared Volume.......................................................................147
Task 6: Explore the replication feature................................................................................................... 151
Exercise 3. : Configure Replication Network........................................................................................ 155
Task 1: Inspect network current settings.............................................................................................. 155
Task 2: Rename Cluster Network for Replication............................................................................... 155
Task 3: Dedicate ReplicaNetwork to replication................................................................................. 156
Module 6, Lab2: Hyper-V Replica......................................................................................................................... 157
Exercise 1. : Configure HA roles for Hyper-V Replica.......................................................................158
Task 1: Configure Hyper-V Replica role on Stretch-Clus................................................................158
Task 2: Configure RB role on 2 other clusters with PowerShell....................................................160
Task 3: Enable Firewall rules for Hyper-V replica...............................................................................162
Task 4: Configure replica servers to use Kerberos for authentication and allow replication
from anywhere................................................................................................................................................... 162
Exercise 2. : Enable Hyper-V replica........................................................................................................ 163
Task 1: Enable Replication of MyReplicatedVM1............................................................................... 164
Task 2: Explore Replicated VM.................................................................................................................. 166
Task 3: Extend replication of MyReplicatedVM1................................................................................168
Module 7, Lab1: Performance logs...................................................................................................................... 170
Exercise 1. : Analyze performance logs.................................................................................................. 170
Task 1: Stop data collection....................................................................................................................... 170
Task 2: Open and analyze the blg file.................................................................................................... 170
Bonus, Lab1: Cluster Aware Updating (optional)............................................................................................ 171
Exercise 1. : Prestage AD Object for HA role....................................................................................... 173
Task 1: Create Computer object in AD and configure ACLs..........................................................173
Exercise 2. : Configure CAU role to enable self-updating...............................................................178
Task 1: Create HA CAU role........................................................................................................................ 178
Exercise 3. : Update Cluster1...................................................................................................................... 186
Task 1: Preview updates.............................................................................................................................. 186
Task 2: Apply updates.................................................................................................................................. 187
Bonus, Lab2: RDMA Networking (Optional)..................................................................................................... 189
Exercise 1. : Configure “iWARP” on Cluster2........................................................................................ 190
Task 1: Deploy networking with PowerShell........................................................................................ 190
Exercise 2. : Configure “RoCE” on Stretch-Clus................................................................................... 191
Task 1: Deploy networking with PowerShell........................................................................................ 191
Module 2, Lab1: Hyper-V
Introduction
Introduction
In this lab, you will explore what is in the lab and how we are simulating real hardware. You will
learn how to manage Windows Server effectively with remote tools.

Objectives
After completing this lab, you will be able to:

 Navigate in the Hyper-V Manager


 Enable enhanced session mode
 Install Hyper-V management tools
 Manage Server infrastructure with Server Management
 Compare Core Server and Nano Server

Estimated time to complete this lab


40 minutes

Lab Diagram

Hyper-V Virtual
External Switch/
Internet
Switch
ϭϬ͘ Ϭ͘ Ϭ͘ Ϭͬ Ϯϰ – Management Network

DC ϭϳ Ϯ͘ ϭϲ͘ ϭ͘ Ϭͬ Ϯϰ– ReplicaN et1


10.0.0.1
NAT
DC
DHCP CL1W12Node1,2 CL1Node1,2 CL2Node1..4 Site1Node1..2 Site2Node1..2
Management

͞SAN͟ ͞SAN͟
Shared VHDs Shared VHDs
Shared VHDs Shared VHDs 1× 200GB ͞Data͟ 1× 200GB ͞Data͟
1× 1GB Witness Disk 1× 1GB Witness Disk 1× 20GB ͞Log͟ 1× 20GB ͞Log͟
2× 8TB Capacity Disk 4× 8TB Capacity Disk

Scenario
The plain infrastructure was just set up. You need to start the Virtual Machines, configure Hyper-
V for easier management and install management tools to manage the infrastructure from a
single machine.
Exercise 1. :Configure Enhanced Session
mode on Management VM
Objectives
In this exercise, you will configure Enhanced Session mode on the Hyper-V Host. You will also
learn how Enhanced Session mode works on Management machine.

Lab Diagram

Hyper-V Virtual
External Switch/
Internet
Switch
ϭϬ͘ Ϭ͘ Ϭ͘ Ϭͬ Ϯϰ – Management Network

DC ϭϳ Ϯ͘ ϭϲ͘ ϭ͘ Ϭͬ Ϯϰ– ReplicaN et1


10.0.0.1
NAT
DC
DHCP CL1W12Node1,2 CL1Node1,2 CL2Node1..4 Site1Node1..2 Site2Node1..2
Management

͞SAN͟ ͞SAN͟
Shared VHDs Shared VHDs
Shared VHDs Shared VHDs 1× 200GB ͞Data͟ 1× 200GB ͞Data͟
1× 1GB Witness Disk 1× 1GB Witness Disk 1× 20GB ͞Log͟ 1× 20GB ͞Log͟
2× 8TB Capacity Disk 4× 8TB Capacity Disk

Task 1: Open Hyper-V Manager and check VM states


Step 1: On the Hyper-V host machine click on start and open Hyper-V Manager located in
Windows Administrative Tools.
Step 1: In the Hyper-V Console, notice that HVWS-DC is the only machine running.
Task 1: Start HVWS-Management
Step 1: Right-click on HVWS-Management and select Start

Task 2: Connect to HVWS-Management

Step 1: Right-Click on HVWS-Management and select Connect


Step 2: Wait for the machine to boot to login screen.

Task 4: Enable Enhanced Session mode


Step 1: In Hyper-V Manager right-click on the Hyper-V host and click on Hyper-V Settings.
Step 3: In the Hyper-V Settings menu click on Enhanced Session Mode Policy and tick the
checkbox

Step 4: Explore additional settings, Notice NUMA Spanning, Physical GPUs.


Step 5: Close the Hyper-V Settings menu by clicking on OK.

Task 5 Log on to HVWS-Management


Step 1: To login specify the username set in Labconfig during lab preparation (default is
LabAdmin).

Username: LabAdmin
Password: LS1setup!
Step 6: After successful logon, logoff, and logon again. This step is necessary as we need
Enhanced Session mode to kick in.
Step 7: You should see following prompt

Step 8: After clicking Connect, enhanced session mode is active.


Exercise 1. :Explore Lab Configuration
Objectives
In this exercise, you will explore Windows Server Core and Windows Server Nano boot times.
You will also explore CL1W12, CL1 and Cl2 servers configuration.

Lab Diagram

Hyper-V Virtual
External Switch/
Internet
Switch
ϭϬ͘ Ϭ͘ Ϭ͘ Ϭͬ Ϯϰ – Management Network

DC ϭϳ Ϯ͘ ϭϲ͘ ϭ͘ Ϭͬ Ϯϰ– ReplicaN et1


10.0.0.1
NAT
DC
DHCP CL1W12Node1,2 CL1Node1,2 CL2Node1..4 Site1Node1..2 Site2Node1..2

Management

͞SAN͟ ͞SAN͟
Shared VHDs Shared VHDs
Shared VHDs Shared VHDs 1× 200GB ͞Data͟ 1× 200GB ͞Data͟
1× 1GB Witness Disk 1× 1GB Witness Disk 1× 20GB ͞Log͟ 1× 20GB ͞Log͟
2× 8TB Capacity Disk 4× 8TB Capacity Disk

Task 1: Start Windows Server 2012 R2 Core and experience


first boot.
Step 1: On the Hyper-V host machine click on start and open Hyper-V Manager located in
Windows Administrative Tools.
Step 9: In Hyper-V manager right-click on HVWS-Cl1W12Node1 and select Connect
Step 10: In the new window click the power button to turn this VM On.

Step 11: Wait for machine to boot and notice that it restarted once and how long it took.
Expected result:
Task 3: Experience Windows Server 2016 Core and Windows
Server Nano startup
Step 1: Repeat the steps from Task1 for Nano Server HVWS-CL1Node1 and HVWS-
Cl2Node1

Note: Expected result:


You should experience HVWS-CL1Node1
dramatically lower startup
times for HVWS-
CL2Node1 as it is running
NanoServer.

HVWS-CL2Node1
Task 4: Start other “CL” VMs with PowerShell
Step 1: On the Hyper-V host, open PowerShell from the start menu as Administrator

Step 12: Notice, that elevated PowerShell window contains Administrator: Windows
PowerShell

Step 13: Type the following command to list available VMs

Step 1: Get-VM
Expected result:

Step 14: Run the following command in PowerShell to start VM HVWS-Cl1W12Node2

Step 3: start-vm HVWS-CL1W12Node2

Step 15: Run the following command to validate that both CL1W12 nodes are running
Step 5: get-vm *W12*

Expected result:

Step 16: Run the following command to start all other VMs, where name includes “CL”

Step 7: start-vm *cl*

Expected result:
Step 17: Run the following command to validate that all “CL” VMs are running

Step 9: get-vm *cl*

Expected result:

Step 18: Close PowerShell window.

Task 5: Explore HVWS-Cl1Node1 configuration


Step 1: From Hyper-V manager select HVWS-Cl1Node1 and right-click.
Step 19: From the drop-down menu select Settings
Step 20: In Settings navigate to Add Hardware and notice, that one Item is not greyed out

Step 13: PowerShell examples:

Step 14: To add hardware you can use commands in PowerShell starting Add-VM* (you
can list them with Get-command Add-VM*
Step 15:

Step 11: Note:

Step 12: In Windows Server 2016 we allow adding additional Network Adapters, while
the Virtual Machine is running.
Step 21: In Settings navigate to Firmware and notice the boot order and bootmgfw.efi
details

Note:

This VM is generation 2, therefore it uses UEFI instead of BIOS.


Step 16: PowerShell examples

Step 17: To display boot settings, you can use following command
Step 18: (Get-VMFirmware -VMName *CL1Node1).BootOrder
Step 19:

Step 20:
Step 21: Example to set network adapter with Name Management1 to be first boot
device

Step 22: In Settings, Navigate to Security and notice that TPM is not enabled and all
settings are greyed out.
Note:

Security settings cannot be changed while a Virtual Machine is running

PowerShell examples:

Display Secure Boot settings:


Get-VMFirmware -VMName *CL1Node1 | Format-List sec*

Example to enable Secure Boot


Set-VMFirmware -VMName *Cl1Node1 -EnableSecureBoot On

Get-VMSecurity -VMName *Cl1Node1

Example to enable vTPM*


Step 23: Navigate to Memory and review the dynamic memory settings

Note:

Virtual Machine has Network Virtualization Extensions exposed (Nested Virtualization is on),
therefore Dynamic Memory settings are not effective on VMs, where Hyper-V is enabled (Nano
Servers, later in the lab also Core Servers)
Step 29: PowerShell examples:

Step 30: Example to display all memory parameters


Step 31: Get-VMMemory -VMName *CL1Node1 | fl *
Step 32:

Step 33: To modify startup memory you can use following command
Step 34: Set-VMMemory -VMName *cl1Node1 -StartupBytes 2GB
Step 35:
Step 36: You can do this operation (also applies to other commands) against multiple
machines like on all machines with name containing “cl1”
Step 24: Navigate to Processor and review the settings
Note:

Notice also Compatibility settings and NUMA node settings.

PowerShell:

To view processor settings, you can use following command


Step 25: Explore Virtual Hard Drive Settings by navigating through the SCSI Controller

Step 50: Note:

Step 51: Notice that QoS settings are only available on traditional Hard Drive.

Step 52: Notice that QoS now contains Policy ID.

Step 53:

Step 54: Notice that There are 3 Shared Drives (1 for witness disk, 2 for Capacity devices
representing LUNs from “SAN”)

Step 55:
Step 41: PowerShell examples:

Step 42: Example to display all parameters.


section

Step 26: Click on first Shared Drive and click on Inspect button

Step 27: Notice the new window with Additional drive information appeared

Step 28: The same way Inspect the first Hard Drive
Expected result:
Note:

The OS drive is a differencing virtual disk. It is very handy for labs. However, it is not
recommended for production workload (Except VDI)

Step 29: Click on Inspect Parent…

Note:

All OS disks are differencing to drives located in a folder called ParentDisks


Step 30: Close all virtual Hard Disk Properties windows to return to VM settings page.
Step 31: Open Adapter Settings by clicking on Management1

Note:

Notice that you can enable VLAN settings. You can also Remove adapter if needed.

PowerShell Examples:

To display all Network settings you can use the following command
Get-VMNetworkAdapter -VMName *CL1Node1 | fl *
Step 32: Explore Hardware Acceleration settings and Advanced Features settings.

Note:

Notice that VMQ is by default enabled in Hardware acceleration settings.

Notice that MAC spoofing and NIC teaming is enabled. Both are used, because later in LAB we
will configure SET Switch and these 2 settings are needed for SET Switch simulation to run
properly.

Step 33: Navigate to Integration Services and notice, that all services except Guest services
are enabled.
Step 34: Navigate to Checkpoints and notice, that Production checkpoints are available.

Step 35: Notice that Automatic Start Action is restart if previously running and Automataic
Stop Action is Save.
Step 36: Click on small green arrow and notice, that you can switch this way to different
node.
Step 37: Click on the grey arrow to expand the list of virtual machines you can switch to.

Step 38: Close the window by clicking on Cancel.

Task 6: Inspect HVWS-Cl1Node1 settings in Hyper-V console


Step 1: On the Hyper-V Host, open Hyper-V manager
Step 2: In Hyper-V manager click on HVWS-CL1Node1 and notice that in the bottom there is
additional information displayed.
Step 39: Notice, that Configuration Version and Generation are displayed

Step 40: Click on the Memory tab and notice that Dynamic Memory is Enabled, Assigned
memory is 512MB and memory demand is 409 MB (the exact numbers can vary)

Step 41: Click on Networking tab and notice that Trunk mode is enabled, and IP
addresses are assigned in the VM.

Note:

The Hydration script configured native VLAN 0 and available VLANs 1-10, so later in the lab
we will be able to simulate Virtual NICs with VLANs assigned. DHCP is enabled on DC,
therefore all VMs received an IP address. Also 2 NICs are present, to simulate multi-NIC
environments (in real world scenario you will have 2 NICs or 1NIC with 2 ports for redundancy.
Task 1: PowerShell commands:

Task 2: To get basic information about VM


Task 3: Get-VM -VMName *CL1Node1 | fl *
Task 4:

Task 5: To display VLANs:


Task 6: Get-VMNetworkAdapterVlan -VMName *CL1Node1 | fl *

Task 7: Is your lab broken? Rebuild If needed.


If your lab is broken by running various PowerShell commands to test things, e.g. if you tried
Task 7:
setting VLANs, Network Adapters, CPU, you can rebuild it in a few minutes.

Step 1: Navigate to the lab folder (you can find it if you run Get-VMHardDiskDrive like on the
example below, in this case E:\ws2016lab\)

Step 42: Right-Click Cleanup.ps1 and select Run with PowerShell. Allow command to
elevate.

Step 43: After script finishes, right-click Deploy.ps1 and select Run with PowerShell. Allow
command to elevate and wait until it finishes (approx 10 minutes).
Step 44: Start all VMs except VMs containing *Site* in its name.
Task 8: Enable performance monitoring for Module 7

This task will create a perfmon collection on the physical Hyper-V host (or remote lab).

Step 1: On the Hyper-V host machine start an elevated command prompt and type the
following commands:

Step 56: Note:

Step 57: path to XML might be different – depending on where is your lab located.

Command:
logman import -xml "E:\Hyper-V_Workshop\Tools\ws_perf.xml" -name "Hyper-V Workshop"
logman start "Hyper-V Workshop"

Step 45: In the same command prompt, type perfmon, press enter and make sure the
data collector is imported and running:

Exercise 2. :Management best practices


Objectives
In this Exercise, you will learn how to manage Windows Server Core and Nano from
Management machine.

Lab Diagram
Hyper-V Virtual
External Switch/
Internet
Switch
ϭϬ͘ Ϭ͘ Ϭ͘ Ϭͬ Ϯϰ – Management Network

DC ϭϳ Ϯ͘ ϭϲ͘ ϭ͘ Ϭͬ Ϯϰ– ReplicaN et1


10.0.0.1
NAT
DC
DHCP CL1W12Node1,2 CL1Node1,2 CL2Node1..4 Site1Node1..2 Site2Node1..2
Management

͞SAN͟ ͞SAN͟
Shared VHDs Shared VHDs
Shared VHDs Shared VHDs 1× 200GB ͞Data͟ 1× 200GB ͞Data͟
1× 1GB Witness Disk 1× 1GB Witness Disk 1× 20GB ͞Log͟ 1× 20GB ͞Log͟
2× 8TB Capacity Disk 4× 8TB Capacity Disk

Task 1: Connect to Management VM


Step 1: From Hyper-V Host machine open Hyper-V Manager.
Step 46: In Hyper-V Manager right-click Management VM and select Connect in drop-
down menu.
Step 47: Choose your preferred resolution and click connect.

Step 48: Login with following credentials (the same as in Exercise 1):
Username: LabAdmin
Password: LS1setup!
Task 9: Install Administration Tools
Step 1: On the Management machine, notice that Server Manager automatically started.
Step 49: Click on Tools in top right corner and review available Tools

Step 50: As we need to manage Active Directory, DNS, Hyper-V, we need to have the
tools installed. Click on Manage and select Add Roles and Features. The wizard will start
Step 51: On Before you begin page click Next.
Step 52: On Installation type page click Next.
Step 53: On Server Selection click Next.
Step 54: On Server Roles page click Next.
Step 55: On Features page scroll down to Remote Server Administration Tools and notice,
that all tools are unchecked.

Step 56: Check checkbox next to Remote Server Administration Tools as we want to
install all. Notice WebServer management feature install prompt will pop up. Confirm it by
clicking “Add Features”.
Step 57: Expand Role Administration Tools and notice, that not all tools were selected.
Step 58: Either click on every setting and finish install, or close wizard and use following
PowerShell command in elevated PowerShell inside Management machine to install all RSAT
tools.
Step 58: Install-WindowsFeature -Name RSAT -IncludeAllSubFeature
Step 59:
Expected result:

Step 59: Restart Management machine and login again.


Step 60: In Server Manager notice, that all tools are now available.
Exercise 3. :Server Management Basics
Objectives
In this Exercise, you will learn how to use Management VM to be the only management point. In
this lab we will use this machine only to run all tasks.

Task 1: Add Managed Servers


Step 1: On Management VM Server Manager should be automatically started
Step 61: In Server Manager right-click on All Servers and select Add Servers

Step 62: In the Add servers menu click on Find Now to discover all machines in domain
corp.contoso.com
Step 63: Click on Operation System tab to sort the names. This will quickly identify
machines that are running and its Operating System.
Step 64: Select all nodes except the ones with *Site* in its name and click on small arrow
in the middle of window to add it to the list of selected servers.
Result:
Step 65: Click on OK to confirm the selection
Step 66: Notice that you can see now that Hyper-V is installed on some servers, as it was
added to the list (Hyper-V is installed on Nano servers as Hyper-V package was injected
during the build process)

Step 67: Leave Server Manager open for next task


Task 10: Server Manager basics
In this task, you will learn Server Manager basics such as displaying OS version, IP addresses and
installed hard drives.

Step 1: In Server Manager click on All Servers


Expected result:

Step 68: Notice that all servers have 2 IP addresses as they have 2 network cards as we
confirmed in previous exercises.
Step 69: In the Server Manager Right-Click on any tab and select Operating System
Version
Step 70: You should see OS version in the table

Step 71: In Server Manager click on File and Storage Services


Step 72: From the expanded list select Disks and notice that you can see the same
number of disks as we saw in Hyper-V manager

Step 73: Click into Filter window and type CL1 to filter to “Cluster1” machines

Step 74: Notice that list was filtered and you can see only CL1 Machines.
Module 3, Lab1: Create Failover
Cluster using GUI tools
Introduction
In this lab, you will learn how to deploy simple Failover Cluster with both Server Manager tools
and PowerShell

Objectives
After completing this lab, you will be able to:

 Understand the workflow to create Failover Clusters


 Understand the steps in GUI tools and PowerShell
 Work with Server Manager to prepare storage (initialize and format disks).

Estimated time to complete this lab


45 minutes

Lab Diagram

Hyper-V Virtual
External Switch/
Internet
Switch
ϭϬ͘ Ϭ͘ Ϭ͘ Ϭͬ Ϯϰ – Management Network

DC ϭϳ Ϯ͘ ϭϲ͘ ϭ͘ Ϭͬ Ϯϰ– ReplicaN et1


10.0.0.1
NAT
DC
DHCP CL1W12Node1,2 CL1Node1,2 CL2Node1..4 Site1Node1..2 Site2Node1..2
Management

͞SAN͟ ͞SAN͟
Shared VHDs Shared VHDs
Shared VHDs Shared VHDs 1× 200GB ͞Data͟ 1× 200GB ͞Data͟
1× 1GB Witness Disk 1× 1GB Witness Disk 1× 20GB ͞Log͟ 1× 20GB ͞Log͟
2× 8TB Capacity Disk 4× 8TB Capacity Disk

Scenario
The servers just started and you will configure them with both Server Manager and PowerShell
to become Failover Cluster simulating traditional, shared storage that can be in the real-world
iSCSI, FCoE, or Fibre Channel storage.
Exercise 1. :Deploy required roles and
features
Objectives
In this exercise, you will learn how to deploy Shared Storage Spaces end to end using Graphical
tools (mostly). You will also learn how to create virtual disks and volumes on Shared Storage
Spaces. All steps will be executed from the Management VM and we will configure machines
CL1W12Node1 and CL1W12Node2.

Lab Diagram

Hyper-V Virtual
External Switch/
Internet
Switch
ϭϬ͘ Ϭ͘ Ϭ͘ Ϭͬ Ϯϰ – Management Network

DC ϭϳ Ϯ͘ ϭϲ͘ ϭ͘ Ϭͬ Ϯϰ– ReplicaN et1


10.0.0.1
NAT
DC
DHCP CL1W12Node1,2 CL1Node1,2 CL2Node1..4 Site1Node1..2 Site2Node1..2
Management

͞SAN͟ ͞SAN͟
Shared VHDs Shared VHDs
Shared VHDs Shared VHDs 1× 200GB ͞Data͟ 1× 200GB ͞Data͟
1× 1GB Witness Disk 1× 1GB Witness Disk 1× 20GB ͞Log͟ 1× 20GB ͞Log͟
2× 8TB Capacity Disk 4× 8TB Capacity Disk

Task 1: Install Required roles – Install Hyper-V


In this task, you will install the Hyper-V role to servers CL1W12Node1 and CL1W12Node2. As it
is not possible to use Server Manager (because we are running these servers in Hyper-V already)
we will use PowerShell.
Step 1: From Start Menu run PowerShell as Administrator

Note:

Invoke-Command can push


commands to remote
servers. In this case
CL1W12Node1 and
CL1W12Node2. As you
can see from script above,
we are pushing command
Enable-
WindowsOptionalFeature
-FeatureName Microsoft-
Hyper-V -Online
-NoRestart This
command enables Hyper-
V using DISM. This is a
known workaround to
enable Hyper-V inside
Hyper-V if nested
virtualization is not
Step 75: Paste the following script into
enabled or if the
you PowerShell
are and hit enter
PowerShell Script: running Windows Server
Invoke-Command 2012 R2 as guest OS. It
-ComputerName will also skip restart.
CL1W12Node1,CL1W12Node2
-ScriptBlock ` Unfortunately, this is not Expected result:
{Enable-
WindowsOptionalFeature
possible with a GUI.
-FeatureName Microsoft- Backtick sign ` will let
Hyper-V -Online
-NoRestart} PowerShell know that code
continues at another line.
This way you can split
code to multiple lines.
Task 11: Install required features (Failover Clustering)
Step 1: Open Server Manager

Step 76: In Server Manager navigate to All Servers


Step 77: In All Servers window, right-click on CL1W12Node1 and select Add Roles and
Features

Step 78: Click Next three times.


Step 79: Notice that Hyper-V was installed and click Next
Step 80: From the Features select Failover Clustering (add all features when prompted)
and Hyper-V management tools

Step 81: Click Next


Step 82: On the confirmation window, tick “Restart the destination server automatically if
required and click Install to finish installation.

Expected result:
Step 83: Click close to close the wizard.
Task 12: Install roles on CL1W12Node2 with PowerShell
Step 1: In the Management machine, click Start and open elevated PowerShell as on following
screenshot

Step 84: Paste the following command in elevated PowerShell to install roles and
features with PowerShell. To paste the command, just right-click into the PowerShell window
when code is in the clipboard.
Step 85: Paste the following command to restart
Step 60: Install-
WindowsFeature -Name cl1w12node2. Script will use PowerShell remoting and will
"Failover-
Clustering","Hyper-
wait for server to come online.
V-PowerShell"
-ComputerName
cl1W12node2
Step 61: Restart-
Computer cl1W12node2
Expected result: WSMan
-Protocol
-Wait -For
PowerShell
Task 13: Prepare the storage
Step 1: In Server Manager, navigate to File and Storage Services
Step 86: In File and Storage Services navigate to disks.
Step 87: Filter the servers to only Windows Server 2012 R2 by typing w12 into the filter (it
is filtering by name, not by OS. Servers with Server 2012 R2 OS contains w12 in the name).

Step 88: To initialize first disk, right-click on disk number 1 in node1 and select Bring
Online

Notice the warning


Note:
The disk is by default offline as set in SAN Policy. In Windows Server SKU are all drives by
default offline to avoid issue described in warning above.
SAN Policy:
https://technet.microsoft.com/en-us/library/cc749466(v=ws.10).aspx

PowerShell alternative:
#first select disk from remote computer and store it in variable
$disk=get-disk -CimSession Cl1W12Node1 -Number 1
#then make it read/write
$disk | Set-Disk -IsReadOnly $false
#and make disk Online
$disk | Set-Disk -IsOffline $false

Step 89: Initialize disk with right-click and selecting Initialize. Confirm the prompt.

Notice that disk will be automatically initialized as GPT


PowerShell alternative:
#you should have $disk variable already present if you did not close the PowerShell
from previous task
$disk=get-disk -CimSession Cl1W12Node1 -Number 1
#then initialize
$disk | Initialize-Disk

Step 90: To create volume, right click the same disk and select New Volume…
Step 91: The wizard will pop up. Click Next on Before you begin page.
Step 92: Click Next on the Server and Disk page
Step 93: Click Next on the Size
Step 94: On Drive Letter or Folder page select “Don’t assign to a drive letter or folder” and
click Next

Step 95: In the Allocation Unit Size select 8192 and in Volume Label type “Witness”. Click
Next
Step 96: Click Create to create the Volume.
Step 97: The formatting will finish. Click close to close the wizard.
Step 98: Refresh the Disk information with refresh button (arrows in the circle) and notice
its online and volume is present.

Step 99: Make the disk offline again by right-click and selecting Take Offline

Step 100: To format 2 other disks, run you can either repeat steps above, or Run the
following PowerShell command. Volume Names will be MyCSV_1 and MyCSV_2 with
allocation unit size 8kb.

#variable with remote server name


$ServerName="CL1W12Node1"
#select disks that are not initialized and size is greater than 10GB (for exammple
to exclude witness disks).
#the command will also sort it by number
$Disks=Get-Disk -CimSession $ServerName | where {$_.PartitionStyle -eq 'RAW' -and
$_.Size -gt 10GB} | sort number
Expected result:

Task 14: Create Failover Cluster


Step 1: Open Server Manager and click on Tools in top-right corner
Step 101: In Failover Cluster Manager window, right-click on Failover Cluster Manager and
select Create Cluster

Step 102: On Before you begin page click Next


Step 103: In the Enter server name box type CL1W12Node1 and click add
Step 104: Repeat for Server CL1W12Node2
Expected result:
Step 105: Click Next. On the Validation Warning page notice that if you would click No,
you would not receive support from Microsoft.
Step 106: Leave Yes selected and Click Next. Validation Wizard window will appear.
Step 107: In Validation Wizard window click Next three times to start Failover Cluster
validation.
Expected result:

Step 108: Click on View Report… button to view validation report.


Expected result:
Step 109: Explore Failover Cluster Validation Report and close Internet Explorer.
Step 110: In Validate a configuration wizard click Finish.
Step 111: In create cluster wizard type Cluster1 into Cluster name box and click next.
Step 112: In Confirmation page keep Add all eligible storage to the cluster selected and
click next

Step 113: In Summary page click Finish to close Create Cluster Wizard.
Step 114: Failover Cluster Manager with Shared-Cluster will appear.
Expected result:
Task 15: Explore the Cluster and configure Cluster Shared
Volumes
Step 1: Notice, that witness was automatically configured

Step 2: Expand Cluster1.corp.contoso.com and navigate to the Disks under Storage


Step 115: Notice, that Cluster Disk 2 was automatically added as Witness and other disks
were added as Available Storage.
Step 116: Click on Cluster Disk 3, and notice, that it is disks with Volume Name MyCSV_1
(can be different, as its random)

Step 117: Add disk with VolumeName MyCSV_1 to ClusterSharedVolume using right-click
and selecting “Add to Cluster Shared Volumes”

Expected result:
Step 118: Add second disk with following PowerShell command
Step 62: #Fill variable with Cluster Name
Step 63: $ClusterName="Cluster1"
Step 64: #Show all cluster resources, to show available storage
Step 65: Get-ClusterResource -Cluster $ClusterName
Step 66: #select only available storage and add it to variable
Step 67: $ClusterDisk=Get-ClusterResource -Cluster $ClusterName | where
OwnerGroup -eq "Available Storage"
Step 68: #add disk to Cluster Shared Volumes

Expected result:
Task 16: Browse Cluster Shared volumes and rename CSV
Mountpoints to match Volume Name
Step 1: To access Cluster Shared Volume remotely, navigate to \\Cluster1\ClusterStorage$\
Step 119: As you can see, CSVs are automatically named Volume1 and Volume2. In some
cases it may make a sense to rename it. Let’s rename Volume1 to MyCSV_1 and Volume2 to
MyCSV_2 Right-Click Volume and select Rename to rename volumes.

Expected result:
Exercise 4. :Create Clustered VMs
Objectives
In this exercise, you will learn how to create clustered VM using both wizard and PowerShell

Lab Diagram

Hyper-V Virtual
External Switch/
Internet
Switch
ϭϬ͘ Ϭ͘ Ϭ͘ Ϭͬ Ϯϰ – Management Network

DC ϭϳ Ϯ͘ ϭϲ͘ ϭ͘ Ϭͬ Ϯϰ– ReplicaN et1


10.0.0.1
NAT
DC
DHCP CL1W12Node1,2 CL1Node1,2 CL2Node1..4 Site1Node1..2 Site2Node1..2
Management

͞SAN͟ ͞SAN͟
Shared VHDs Shared VHDs
Shared VHDs Shared VHDs 1× 200GB ͞Data͟ 1× 200GB ͞Data͟
1× 1GB Witness Disk 1× 1GB Witness Disk 1× 20GB ͞Log͟ 1× 20GB ͞Log͟
2× 8TB Capacity Disk 4× 8TB Capacity Disk

Task 1: Create a VM using the GUI Wizard


Step 1: Open Failover Cluster Manager and click on Roles
Step 120: In Action Panel expand Virtual Machines and select New Virtual Machine…

Step 121: Select one Node1 and click OK


Step 122: On Before you begin page click Next
Step 123: In Specify Name page type MyVM1 and tick “Store the virtual machine in a
different location.
Step 124: Click Browse, to specify location for VM and navigate to
C:\ClusterStorage\MyCSV_1 on remote node. Click On Select Folder to continue

Expected result:
Step 125: On Specify Name and Location page, click Next
Step 126: On Specify Generation page, select Generation 2 and click Next
Step 127: In Specify memory, type 32 (as it is VM, and in Server 2012R2 we do not allow
Nested Virtualization). Click Next.

Step 128: In configure networking keep Not Connected as we will configure networking in
different Module.

Step 129: In Connect Virtual Hard Disk, select attach a virtual hard disk later, as we will copy
virtual disk with OS, later in the next task.

Step 130: Click Finish to create VM.


Expected result:
Task 17: Add Virtual Disk to the VM – Copy VHD
Step 1: Navigate to \\Cluster1\ClusterStorage$\MyCSV_1\MyVM1\ using file explorer
Step 2: Create Folder called “Virtual Hard Disks”
Expected result:
Step 131: Open elevated PowerShell and make tools disk online with following command
set-disk -Number 1 -IsReadOnly $false
set-disk -Number 1 -IsOffline $false

Note:
As described in previous exercise, default SAN policy for disks in servers is to not automatically
make online. Therefore, it is required to bring the tools disk online.

Step 132: Open another file explorer, and navigate to D:\ParentDisks

Note:
If this folder and VHD does not exist in the Management machine, navigate to lab root folder
on Hyper-V host and copy the VHD from there. Make sure it’s located at
D:\ParentDisks\Win2016NanoHV_G2.vhdx

Step 133: Copy Win2016NanoHV_G2.vhdx into Virtual Hard Disks folder you created in
Step2.
Step 134: Rename VHD to MyVM1_Disk1.vhdx
Expected result:
Task 18: Add Virtual Disk to the VM – Configure VM to
use VHD
Step 1: In Failover Cluster Manager, right-click MyVM1 and select Settings…

Step 135: In Settings click on SCSI Controller, Select HardDrive and click Add

Step 136: Click Browse, to browse for VHD you copied in previous task
Step 137: Navigate to disk an click Open

Step 138: Verify settings and click Apply.

Step 139: Navigate to Firmware and move Virtual Hard disk up.
Expected result:
Step 140: Click OK to close Virtual Machine settings.

Task 19: Create VM using PowerShell


Step 1: Paste the following code to create additional VM.

#Define VM name
$VMName="MyVM2"
#define VHD path
$vhdpath="D:\ParentDisks\Win2016NanoHV_G2.vhdx"
#define CSV Name
$CSVName="MyCSV_1"
#cluster name
$clusterName="Cluster1"

#select first node in cluster


$firstnode=(Get-ClusterNode -Cluster $clusterName).Name | select -First 1

#create folder for virtual hard disks


New-Item -Path "\\$clusterName\ClusterStorage$\$CSVName\$VMName\Virtual Hard Disks"
-ItemType Directory

#copy VHD to virtual hard disk folder


Copy-Item -Path $VHDPath -Destination "\\$clusterName\ClusterStorage$\$CSVName\
$VMName\Virtual Hard Disks\$($VMName)_Disk1.vhdx"

#Create VM. Invoke is needed as New-VM from 2016 is incompatible with 2012R2
Invoke-Command -ComputerName $firstnode -ArgumentList ($VMName,$CSVName)
-ScriptBlock {
param($VMName,$CSVName);
New-VM -Name $VMName -Generation 2 -Path "c:\ClusterStorage\$CSVName" -VHDPath
"c:\ClusterStorage\$CSVName\$VMName\Virtual Hard Disks\$($VMName)_Disk1.vhdx"
}
#Add VM as Highly Available on the cluster
Add-ClusterVirtualMachineRole -VMName $VMName -Cluster $ClusterName

Expected result:
Module 3, Lab2: Upgrade Cluster1 to
Windows Server 2016
Introduction
In this lab, you will learn how to upgrade clusters to Windows Server 2016 using rolling cluster
upgrades.

Objectives
After completing this lab, you will be able to:

 Understand the workflow to upgrade the cluster


 Understand Cluster versions
 Understand VM versions
 Understand the steps in GUI tools and PowerShell

Estimated time to complete this lab


45 minutes

Lab Diagram

Hyper-V Virtual
External Switch/
Internet
Switch
ϭϬ͘ Ϭ͘ Ϭ͘ Ϭͬ Ϯϰ – Management Network

DC ϭϳ Ϯ͘ ϭϲ͘ ϭ͘ Ϭͬ Ϯϰ– ReplicaN et1


10.0.0.1
NAT
DC
DHCP CL1W12Node1,2 CL1Node1,2 CL2Node1..4 Site1Node1..2 Site2Node1..2
Management

͞SAN͟ ͞SAN͟
Shared VHDs Shared VHDs
Shared VHDs Shared VHDs 1× 200GB ͞Data͟ 1× 200GB ͞Data͟
1× 1GB Witness Disk 1× 1GB Witness Disk 1× 20GB ͞Log͟ 1× 20GB ͞Log͟
2× 8TB Capacity Disk 4× 8TB Capacity Disk

Scenario
You will simulate the upgrade process. In the real-world scenario, you would remove node from
cluster, reinstall and add back to cluster. In our case, we will remove node, and introduce a
different one as rebuilding the OS would be time consuming and it’s not a topic for this
workshop.
Exercise 1. :Prepare new nodes to be
ready to join a cluster
Objectives
In this exercise, you will configure necessary settings before you introduce a node into the
cluster.

You will install required features. As you already learned how to do this using GUI tools, to save
time, you will use PowerShell

You will create a SET (Switch Embedded Team) Switch which is preferred over LBFO Teaming.
SET Switches can be created only from PowerShell, or via SCVMM.

Lab Diagram

CL1W12Node1,2 CL1Node1,2

͞SAN͟
Shared VHDs
1× 1GB Witness Disk
2× 8TB Capacity Disk

Task 1: Install required roles


Step 1: Run the following command to install Hyper-V and Failover clustering roles and restart
servers.
Step 71: #define Server Names
Step 72: $servers="cl1node1","cl1node2"
Step 73:
Step 74: #install Hyper-V and Failover Clustering.
Step 75: foreach ($server in $servers) {Install-WindowsFeature -Name "Failover-
Clustering","Hyper-V","Hyper-V-PowerShell" -ComputerName $server}
Step 76: #restart and wait for computers
Step 77: Restart-Computer $servers -Protocol WSMan -Wait -For PowerShell

Expected result:
Task 2: Configure networking
Step 1: Run the following PowerShell script to create virtual switch with name SETSwitch
connected to 2 adapters.
Step 81: #define Server Names
Step 82: $servers="cl1node1","cl1node2"
Step 83:
Step 84: #Create vSwitch on new servers from adapters that have IP address
starting 10.
Step 85: foreach ($server in $servers){
Step 86: Invoke-Command -ComputerName $server -ScriptBlock {New-VMSwitch
-Name SETSwitch -EnableEmbeddedTeaming $TRUE -MinimumBandwidthMode Weight
-NetAdapterName (Get-NetIPAddress -IPAddress 10.* ).InterfaceAlias}
Step 87: }
Step 88:
Step 89: #Clear DNS cache as you might use wrong adapter to connect (originally
server had 2NICs)
Step 141: Validate with following command, that SET Switches were created

Get-VMSwitch -CimSession $servers

Expected result
Exercise 5. :Roll the cluster upgrade
Objectives
In this exercise, you will replace nodes with Windows Server 2016. You will do the first node via
the GUI and the second with PowerShell. You will also learn about cluster functional level and
virtual machine versions.

Lab Diagram

CL1W12Node1,2 CL1Node1,2

͞SAN͟
Shared VHDs
1× 1GB Witness Disk
2× 8TB Capacity Disk

Task 1: Check Cluster version with PowerShell


Step 1: Run the following command to check Cluster version with PowerShell
Step 94: Get-Cluster -Name Cluster1 | fl *
Step 95:
Expected result:

Step 142: Notice, that ClusterFunctionalLevel and ClusterUpgradeVersion is empty.


Task 2: Evict cluster node with Failover Cluster Manager and
add the new one
Step 1: Open Failover Cluster Manager from Tools menu in Server Manager
Step 143: In Failover Cluster Manger, Cluster1 should be already there.
Step 144: If Cluster1 is not present, Right-Click Failover Cluster Manager and Select
Connect to Cluster… In Cluster Name type Cluster1 and click Connect.

Step 145: Expand Cluster1.Corp.contoso.com and click on Nodes


Expected result:
Step 146: Click on CL1W12Node1 and notice Operating system version in the bottom of
the Window.

Step 147: Right-Click CL1W12Node1, click Pause and Drain Roles. You might need to
refresh in action menu to get correct status.

Expected result:
Step 148: Right-Click CL1W12Node1 and select Evict in More Actions menu. Confirm the
prompt.

Expected result:
Step 149: Right-Click Cluster1.corp.contoso.com and select Add Node… The wizard will
pop up.

Step 150: On Before you begin page click next


Step 151: On select servers type CL1Node1 and click Add. Click Next.
Expected result:
Step 152: On Validation Warning page click Next. Validation Wizard will appear.
Step 153: On before you begin page click Next.
Step 154: On Testing Options page click Next.
Step 155: On Confirmation page click Next.
Expected result:
Step 156: Click View Report… to open report in Internet Explorer.
Step 157: In the report click on failed test “Hyper-V Configuration” and then on “Validate
Hyper-V Network Resource Pool And Virtual Switch Compatibility”

Step 158: Notice, that the SET Switch is present only on the new cluster. This is intentional
to demo failure in Failover cluster manager.
Step 159: Close Internet Explorer and click Finish in Validation Wizard.
Step 160: In Add Node Wizard click on Next
Step 161: Click Finish to close Add Node Wizard.
Step 162: Notice, that Failover Cluster is now running with 2 Different OS versions.
Task 3: Check Cluster version with PowerShell
Step 1: Run the following command to check Cluster version with PowerShell
Step 96: Get-Cluster -Name Cluster1 | fl *
Step 97:
Expected result:

Step 163: Notice that the ClusterFunctionalLevel is now 8 and ClusterUpgradeVersion is 3.


Task 20: Evict old cluster node and add new one with
PowerShell
Step 1: Open Failover Cluster Managr to observe what will PowerShell script do.
Step 164: Open Elevated PowerShell and Paste the following script.

Step 98: #Suspend Node and drain roles


Step 99: Suspend-ClusterNode -Cluster "Cluster1" -Drain -Name "cl1W12node2"
-Wait
Step 100: #Remove node without asking
Step 101: Remove-ClusterNode -Cluster "Cluster1" -Name "cl1W12node2" -Force
Step 102: #add new node

Step 165: Open Failover Cluster and observe what scripts are doing.
Task 21: Check cluster version and update.
Step 1: Run the following PowerShell command to display cluster version.

Step 105: Get-Cluster -Name Cluster1 | fl Cluster*


Step 106:
Expected result:

Step 166: Run the following PowerShell command to update cluster version.
Step 107: Update-ClusterFunctionalLevel -Cluster Cluster1
Step 108:
Step 167: Notice the warning, that it is irreversible action and confirm it.

Step 168: Run the following PowerShell command to display cluster version again

Step 109: Get-Cluster -Name Cluster1 | fl Cluster*


Step 110:

Step 169: Notice that ClusterFunctionalLevel is 9 and Cluster UpgradeVersion is 8.

Task 22: Check VM configuration version and update


Step 1: Open Server Manager
Step 170: In Server Manager, Click On Hyper-V on the left to list Hyper-V Servers.
Expected result:
Step 171: Right-Click CL1Node1 and from drop-down menu select Hyper-V Manager
Step 172: In Hyper-V Manager click on CL1Node1, then on MyVM1 and notice in the
bottom, that configuration version is 5.

Step 173: Navigate to \\cluster1\ClusterStorage$\MyCSV_1\MyVM1\Virtual Machines and


notice, that configuration is stored in XML.

Step 174: In Hyper-V manager, right-click MyVM1, and select settings


Step 175: In settings, Click on Checkpoints, and select production checkpoints.
Step 176: Click Apply. You will receive an error as this function requires upgrading VM
version
Step 177: Click Close to close Error window.
Step 178: And navigate to security and notice, that vTPM settings are not present.

Step 179: Click on Cancel to close VM Settings window.


Step 180: Right-Click on MyVM1 and click on Upgrade Configuration Version…
Step 181: Notice that after upgrade it is not possible to run this machine on previous
versions of Hyper-V. Click on Upgrade.

Step 182: Notice, that Configuration version is now 8

Step 183: Navigate to \\cluster1\ClusterStorage$\MyCSV_1\MyVM1\Virtual Machines again


and notice that virtual machine information is now stored in VMCX and VMRS file.
Step 184: Notice, that Encryption support is now present in VM settings.

Task 23: Update VM version with PowerShell


Step 1: Run the following command to update VM version on MyVM2
Step 111: Get-VM -CimSession CL1Node1 -Name MyVM2 | Update-VMVersion -Force
Step 112:

Task 24: Configure VMs and shutdown old cluster nodes


Step 1: Run the following command to configure all VMs on cluster with 256MB RAMand start

Step 113: #create variable $Clustername


Step 114: $ClusterName="Cluster1"
Step 115: #Configure all VMs on cluster with 256 MB startup bytes and dynamic
memory.
Step 116: Set-VM -Name * -DynamicMemory -MemoryStartupBytes 256MB -CimSession
(Get-ClusterNode -Cluster $ClusterName).Name
Step 117: #Start all VMs on cluster
Expected result:
Step 185: Run the following PowerShell command to shutdown old nodes.

#define server names


$servers="cl1W12node1","cl1W12node2"
# shutdown old servers
Stop-Computer $servers -Protocol WSMan
Module 3, Lab3: Create Second
Cluster with PowerShell
Introduction
In this lab, you will learn how to deploy Failover clusters with PowerShell end-to-end. As it is
now 4 node cluster with 5 LUNs, repeating steps from previous modules manually in GUI would
not make much sense and would take significant time to finish.

Objectives
After completing this lab, you will be able to:

 Understand benefit of scripting

Estimated time to complete this lab


5-15 minutes (most time just involves waiting for script to finish)

Lab Diagram

Hyper-V Virtual
External Switch/
Internet
Switch
ϭϬ͘ Ϭ͘ Ϭ͘ Ϭͬ Ϯϰ – Management Network

DC ϭϳ Ϯ͘ ϭϲ͘ ϭ͘ Ϭͬ Ϯϰ– ReplicaN et1


10.0.0.1
NAT
DC
DHCP CL1W12Node1,2 CL1Node1,2 CL2Node1..4 Site1Node1..2 Site2Node1..2
Management

͞SAN͟ ͞SAN͟
Shared VHDs Shared VHDs
Shared VHDs Shared VHDs 1× 200GB ͞Data͟ 1× 200GB ͞Data͟
1× 1GB Witness Disk 1× 1GB Witness Disk 1× 20GB ͞Log͟ 1× 20GB ͞Log͟
2× 8TB Capacity Disk 4× 8TB Capacity Disk

Scenario
The servers just started and you will configure them PowerShell to become Failover Cluster
simulating traditional, shared storage that can be in the real-world iSCSI, vFC, or Fibre Channel
storage. This time OS is NanoServer and number of nodes is 4.
Task 1: Deploy Cluster
Step 1: Paste the following script to PowerShell, or run section by section.
### Configure 4 node cluster ###
$servers="cl2node1","cl2node2","cl2node3","cl2node4"
$ClusterName="Cluster2"
$CSVNamePrefix="MyCSV_" #will add number
$NanoServer=$true

#Install required roles


if (!$NanoServer){
#install Hyper-V for core servers - in case you are deploying core servers instead
of Nano
foreach ($server in $servers) {Install-WindowsFeature -Name "Failover-
Clustering","Hyper-V","Hyper-V-PowerShell" -ComputerName $server}
#restart and wait for computers
Restart-Computer $servers -Protocol WSMan -Wait -For PowerShell
Start-Sleep 20 #failsafe
}

#Create vSwitch (Since here will be configured RDMA in future, Absolute is configured
as MinimumBandwidthMode weight is not supported with RDMA vNICs)
foreach ($server in $servers){
Invoke-Command -ComputerName $server -ScriptBlock {New-VMSwitch -Name
SETSwitch -EnableEmbeddedTeaming $TRUE -MinimumBandwidthMode Absolute -NetAdapterName
(Get-NetIPAddress -IPAddress 10.* ).InterfaceAlias}
}
Start-Sleep 5
Clear-DnsClientCache

###create new cluster ###


New-Cluster –Name $ClusterName –Node $servers
Start-Sleep 5
Clear-DnsClientCache

#add csv disks


$CSV_disks = get-disk -cimsession $servers[0] | where {$_.PartitionStyle -eq
'RAW' -and $_.Size -gt 10GB} | sort number
$i=1
foreach ($CSV_disk in $CSV_disks){
$volumename=($CSVNamePrefix+($i).ToString())
$CSV_disk | Initialize-Disk -PartitionStyle GPT
Format-Volume -Partition (New-Partition -UseMaximumSize -InputObject $CSV_disk
) -FileSystem NTFS -AllocationUnitSize 8kb -NewFileSystemLabel $volumename -CimSession
$servers[0] -Confirm:$false
$CSV_disk | set-disk -IsOffline $true
$ClusterDisk = Get-ClusterAvailableDisk -Cluster $ClusterName
$clusterDisk=Add-ClusterDisk -Cluster $ClusterName -InputObject $ClusterDisk
$clusterDisk.name = $volumename
$ClusterSharedVolume = Add-ClusterSharedVolume -Cluster $ClusterName
-InputObject $ClusterDisk
$ClusterSharedVolume.Name = $volumename
$path=$ClusterSharedVolume.SharedVolumeInfo.FriendlyVolumeName
$path=$path.Substring($path.LastIndexOf("\")+1)
$FullPath = Join-Path -Path "\\$ClusterName\ClusterStorage$\" -ChildPath $Path
Rename-Item -Path $FullPath -NewName $volumename -PassThru
$i++
}

#add witness disks


$witness_disk = get-disk -cimsession $servers[0] | where {$_.PartitionStyle -eq
'RAW' -and $_.Size -le 2GB}
$witness_disk | Initialize-Disk -PartitionStyle GPT
Format-Volume -Partition (New-Partition -UseMaximumSize -InputObject
$witness_disk) -FileSystem NTFS -AllocationUnitSize 8kb -NewFileSystemLabel
witness_disk -CimSession $servers[0] -Confirm:$false
$witness_disk | Set-Disk -IsOffline $true
$ClusterDisk = Get-ClusterAvailableDisk -Cluster $ClusterName
$clusterDisk=Add-ClusterDisk -Cluster $ClusterName -InputObject $ClusterDisk
$clusterDisk.name = "Witness Disk"
Set-ClusterQuorum -DiskWitness $ClusterDisk -Cluster $ClusterName

################################

Task 25: Explore your new 4 node cluster


Step 1: Open Failover Cluster Manager
Step 186: In Failover Cluster Manager, right-click Failover Cluster Manager and select
Connect to Cluster…

Step 187: Type Cluster2 into the cluster name and click OK

Step 188: In Summary of Cluster2 notice, that Witness disk is configured


Step 189: Expand cluster2 and navigate to Nodes. Notice that all nodes are up and
running.

Step 190: Expand storage and notice, that all CSVs are online.

Step 191: Click on MyCSV_1 and notice, that mountpoint was renamed to match CSV
name.
Module 3, Lab4: Mobility
Introduction
In this lab, you will learn how to live migrate and storage live migrate machines in cluster to
different CSVs. You will also learn how to live migrate virtual machines between clusters.

Objectives
After completing this lab, you will be able to:

 Understand live migration


 Understand storage live migration
 Understand shared nothing live migration

Estimated time to complete this lab


45 minutes

Lab diagram

Hyper-V Virtual
External Switch/
Internet
Switch
ϭϬ͘ Ϭ͘ Ϭ͘ Ϭͬ Ϯϰ – Management Network

DC ϭϳ Ϯ͘ ϭϲ͘ ϭ͘ Ϭͬ Ϯϰ– ReplicaN et1


10.0.0.1
NAT
DC
DHCP CL1W12Node1,2 CL1Node1,2 CL2Node1..4 Site1Node1..2 Site2Node1..2
Management

͞SAN͟ ͞SAN͟
Shared VHDs Shared VHDs
Shared VHDs Shared VHDs 1× 200GB ͞Data͟ 1× 200GB ͞Data͟
1× 1GB Witness Disk 1× 1GB Witness Disk 1× 20GB ͞Log͟ 1× 20GB ͞Log͟
2× 8TB Capacity Disk 4× 8TB Capacity Disk

Scenario
Now are 2 clusters running. First cluster is hosting 2 VMs. Second cluster is empty. First cluster is
using Windows Server 2016 Core and second Windows Server 2016 Nano installation option.
Exercise 1. :Perform different migration
types on Cluster1
Objectives
In this exercise, you will live migrate VMs using Live migration and using Storage Live migration.

Task 1: Perform live migration of MyVM1


Step 1: Open Failover Cluster Manager.
Step 192: In Failover Cluster Manager, expand roles on Cluster1.
Step 193: Right-Click MyVM1 and Select Move->Live Migration->Select Node…

Step 194: In new windows notice that only one node is available (as Cluster1 is 2 node
cluster). Select Cl1Node2 and click OK.
Step 195: Status will change to Live Migration and after a brief moment it will also change
owner node.
Expected result:
Task 26: Perform Storage live migration of MyVM1
Step 1: In Failover Cluster Manager, expand Cluster1 and navigate to Roles.
Step 196: Right-Click MyVM1 and select Move->Virtual Machine Storage

Step 197: New Move Virtual Machine Storage wizard willl appear. Drag and drop Virtual
Machine MyVM1 to MyCSV_2.
Expected result:
Step 198: Notice that destination folder path does not inherit the structure. Hit cancel to
close wizard.
Step 199: Open file explorer and navigate to \\cluster1\ClusterStorage$\MyCSV_2
Step 200: Create Folder MyVM1 and folder “Virtual Hard disks” inside MyVM1 folder.
Expected result:

Step 201: Return to Failover Cluster Manager and open Storage migration wizard for
MyVM1 again.
Step 202: Drag and drop items to match source and destination folder
Expected result:

Step 203: Click on Start to initiate move.


Expected result:
Step 204: Validate that all files moved navigating to
\\cluster1\ClusterStorage$\MyCSV_2\MyVM1 in file explorer
Expected result

Step 205: Move the machine back to MyCSV_1. Notice that Folders remained.

Task 27: Move machines there and back with PowerShell


Step 1: Run the following PowerShell command to move all VMs to MyCSV_2.

Step 121: #move all VMs in Cluster1 to MyCSV_2


Step 122:
Step 123: $PathtoCSV="C:\ClusterStorage\MyCSV_2"
Step 124: $ClusterName="cluster1"
Step 125:
Step 126: $ClusterNodes=(Get-ClusterNode -Cluster $ClusterName).name
Step 127: foreach ($ClusterNode in $ClusterNodes){
Step 128: $VMs=get-vm -CimSession $ClusterNode
Step 129: foreach ($VM in $VMs){
Step 130: $DestinationStoragePath="$($PathtoCSV)\$($VM.name)"
Step 131: $VM | Move-VMStorage -DestinationStoragePath
$DestinationStoragePath
Expected result:

Step 206: Run the following PowerShell command to move all VMs back to MyCSV_1
Step 137: #move all VMs in Cluster1 to MyCSV_1
Step 138:
Step 139: $PathtoCSV="C:\ClusterStorage\MyCSV_1"
Step 140: $ClusterName="cluster1"
Step 141:
Step 142: $ClusterNodes=(Get-ClusterNode -Cluster $ClusterName).name
Step 143: foreach ($ClusterNode in $ClusterNodes){
Step 144: $VMs=get-vm -CimSession $ClusterNode
Step 145: foreach ($VM in $VMs){
Step 146: $DestinationStoragePath="$($PathtoCSV)\$($VM.name)"
Step 147: $VM | Move-VMStorage -DestinationStoragePath
$DestinationStoragePath
Expected result:

Exercise 2. :Storage live migrate VMs to


different cluster
Objectives
In this exercise, you will configure Kerberos constrained delegation that is necessary to migrate
to another Hyper-V Host. You will also set Live Migration network to use Kerberos Constrained
delegation.
Task 1: Configure Kerberos constrained delegation
Step 1: In Server Manager, open Active Directory Users and Computer from Tools menu.

Step 207: In Active Directory Users and Computers expand Corp.contoso.com and navigate
to Workshop OU.
Step 208: In Workshop OU, right-click CL1Node1 and select Properties

Step 209: In properties navigate to Delegation tab and click on “Trust this computer for
delegation to specified services only” and select “Use any authentication protocol” as this
setting is now required for Windows Server 2016.
Step 210: Click on Add… button
Step 211: Click on Users or Computers… and type CL2Node1 in the object names.
Step 212: List of services will appear. Select cifs and “Microsoft Virtual System Migration
Service” and click OK
Step 213: Click Expanded to list all names.
Step 214: Notice that now also FQDN is displayed.
Expected result:
Step 215: Click OK to confirm the settings.

Task 2: Configure Kerberos authentication for live migration


Step 1: Open Server Manager
Step 216: In Server Manager, navigate to Hyper-V, right-click Cl2Node1 and select Hyper-V
Manager
Step 217: In Hyper-V manager right-click on CL2Node1 and select Hyper-V Settings

Step 218: In Live Migration settings select Advanced features and select Use Kerberos.
Step 219: Click OK to confirm the settings.
Step 220: Right-Click Hyper-V Manager and select Connect to Server …

Step 221: In Select Computer window type CL1Node1 and click OK

Step 222: Notice that MyVM2 is stil running, but it is not clustered anymore.
Step 223: Right-click on CL1Node1 and select Hyper-V settings.
Step 224: In Hyper-V settings select Advanced Features under Live Migrations and
configure “Use Kerberos” in authentication protocols. Click OK to confirm the settings

Step 225: Leave Hyper-V Manager open for next task.


Task 28: Evacuate MyVM2 to another cluster
Step 1: Open Failover Cluster Manager.
Step 226: In Failover Cluster Manager navigate to Resources under Cluster1
Step 227: Right-click MyVM2 and click on Remove (this will remove VM from cluster, but
VM will keep running on CL1Node1). Confirm the dialog to remove MyVM2.
Step 228: Open Hyper-V manager from previous task.
Step 229: Right-Click MyVM2 and select Move…

Step 230: New windows will appear. On Before You Begin page click Next
Step 231: On Choose Move Type window keep “Move the virtual machine” selected and
click Next
Step 232: On Specify destination window type CL2Node1 into the name and click Next.

Step 233: On Choose Move Options keep default selected and click Next

Step 234: Before browsing location, lets create folder for VM first. Navigate to
\\cluster2\ClusterStorage$\MyCSV_1 and create folder named MyVM2.

Step 235: On the Choose a new location for virtual machine window, click Browse and
navigate to folder you just created. Confirm the selection and click Next
Step 236: On the Summary page review the virtal machine paths and click Finish to initiate
the move.

Expected result:

Step 237: Validate, that VM is running on CL2Node1


Step 238: Attempt to move MyVM2 back to CL1Node1. You should see the following error
as kerberos constrained delegation was configured only from CL1Node1 to CL2Node1

Step 239: Close the window with Error.


Step 240: To make VM highly available on Cluster2, open Failover Cluster Manager.
Step 241: In Failover Cluster Manager, right-click on Roles under Cluster2 and select
Configure Role… New Wizard will appear.
Step 242: On Before You Begin page click Next.
Step 243: On Select Role page, select Virtual Machine and click Next

Step 244: Select Virtual Machine MyVM2 and click Next

Step 245: On Confirmation page click Next


Step 246: On Summary page click Finish
Expected result:
Exercise 6. :Configure required settings
and Live Migrate Storage using
PowerShell
Objectives
In this exercise, you will learn how to configure Kerberos constrained delegation and live
migration settings across all cluster nodes. As this action would consume a significant amount of
time when done manually, you will learn how to do it with PowerShell. To configure any node
from cluster1 to be able to migrate storage to any node in cluster2, you would need to
configure 6 AD objects, each with 2 or 4 settings. As you could see from previous exercise, you
can easily misconfigure something. With PowerShell you will configure this precisely and within
seconds.
Task 1: Configure Kerberos Constrained delegation.
Step 1: Run the following command to configure delegation on all cluster nodes from Cluster1
to Cluster2 and vice versa.

# https://technet.microsoft.com/en-us/windows-server-docs/compute/hyper-
v/deploy/set-up-hosts-for-live-migration-without-failover-clustering

#define cluster names.


$Clusters="Cluster1","Cluster2"

#configure kerberos constrained delegation for cifs and Microsoft Virtual System
Migration Service, both name and FQDN
foreach ($Cluster in $Clusters){

$SourceNodes=(Get-ClusterNode -Cluster $Cluster).Name


$DestinationNodes=$clusters | ForEach-Object {if ($_ -ne $cluster){(Get-
ClusterNode -Cluster $_).Name}}

Foreach ($DestinationNode in $DestinationNodes){


$HostName = $DestinationNode
$HostFQDN = (Resolve-DnsName $HostName).name | select -First 1
Foreach ($SourceNode in $SourceNodes){
Get-ADComputer $SourceNode | Set-ADObject -Add @{"msDS-
AllowedToDelegateTo"="Microsoft Virtual System Migration Service/$HostFQDN",
"Microsoft Virtual System Migration Service/$HostName", "cifs/$HostFQDN",
"cifs/$HostName"}
}
}
}

#Switch to any authentication protocol


https://blogs.technet.microsoft.com/virtualization/2017/02/01/live-migration-via-
constrained-delegation-with-kerberos-in-windows-server-2016/
foreach ($Cluster in $clusters){
$ClusterNodes=(Get-ClusterNode -Cluster $Cluster).Name
Foreach ($ClusterNode in $ClusterNodes){
$GUID=(Get-ADComputer $clusternode).ObjectGUID
$comp=Get-ADObject -identity $Guid -Properties "userAccountControl"
#Flip the ADS_UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION bit using
powershell bitwise OR operation (-bor)
$Comp.userAccountControl = $Comp.userAccountControl -bor 16777216
Set-ADObject -Instance $Comp
}
}

Task 29: Validate settings via the GUI


Step 1: Open Active Directory Users and Computers console and navigate to Workshop OU
Step 247: Open CL1Node2 and CL2node2 properties and inspect delegation settings
Expected result:
Task 30: Configure Live Migration Authentication
Step 1: Run the following command to configure live migration authentication settings on all
cluster nodes.

Step 153: #define cluster names.


Step 154: $Clusters="Cluster1","Cluster2"
Step 155:
Step 156: #Switch to kerberos authentication for live migration
Step 157:
Step 158: foreach ($Cluster in $Clusters){
Step 159: $ClusterNodes=(Get-ClusterNode -Cluster $Cluster).Name
Step 160: Set-VMHost -CimSession $ClusterNodes
-VirtualMachineMigrationAuthenticationType Kerberos

Task 31: Validate settings with GUI


Step 1: Open Server Manager and navigate to Hyper-V container.
Step 2: Pick random Hyper-V host (CL#Node#) and check if kerberos authentication was
configured
Expected result:
Task 32: Evacuate Cluster1 to Cluster2 with PowerShell
Step 1: Run the following command to evacuate Cluster1 to Cluster2

Step 165: #live migrate VMs to different cluster


Step 166:
Step 167: $SourceClusterName="Cluster1"
Step 168: $DestinationClusterName="Cluster2"
Step 169: $DestinationStoragePath="C:\ClusterStorage\MyCSV_1"
Step 170: #$VMNames="MyVM1"
Step 171: $VMNames=(Get-VM -cimsession (get-clusternode -cluster
$SourceClusterName).Name).Name
Step 172:
Step 173: #remove VMs from HA Resources
Step 174: foreach ($VMName in $VMNames){
Step 175: Get-ClusterResource -Cluster $SourceClusterName -name "Virtual
Machine $VMName" | Remove-ClusterResource -force
Step 176: Get-ClusterGroup -Cluster $SourceClusterName -Name $VMName |
Remove-ClusterGroup -force
Step 177: }
Step 178:
Step 179: #Move VMs to different cluster
Step 180: foreach ($VMName in $VMNames){
Step 181: #Grab first node in cluster $DestinationClusterName
Step 182: $DestinationHost=(get-clusternode -cluster
$DestinationClusterName).Name | select -First 1
Step 183: $VM=Get-VM -Cimsession (get-clusternode -cluster
$SourceClusterName).Name -Name $VMName
Step 184: $VM | Move-VM -DestinationHost $DestinationHost
-DestinationStoragePath "$DestinationStoragePath\$($VM.Name)" -IncludeStorage
Step 185: }
Step 186:
Step 187: #add VMs as HA Resources on destination cluster
Step 188: foreach ($VMName in $VMNames){
Task 33: Evacuate Cluster2 to Cluster1 with PowerShell
Step 1: Run the following command to evacuate Cluster2 to Cluster1

Step 193: #live migrate VMs to different cluster


Step 194:
Step 195: $SourceClusterName="Cluster2"
Step 196: $DestinationClusterName="Cluster1"
Step 197: $DestinationStoragePath="C:\ClusterStorage\MyCSV_1"
Step 198: #$VMNames="MyVM1","MyVM2"
Step 199: $VMNames=(Get-VM -cimsession (get-clusternode -cluster
$SourceClusterName).Name).Name
Step 200:
Step 201: #remove VMs from HA Resources
Step 202: foreach ($VMName in $VMNames){
Step 203: Get-ClusterResource -Cluster $SourceClusterName -name "Virtual
Machine $VMName" | Remove-ClusterResource -force
Step 204: Get-ClusterGroup -Cluster $SourceClusterName -Name $VMName |
Remove-ClusterGroup -force
Step 205: }
Step 206:
Step 207: #Move VMs to different cluster
Step 208: foreach ($VMName in $VMNames){
Step 209: #Grab first node in cluster $DestinationClusterName
Step 210: $DestinationHost=(get-clusternode -cluster
$DestinationClusterName).Name | select -First 1
Step 211: $VM=Get-VM -Cimsession (get-clusternode -cluster
$SourceClusterName).Name -Name $VMName
Step 212: $VM | Move-VM -DestinationHost $DestinationHost
-DestinationStoragePath "$DestinationStoragePath\$($VM.Name)" -IncludeStorage
Step 213: }
Step 214:
Step 215: #add VMs as HA Resources on destination cluster
Step 216: foreach ($VMName in $VMNames){
Module 4, Lab1: Networking
Introduction
In this lab, you will perform the very same steps as you would do when configuring real
networking on the failover cluster. You will configure Converged networking without RDMA.

Objectives
After completing this lab, you will be able to:

 Understand how to configure Converged networking


 Understand virtual adapters
 Understand how to configure networks in PowerShell

Prerequisites
 Cluster1 should be up and running.

Estimated time to complete this lab


45 minutes

Lab Diagram

Hyper-V Virtual
External Switch/
Internet
Switch
ϭϬ͘ Ϭ͘ Ϭ͘ Ϭͬ Ϯϰ – Management Network

DC ϭϳ Ϯ͘ ϭϲ͘ ϭ͘ Ϭͬ Ϯϰ– ReplicaN et1


10.0.0.1
NAT
DC
DHCP CL1W12Node1,2 CL1Node1,2 CL2Node1..4 Site1Node1..2 Site2Node1..2
Management

͞SAN͟ ͞SAN͟
Shared VHDs Shared VHDs
Shared VHDs Shared VHDs 1× 200GB ͞Data͟ 1× 200GB ͞Data͟
1× 1GB Witness Disk 1× 1GB Witness Disk 1× 20GB ͞Log͟ 1× 20GB ͞Log͟
2× 8TB Capacity Disk 4× 8TB Capacity Disk

For more information


https://technet.microsoft.com/en-us/library/hh831829(v=ws.11).aspx

Scenario
Cluster1 has only SET Switches created. You also need to dedicate a network for CSV traffic and
Live Migration traffic. To be able to control network priority, you need to configure weight
settings. To be able to isolate communication, you will setup VLANs. You also need to configure
static IP Addresses to newly created interfaces.
Exercise 1. :Configure Converged
networking
Objectives
In this exercise, you configure traditional, non-RDMA converged networking.

Task 1: Explore current configuration


Step 1: In Management machine open elevated PowerShell
Step 248: Paste the following PowerShell command save variables. Keep PowerShell open
for next steps to keep variables.

Step 221: #Define cluster name


Step 222: $ClusterName="Cluster1"
Step 223: #get-list of computer names in cluster
Step 224: $ClusterNodes=(Get-ClusterNode -Cluster $ClusterName).Name

Step 249: To list network switches Run the following command. Notice, that
NetAdapterInterfaceDescription is Teamed-Interface as switch is Switch Embedded. Also
notice, that BandidthReservationMode is Weight.
Step 226: #List Virtual Swiches
Step 227: Get-VMSwitch -CimSession $ClusterNodes | ft
Name,SwitchType,NetAdapterInterfaceDescription,BandwidthReservationMode,Computer
Name
Step 228:
Expected result:

Step 250: To list what adapters are connected to virtual switches, use following command.

Step 229: #List NICs connected to Swiches


Step 230: Get-VMSwitch -CimSession $ClusterNodes | ft
NetAdapterInterfaceDescriptions,ComputerName
Step 231:
Expected result:

Note
As we are using virtualized environment, you can see Hyper-V Network adapter and it might
be confusing.

Step 251: Let’s take a look what adapters are present at Cluster1 nodes by running

Step 232: #List all network adapters


Step 233: Get-NetAdapter -CimSession $ClusterNodes

following PowerShell command.


Expected result:

Note
As you can see, each node has 3 Network Adapters. Ethernet and Ethernet 2 are connected to a
Virtual Switch. vEthernet is a Virtual Ethernet Adapter connected to vSwitch. Also notice that
LinkSpeed of vEthernet is 20Gbps as each adapter connected to vSwitch is 10Gbps
Step 252: Let’s take a look at IP configuration. Run the following command showing just
IPV4 addresses (except APIPA).

#inspect IP configuration
Get-NetIPAddress -CimSession $ClusterNodes |where AddressFamily -eq IPv4 | where
IPAddress -NotLike 169* | ft IPAddress,InterFaceAlias,AddressFamily,PSComputerName

Expected result:

Note
As you can see, one of the nodes has 2 IP addresses. It’s because it is Cluster Address. As you
can also see, only vEthernet adapter has an IP Address.

Step 253: List virtual adapters using following command

#list virtual adapters connected to Management OS


Get-VMNetworkAdapter -CimSession $ClusterNodes -ManagementOS

Expected result:
Step 254: To reveal extended information about those adapters you can Run the following
command to list all properties.

Step 234: Get-VMNetworkAdapter -CimSession $ClusterNodes -ManagementOS | fl *

Task 34: Create additional Virtual Network Adapters and


configure them
Step 1: Open elevated PowerShell and Run the following command to fill variables. Keep
PowerShell window open for this Task.

Step 235: #define cluster name


Step 236: $clusterName="Cluster1"
Step 237: #create list of cluster nodes
Step 238: $clusterNodes=(Get-ClusterNode -Cluster $ClusterName).Name
Step 239: #IPs
Step 240: $Net1="172.16.1." #Network for Live Migration
Step 241: $Net1VLAN=1 #VLAN for Live Migration
Step 242: $Net2="172.16.2."
Step 243: $Net2VLAN=2 #Network for CSV Traffic

Step 255: Run the following command to create virtual NICs for Live Migration and CSV
Traffic. This command will also rename first adapter from SETSwitch to Management. (By
default it inherites name from the virtual switch.
Step 247: #Configure vNICS
Step 248: #rename first adapter that was created during SET Switch creation
Step 249: Rename-VMNetworkAdapter -ManagementOS -Name SETSwitch -NewName
Management -CimSession $clusterNodes
Step 250: #add LiveMigration and Cluster communication adapters
Step 251: Add-VMNetworkAdapter -ManagementOS -Name "LiveMigration"
-SwitchName "SETSwitch" -CimSession $clusterNodes
Step 252: Add-VMNetworkAdapter -ManagementOS -Name "Cluster"
-SwitchName "SETSwitch" -CimSession $clusterNodes

Step 256: Validate that all vNICs were created.

Step 253: #list virtual adapters connected to Management OS


Step 254: Get-VMNetworkAdapter -CimSession $ClusterNodes -ManagementOS
Step 255:
Expected result:
Step 257: Configure Minimum Bandwidth modes.
Step 261: #configure Bandwidth Modes
Step 262: Set-VMNetworkAdapter -ManagementOS -Name "Cluster"
-MinimumBandwidthWeight 40 -CimSession $clusterNodes
Step 263: Set-VMNetworkAdapter -ManagementOS -Name Management
-MinimumBandwidthWeight 5 -CimSession $clusterNodes
Step 264: Set-VMNetworkAdapter -ManagementOS -Name "LiveMigration"
-MinimumBandwidthWeight 20 -CimSession $clusterNodes
Step 265:
Step 266: #configure default Default Bandwidth.
Step 267: Set-VMSwitch "SETSwitch" -DefaultFlowMinimumBandwidthWeight 1
-CimSession $clusterNodes
Step 258: Validate configuration using following PowerShell commands.
Step 256: #validate bandwith on adapters
Step 257: (Get-VMNetworkAdapter -ManagementOS -CimSession
$clusterNodes).BandwidthSetting | ft
ParentAdapter,MinimumBandwidthWeight,ComputerName
Step 258: #validate bandwith on SETSwitches
Step 259: Get-VMSwitch -CimSession $clusterNodes | ft

Expected result:

Step 259: To configure VLANs, Run the following command.

Step 269: Invoke-Command -ComputerName $clusternodes -ArgumentList $Net1VLAN,


$Net2VLAN -ScriptBlock {
Step 270: param($Net1VLAN,$Net2VLAN);
Step 271: #Configure the host vNIC to use a Vlan.
Step 272: Set-VMNetworkAdapterVlan -VMNetworkAdapterName LiveMigration
-VlanId $Net1VLAN -Access -ManagementOS
Step 273: Set-VMNetworkAdapterVlan -VMNetworkAdapterName Cluster
-VlanId $Net2VLAN -Access -ManagementOS
Step 274: #Restart each host vNIC adapter so that the Vlan is active.
Step 275: Restart-NetAdapter "vEthernet (Cluster)"
Step 276: Restart-NetAdapter "vEthernet (LiveMigration)"
Step 277: }
Step 260: Validate, that VLANs are set with following command

Step 279: #Verify that the VlanIDs are set


Step 280: Get-VMNetworkAdapterVlan –ManagementOS -CimSession $clusternodes |
Sort-Object -Property Computername | ft ComputerName,AccessVlanID,ParentAdapter
-AutoSize -GroupBy ComputerName
Step 281:
Expected result:

Step 261: Configure Static IP Addresses using following command:

Step 283: foreach ($clusterNode in $clusterNodes){


Step 284: New-NetIPAddress -IPAddress ($Net1+$IP.ToString()) -InterfaceIndex
(Get-NetAdapter -Name *LiveMigration* -CimSession $clusterNode).InterfaceIndex
-CimSession $clusterNode -PrefixLength 24
Step 285: New-NetIPAddress -IPAddress ($Net2+$IP.ToString()) -InterfaceIndex
(Get-NetAdapter -Name *Cluster* -CimSession $clusterNode).InterfaceIndex
-CimSession $clusterNode -PrefixLength 24
Step 286: $IP++
Step 287: }

Expected result:

Step 262: Validate IP configuration with following command:

#verify ip config
Get-NetIPAddress -CimSession $clusterNodes -InterfaceAlias vEthernet*
-AddressFamily IPv4 | Sort-Object -Property PSComputername | ft
pscomputername,interfacealias,ipaddress -AutoSize -GroupBy pscomputername
Expected result:

Task 35: Explore networks in Failover Cluster Manager


Step 1: Open Failover Cluster Manager and connect to Cluster1
Step 263: In Failover Cluster Manager, navigate to Networks. Notice that 3 networks are
available.

Step 264: Click on Cluster Network 3, and click on Network Connections tab in the bottom.
Notice that all adapters have IP Addresses and are UP.
Expected result:
Step 265: Right-Click Cluster Network 3 and select Properties. Notice the settings
Step 266: Close the Cluster Network 3 Properties Window.
Step 267: Right-Click on Networks and select Live Migration Settings…

Step 268: Notice the Live Migration Settings. Close the window.

Task 36: Configure Cluster Networks with PowerShell


Step 1: Rename networks and set roles with following PowerShell command
Step 289: #Configure networks in cluster
Step 290: (Get-ClusterNetwork -Cluster Cluster1 | where Role -eq
ClusterAndClient).Name="Management"
Step 291: (Get-ClusterNetwork -Cluster Cluster1 | where Address -eq
"172.16.1.0").Name="Cluster"
Step 292: (Get-ClusterNetwork -Cluster Cluster1 | where Address -eq
"172.16.2.0").Name="LiveMigration"
Step 293: (Get-ClusterNetwork -Cluster Cluster1 | where Address -eq
"172.16.2.0").role="None"
Expected result:

Step 269: Configure Live Migration network using following PowerShell command

Step 295: #Set network for Live Migration


https://blogs.msdn.microsoft.com/virtual_pc_guy/2013/05/02/using-powershell-to-
configure-live-migration-networks-in-a-hyper-v-cluster/
Step 296: Get-ClusterResourceType -Cluster Cluster1 -Name "Virtual Machine" |
Set-ClusterParameter -Name MigrationExcludeNetworks -Value ([String]::Join(";",
(Get-ClusterNetwork -Cluster Cluster1 | Where-Object {$_.Name -ne
"LiveMigration"}).ID))
Expected result:
Task 37: Connect all VMs to SETSwitch
Step 1: Run the following PowerShell command to connect all VM adapters to SETSwitch.

#connect all VMs to SETSwitch


Get-VMNetworkAdapter -VMName * -CimSession (Get-ClusterNode -cluster Cluster1).Name
| Connect-VMNetworkAdapter -SwitchName SETSwitch

Step 270: Run the following command to validate that all VMs are connected.

Get-VMNetworkAdapter -VMName * -CimSession (Get-ClusterNode -cluster Cluster1).Name

Expected result:
Module 6, Lab1: Stretch Cluster and
Storage Replica
Introduction
In this lab, you will learn how to configure a Stretched Cluster. Steps you already learned how to
do using Graphical tools will be done with PowerShell

Objectives
After completing this lab, you will be able to:

 Understand how to create a stretched cluster

Prerequisites
 none

Estimated time to complete this lab


45 minutes

Lab Diagram

Hyper-V Virtual
External Switch/
Internet
Switch
ϭϬ͘ Ϭ͘ Ϭ͘ Ϭͬ Ϯϰ – Management Network

DC ϭϳ Ϯ͘ ϭϲ͘ ϭ͘ Ϭͬ Ϯϰ– ReplicaN et1


10.0.0.1
NAT
DC
DHCP CL1W12Node1,2 CL1Node1,2 CL2Node1..4 Site1Node1..2 Site2Node1..2

Management

͞SAN͟ ͞SAN͟
Shared VHDs Shared VHDs
Shared VHDs Shared VHDs 1× 200GB ͞Data͟ 1× 200GB ͞Data͟
1× 1GB Witness Disk 1× 1GB Witness Disk 1× 20GB ͞Log͟ 1× 20GB ͞Log͟
2× 8TB Capacity Disk 4× 8TB Capacity Disk

For more information


https://technet.microsoft.com/en-us/windows-server-docs/storage/storage-replica/stretch-
cluster-replication-using-shared-storage

Scenario
In this Lab, you will setup a 4 node cluster. Each node is running Windows Server 2016
Datacenter Nano. Site1Node1 and Site1Node2 are connected to the same, shared storage.
Site2Node1 and Site2Node2 are connected to different shared storage than Site1. This scenario
is representing 2 sets of Shared Storage, in 2 sites.
Exercise 1. :Install all prerequisites using
PowerShell
Objectives
In this exercise, you will create a Cluster and configure all Storage replica prerequisites. You will
also create VMs, mostly via PowerShell.

Lab Diagram
ϭϳ Ϯ͘ ϭϲ͘ ϭ͘ Ϭͬ Ϯϰ– Rep licaN et1

Site1Node1..2 Site2Node1..2

Shared VHDs Shared VHDs


1× 200GB ͞Data͟ 1× 200GB ͞Data͟
1× 20GB ͞Log͟ 1× 20GB ͞Log͟

Task 1: Install required roles, create virtual switch, Setup


Cluster, configure witness
Step 1: Switch to Hyper-V host, and start Site#Node# VMs.
Expected result:
Step 2: Switch back to Management VM and Run the following PowerShell script to configure
essential settings. Make sure PowerShell is running as administrator. Keep the PowerShell
window open for the next tasks as we need to preserve the variables
Step 298: #Configure stretch cluster
Step 299: $servers="Site1Node1","Site1Node2","Site2Node1","Site2Node2"
Step 300: $Site1Servers="Site1Node1","Site1Node2"
Step 301: $Site2Servers="Site2Node1","Site2Node2"
Step 302: $ClusterName="Stretch-Clus"
Step 303: $NanoServer=$true
Step 304:
Step 305: ##Install required roles
Step 306: foreach ($server in $servers) {Install-WindowsFeature -Name Storage-
Replica,RSAT-Storage-Replica,FS-FileServer -ComputerName $server}
Step 307:
Step 308: if (!$NanoServer){
Step 309: #install Hyper-V for core servers - in case you are deploying core
servers instead of Nano
Step 310: foreach ($server in $servers) {Install-WindowsFeature -Name
"Failover-Clustering","Hyper-V","Hyper-V-PowerShell" -ComputerName $server}
Task 38: Configure Fault domains and format disks.
Step 1: Run the following PowerShell script to configure fault domains and format disk.

Step 345:
Step 346: #configure fault domains
Step 347: New-ClusterFaultDomain -Name Seattle -Type Site -Description
"Primary" -Location "Seattle Datacenter" -CimSession $ClusterName
Step 348: New-ClusterFaultDomain -Name Bellevue -Type Site -Description
"Secondary" -Location "Bellevue Datacenter" -CimSession $ClusterName
Step 349:
Step 350: foreach ($Site1Server in $Site1Servers){
Step 351: Set-ClusterFaultDomain -Name $Site1Server -Parent Seattle
-CimSession $ClusterName
Step 352: }
Step 353: foreach ($Site2Server in $Site2Servers){
Step 354: Set-ClusterFaultDomain -Name $Site2Server -Parent Bellevue
-CimSession $ClusterName
Step 355: }
Step 356:
Step 357: (Get-Cluster -Name $ClusterName).PreferredSite="Seattle"
Step 358:
Step 359: #get Cluster Fault domain XML to validate configuration
Step 360: Get-ClusterFaultDomainXML -CimSession $ClusterName
Step 361:
Step 362: ##add storage
Step 363:
Step 364: #format and initialize disks
Step 365: new-volume -DiskNumber 1 -FriendlyName Data -FileSystem NTFS
-AccessPath D: -CimSession $Site1Servers[0]
Step 366: new-volume -DiskNumber 2 -FriendlyName Log -FileSystem NTFS
-AccessPath E: -CimSession $Site1Servers[0]
Step 367: new-volume -DiskNumber 1 -FriendlyName Data -FileSystem NTFS
-AccessPath D: -CimSession $Site2Servers[0] -ErrorAction SilentlyContinue

Task 39: Validate settings using Failover Cluster Manager


Step 1: Open Failover Cluster Manager and connect to Stretch-Clus
Expected result:
Step 271: In summary notice that File Share Witness was configured.

Step 272: Expand Nodes and notice that sites are present as we configured Fault Domains.

Step 273: Expand storage and notice that Cluster Disks are present under Disks.
Task 40: Add cluster disk to Cluster Shared volumes and
create VMs
Step 1: Add data drive to Cluster Shared Volumes by Right-Click on Cluster Disk, and selecting
Add to Cluster Shared Volumes. (make sure you select 200GB disk connected to Site1 as
shown in the picture below)

Expected result:
Step 274: Create VMs using following PowerShell command.

Step 370: #create VMs


Step 371: $VMNames="MyReplicatedVM1","MyReplicatedVM2"
Step 372: $clusterName="Stretch-Clus"
Step 373: $CSVName="Volume1"
Step 374: $VHDPath="D:\ParentDisks\Win2016NanoHV_G2.vhdx"
Step 375:
Step 376: $clusterNodes=(Get-ClusterNode -Cluster $clusterName).Name
Step 377: foreach ($VMName in $VMNames){
Step 378: New-Item -Path "\\$clusterName\ClusterStorage$\$CSVName\
$VMName\Virtual Hard Disks" -ItemType Directory
Step 379: Copy-Item -Path $VHDPath -Destination "\\
$clusterName\ClusterStorage$\$CSVName\$VMName\Virtual Hard Disks\$
($VMName)_Disk1.vhdx"
Step 380: New-VM -Name $VMName -MemoryStartupBytes 256MB -Generation 2
-Path "c:\ClusterStorage\$CSVName" -VHDPath "c:\ClusterStorage\$CSVName\
$VMName\Virtual Hard Disks\$($VMName)_Disk1.vhdx" -SwitchName SETSwitch
-ComputerName $clusterNodes[0]
Step 381: Set-VMMemory -VMName $VMName -DynamicMemoryEnabled $true
-ComputerName $clusterNodes[0]
Step 382: Start-VM -name $VMName -ComputerName $clusterNodes[0]
Step 383: Add-ClusterVirtualMachineRole -VMName $VMName -Cluster
$ClusterName

Expected result:
Exercise 7. :Enable Synchronous
Replication to second site
Objectives
In this exercise, you will configure synchronous replication to a second site using the wizard in
Failover Cluster Manager

Task 41: Enable replication of Cluster Shared Volume


Step 1: In Failover Cluster Manager navigate to Disks under Storage
Step 275: Right-Click on Cluster Shared Volume and Under Replication click on Enable…
Step 276: On Before You Begin page click Next
Step 277: On Select destination data disk select Cluster disk and click Next

Step 278: On Select source log disk page select Cluster Disk and click Next
Step 279: On Destination log disk select cluster disk and click Next

Step 280: On Seeded Disk page keep OverWrite destination volume selected and click
Next

Step 281: On Replication Mode page keep Synchronous Replication and click Next
Step 282: On Consistency Group page keep Highest Performance selected and click Next

Step 283: On Confirmation page click Next


Step 284: Wait for configuration to finish and click Finish on Summary page to close the
wizard.

Task 42: Explore the replication feature.


Step 1: In Failover Cluster Manager navigate to Disks under Storage in Stretch-Clus. Notice that
all disks are Online. Also Replication role is present, so you can easily identify Source and
Destination disks.
Step 285: Click on Source Cluster Shared Volume and click on Replication tab in the
bottom of window. Notice that Status is Continously replicating and Mode is Synchrononus.

Step 286: Right click on Cluster Events and select Query


Step 287: In Cluster Events Filter check Microsoft-Windows-StorageReplica logs and select
also Informational Level. Click OK to confirm the selection.
Step 288: Sort events by Date and Time, and notice, that event 5020 says, that destination
entered synchronous replication state.
Exercise 8. :Configure Replication
Network
Objectives
In this exercise, you will configure Stretch Cluster to use a dedicated network for Storage Replica

Task 1: Inspect network current settings


Step 1: Open Failover Cluster Manager and connect to Stretch-Clus
Step 289: Navigate to Networks under Stretch-Clus and notice that 2 networks are
available

Note
Cluster and Client network is “Management” network, where you created SETSwitch. Cluster
Only network is extra network you will configure for Storage Replication

Task 43: Rename Cluster Network for Replication


Step 1: Run the following command to rename the network
Expected result:
$ReplicaNetwork="172.16.11.0"
$ClusterName="Stretch-Clus"
#configure Cluster Network name
(Get-ClusterNetwork -Cluster $ClusterName | where Address -eq
$ReplicaNetwork).Name="ReplicaNetwork"

Task 44: Dedicate ReplicaNetwork to replication.


Step 1: Run the following command to set constraint to ReplicaNetwork. Keep PowerShell open
for next step
Step 386: $ReplicaNetwork="172.16.11.0"
Step 387: $ClusterName="Stretch-Clus"
Step 388: $SourceClusterNode="Site1Node1"
Step 389: $DestinationClusterNode="Site2Node1"
Step 390: #set constraint
Step 391: Set-SRNetworkConstraint -SourceComputerName $SourceClusterNode
-SourceRGName (Get-SRGroup -CimSession $ClusterName).Name[0]
-SourceNWInterface "ReplicaNetwork" -DestinationComputerName
$DestinationClusterNode -DestinationNWInterface "ReplicaNetwork"

Step 2: Run the following command validate constraint to ReplicaNetwork.


Step 394: #validate contraint
Step 395: Get-SRNetworkConstraint -SourceComputerName $SourceClusterNode
-SourceRGName (Get-SRGroup -CimSession $ClusterName).Name[0]
-DestinationComputerName $DestinationClusterNode -DestinationRGName (Get-SRGroup
-CimSession $ClusterName).Name[1]
Step 396:
Expected result:
Module 6, Lab2: Hyper-V Replica
Introduction
In this lab, you will learn how to setup Hyper-V Replica on failover clusters. You will also learn
how to enable

Objectives
After completing this lab, you will be able to:

 Understand how to create highly available roles for Hyper-V Replica


 Understand how to Configure VM to be replicated to another cluster
 Understand how to extend replication to another cluster

Prerequisites
 Cluster1, Cluster2 and Stretch-Clus needs to be running.

Estimated time to complete this lab


45 minutes

Lab Diagram

Hyper-V Virtual
External Switch/
Internet
Switch
ϭϬ͘ Ϭ͘ Ϭ͘ Ϭͬ Ϯϰ – Management Network

DC ϭϳ Ϯ͘ ϭϲ͘ ϭ͘ Ϭͬ Ϯϰ– ReplicaN et1


10.0.0.1
NAT
DC
DHCP CL1W12Node1,2 CL1Node1,2 CL2Node1..4 Site1Node1..2 Site2Node1..2
Management

͞SAN͟ ͞SAN͟
Shared VHDs Shared VHDs
Shared VHDs Shared VHDs 1× 200GB ͞Data͟ 1× 200GB ͞Data͟
1× 1GB Witness Disk 1× 1GB Witness Disk 1× 20GB ͞Log͟ 1× 20GB ͞Log͟
2× 8TB Capacity Disk 4× 8TB Capacity Disk

Scenario
In this Lab you will setup a 4 node cluster. Each node is running Windows Server 2016
Datacenter Nano. Site1Node1 and Site1Node2 are connected to the same, shared storage.
Site2Node1 and Site2Node2 are connected to different shared storage than Site1. This scenario
is representing 2 sets of Shared Storage, in 2 sites.
Exercise 1. :Configure HA roles for
Hyper-V Replica
Task 1: Configure Hyper-V Replica role on Stretch-Clus
Step 1: Open Failover Cluster Manager and connect to Stretch-Clus
Step 290: Right-Click on Stretch-Clus and select Configure Role… HA Wizard will appear

Step 291: Click Next on Before You Begin page


Step 292: On Select Role page click on Hyper-V Replica Broker and click Next
Step 293: On Client Access Point page type Stretch-ClusRB into the Name and click Next

Step 294: On Confirmation page click Next


Step 295: On Summary page click Finish to close the wizard.

Step 296: Notice, that Stretch-ClusRB role appeared in list of roles.

Task 45: Configure RB role on 2 other clusters with


PowerShell
Step 1: Run the following script to configure HA RB roles on 2 other clusters.

$ClusterNames="Cluster1","Cluster2"

#add replica broker


Foreach ($ClusterName in $ClusterNames){
$BrokerName="$($ClusterName)RB"
Add-ClusterServerRole -Cluster $ClusterName -Name $BrokerName
Add-ClusterResource -Cluster $ClusterName -Name "Virtual Machine
Replication Broker" -Type "Virtual Machine Replication Broker" -Group $BrokerName
Add-ClusterResourceDependency -Cluster $ClusterName "Virtual Machine
Replication Broker" $BrokerName
Start-ClusterGroup $BrokerName -Cluster $ClusterName
}
Step 297: Validate, that roles were added with Failover Cluster Manager
Expected result:
Task 46: Enable Firewall rules for Hyper-V replica
Step 1: Run the following PowerShell command to enable Firewall Rule for Hyper-V replica.

Step 397: $ClusterNames="Stretch-Clus","Cluster2","Cluster1"


Step 398: #enable firewall rules
Step 399: Foreach ($ClusterName in $ClusterNames){
Step 400: Enable-NetFirewallRule -CimSession (Get-ClusterNode -Cluster
$ClusterName).Name -DisplayName "Hyper-V Replica*"
Step 401: }

Task 47: Configure replica servers to use Kerberos for


authentication and allow replication from anywhere
Step 1: Run the following PowerShell script to enable replication. The script will also configure
the first CSV to be storage for replicated VMs. Clear-DNSClientCache is necessary to be able
to resolve RB HA roles DNS names.

Step 406: Clear-DnsClientCache


Step 407: $ClusterNames="Stretch-Clus","Cluster2","Cluster1"
Step 408: Foreach ($ClusterName in $ClusterNames){
Step 409: $firstCSV=(Get-ClusterSharedVolume -Cluster
$ClusterName).SharedVolumeInfo.FriendlyVolumeName | sort | Select-Object -Index
0
Step 410: Invoke-Command -ComputerName "$($ClusterName)RB" -ArgumentList
$firstCSV -ScriptBlock {
Step 411: Param ($firstCSV);
Step 412: Set-VMReplicationServer -ReplicationEnabled $true
-AllowedAuthenticationType Kerberos -ReplicationAllowedFromAnyServer $true
-DefaultStorageLocation $firstCSV

Step 298: Validate, that settings were configured by navigating to any Hyper-V Server
Settings
Exercise 9. :Enable Hyper-V replica
Objectives
In this exercise you will enable Hyper-V replica on one of the VMs running on Stretch-Clus to
Cluster2. You will also extend replication from Cluster2 to Cluster1.
Task 1: Enable Replication of MyReplicatedVM1
Step 1: In Failover Cluster Manager connect to Stretch-Clus and open Roles
Step 299: Right-click on MyReplicatedVM1 and select Enable Replication… under
Replication. The wizard will appear.

Step 300: On Before You Begin page click Next


Step 301: On Specify Replica Server type Cluster2RB and click Next

Step 302: On specify Connection Parameters keep defaults and click Next
Step 303: On Choose Replication VHDs page click Next

Step 304: On Configure Replication Frequency select 30s and click Next

Step 305: On Configure Additional Recovery Points page Select Create additional hourly
recovery points and configure VSS snapshot every hour.
Step 306: On Choose Initial Replication Method page keep defaults and click Next

Step 307: On Summary page review settings and click Finish. Wizard will configure
replication and close.

Task 48: Explore Replicated VM.


Step 1: In Stretch-Clus right-clck on MyReplicatedVM1 and notice available options
Step 308: Connect to Cluster2 and notice that MyReplicatedVM1 is also there under Roles

Step 309: Right-click on MyReplicatedVM1 on Cluster2, click on Replication and notice


available options.
Task 49: Extend replication of MyReplicatedVM1
Step 1: Open Failover Cluster Manager and Connect to Cluster2.
Step 310: Navigate to Roles and Right-Click on MyReplicatedVM1. Select click on
Replication and select Extend Replication… Extend Replication Wizard will appear.

Step 311: On Before you begin page click Next


Step 312: On Specify Replica Server page type Cluster1RB into Replica server name and
click Next
Step 313: On Specify Connection Parameters page keep defaults and click Next
Step 314: On Configure Replication Frequency notice, that only 5 and 15 minutes are
available. Keep defaults and click Next

Step 315: On Configure Additional Recovery Points notice that VSS snapshots are not
available. Select Create Additional hourly recovery points and click Next.

Step 316: On Choose Initial Replication Method keep defaults and click Finish.
Step 317: In Failover Cluster Manager connect to Cluster1 and notice that
MyReplicatedVM1 is also there.
Module 7, Lab1: Performance logs

Exercise 1. :Analyze performance logs

Task 1: Stop data collection

Step 1: On the physical Hyper-V host, press start, type perfmon and press Enter. Navigate to
“Hyper-V Workshop” collector set and right-click to stop data collection

Task 50: Open and analyze the blg file


Step 1: Open the collected .blg files in perfmon and follow your instructor’s guidance to review
collected data

Step 318: Answer the following questions:


 What is the average logical CPU utilization?
 What is the minimum free memory for the host?
 What are the average and maximum logical disk response times for read and write?
 Which VM has the highest average dynamic memory pressure?
 What is the average number of hypervisor context switches per second?

Bonus, Lab1: Cluster Aware Updating


(optional)
Introduction
In this lab, you will learn how to configure Cluster Aware updating on Cluster1.

Objectives
After completing this lab, you will be able to:

 Understand how to setup Cluster Aware Updating

Prerequisites
 Cluster1 needs to be running.

Estimated time to complete this lab


45 minutes

Scenario
In this Lab, you will setup CAU. It will enable you to install all available updates on Cluster1.
Exercise 1. :Prestage AD Object for HA
role
Task 1: Create Computer object in AD and configure ACLs.
Step 1: Open Server Manager in Management VM.
Step 319: In Server Manager open Active Directory Users and Computers from Tools menu
Step 320: Right click on Workshop OU under Corp.contoso.com and Click New ->
Computer
Step 321: In New Object wizard type Cluster1CAU into the Computer Name and click Next
twice.

Step 322: Click Finish to close the wizard.


Step 323: Enable Advanced Features from View menu in AD manager
Step 324: Right-click on Cluster1CAU computer object in Active Directory Users and
Computers manager and select Properties

Step 325: Click on Security Tab and click Add.


Step 326: In new window, click on Object types and select Computers. Click OK to close the
window.
Step 327: Type Cluster1 into the “Enter the object names to select” and click OK

Step 328: Select Cluster1 and click OK


Step 329: Click on Full Controll and click OK to confirm.
Exercise 10. : Configure CAU role to
enable self-updating
Task 1: Create HA CAU role.
Step 1: Open Server Manager, right click on Cl1Node1 in All Servers and select Update Cluster.
New windows with wizard will appear.

Step 330: In CAU wizard click on Analyze cluster updating readiness.


Step 331: In the new window wait for analysis to finish and notice that the Firewall needs
to be configured. Close the wizard.
Step 332: Run Configure cluster self-updating wizard. By clicking on “Configure cluster
self-updating options”
Step 333: On Getting Started page click Next
Step 334: On Add Clustered Role check both options and type Name of Computer object:
Cluster1CAU and click Next

Step 335: On Specify self-updating schedule click Next.


Step 336: You should receive the error

Step 337: Install required roles with PowerShell. Run the following command and run

Step 417:
Step 418: $ClusterName="Cluster1"
Step 419:
Step 420: #Install required features on nodes.
Step 421: $ClusterNodes=(Get-ClusterNode -Cluster $ClusterName).Name
Step 422: foreach ($ClusterNode in $ClusterNodes){
Step 423: Install-WindowsFeature -Name RSAT-Clustering-PowerShell
-ComputerName $ClusterNode
Step 424: }
Step 425:
wizard again
Step 338: The wizard will not throw an error anymore. Keep defaults and click Next.

Step 339: On Additional Options keep defaults and click Next.


Step 340: Click Apply to configure the role.
Step 341: After role is configured, click Close
Step 342: Run the Analyze cluster updating readiness wizard again, and notice that Firewall
was configured and results now passed. Click close to close the wizard. Keep CAU console
open for next Exercise.
Exercise 11. : Update Cluster1
Task 1: Preview updates
Step 1: In CAU tool verify that you are connected to Cluster1 and click on “Preview updates for
this cluster”. New windows will appear.
Step 343: Click on Generate Update Preview List to generate list of applicable updates. You
will receive following errror

Step 344: Clear dns client cache with Clear-DNSClientCache command in PowerShell and
try again

Note
If you still receive errors, check DNS records against real IP addresses on CL1Node1 and
CL2Node2

Expected result:
Task 51: Apply updates.
Step 1: In CAU tool verify that you are connected to Cluster1 and click on “Apply updates to
this cluster”. New wizard will appear.
Step 345: Click Next on Getting started page.
Step 346: In Advanced Options keep defaults and click Next
Step 347: In Additional Options keep defaults and click Next
Step 348: On Confirmation page click Update to update the cluster.
Bonus, Lab2: RDMA Networking
(Optional)
Introduction
In this lab, you will learn how to configure RoCE and iWARP RDMA networks.

Objectives
After completing this lab, you will be able to:

 Understand how to configure RoCE networking


 Understand how to configure iWARP networking

Prerequisites
 Cluster2 and Stretch-Clus needs to be running.

Estimated time to complete this lab


15

Scenario
Cluster2 and Stretch-Clus have just SETSwitches. You will add vRDMA adapters and configure
them. You will simulate deployment of 2 different types of RDMA – iWARP and RoCE.
Exercise 1. :Configure “iWARP” on
Cluster2
Task 1: Deploy networking with PowerShell
Step 1: Run the following PowerShell command in Management machine to configure
networking. PowerShell window has to be elevated.

#configure "iWARP" on Cluster2

$clusterName="Cluster2"

$Servers=(Get-ClusterNode -Cluster $ClusterName).Name

#IPs

$StorNet="172.16.1."

$StorVLAN=1 #VLAN for Live Migration

$IP=3 #start IP. 1,2 is already taken

$Servers | ForEach-Object {

Rename-VMNetworkAdapter -ManagementOS -Name SETSwitch -NewName Management


-ComputerName $_

Add-VMNetworkAdapter -ManagementOS -Name SMB_1 -SwitchName SETSwitch


-CimSession $_

Add-VMNetworkAdapter -ManagementOS -Name SMB_2 -SwitchName SETSwitch


-Cimsession $_

#configure IP Addresses

New-NetIPAddress -IPAddress ($StorNet+$IP.ToString()) -InterfaceAlias


"vEthernet (SMB_1)" -CimSession $_ -PrefixLength 24

$IP++

New-NetIPAddress -IPAddress ($StorNet+$IP.ToString()) -InterfaceAlias


"vEthernet (SMB_2)" -CimSession $_ -PrefixLength 24

$IP++

}
#Configure the host vNIC to use a Vlan. They can be on the same or different VLans 

Set-VMNetworkAdapterVlan -VMNetworkAdapterName SMB_1 -VlanId $StorVLAN -Access


-ManagementOS -CimSession $Servers

Set-VMNetworkAdapterVlan -VMNetworkAdapterName SMB_2 -VlanId $StorVLAN -Access


-ManagementOS -CimSession $Servers

#Restart each host vNIC adapter so that the Vlan is active.

Restart-NetAdapter "vEthernet (SMB_1)" -CimSession $Servers

Restart-NetAdapter "vEthernet (SMB_2)" -CimSession $Servers

#Enable RDMA on the host vNIC adapters

Enable-NetAdapterRDMA "vEthernet (SMB_1)","vEthernet (SMB_2)" -CimSession $Servers

#Associate each of the vNICs configured for RDMA to a physical adapter that is up and
is not virtual (to be sure that each vRDMA NIC is mapped to separate pRDMA NIC)

Invoke-Command -ComputerName $servers -ScriptBlock {

$physicaladapters=(get-vmswitch SETSwitch).NetAdapterInterfaceDescriptions | Sort-


Object

Set-VMNetworkAdapterTeamMapping –VMNetworkAdapterName "SMB_1" –ManagementOS –


PhysicalNetAdapterName (get-netadapter -InterfaceDescription
$physicaladapters[0]).name

Set-VMNetworkAdapterTeamMapping –VMNetworkAdapterName "SMB_2" –ManagementOS –


PhysicalNetAdapterName (get-netadapter -InterfaceDescription
$physicaladapters[1]).name

#verify mapping

Get-VMNetworkAdapterTeamMapping -CimSession $servers -ManagementOS | ft


ComputerName,NetAdapterName,ParentAdapter

#Verify that the VlanID is set

Get-VMNetworkAdapterVlan –ManagementOS -CimSession $servers |Sort-Object -Property


Computername | ft ComputerName,AccessVlanID,ParentAdapter -AutoSize -GroupBy
ComputerName

#verify RDMA

Get-NetAdapterRdma -CimSession $servers | Sort-Object -Property Systemname | ft


systemname,interfacedescription,name,enabled -AutoSize -GroupBy Systemname

#verify ip config
Get-NetIPAddress -CimSession $servers -InterfaceAlias vEthernet* -AddressFamily IPv4 |
Sort-Object -Property PSComputername | ft pscomputername,interfacealias,ipaddress
-AutoSize -GroupBy pscomputername

#enable iWARP firewall rule

Enable-NetFirewallRule -Name "FPSSMBD-iWARP-In-TCP" -CimSession $servers

Start-Sleep 10

#rename networks

(Get-ClusterNetwork -Cluster $clustername | where Address -eq $StorNet"0").Name="SMB"

(Get-ClusterNetwork -Cluster $clustername | where Address -eq


"10.0.0.0").Name="Management"

#configure Live Migration to use SMB and to use only SMB network

Get-ClusterResourceType -Cluster $clustername -Name "Virtual Machine" | Set-


ClusterParameter -Name MigrationExcludeNetworks -Value ([String]::Join(";",(Get-
ClusterNetwork -Cluster $clustername | Where-Object {$_.Name -ne "SMB"}).ID))

Set-VMHost –VirtualMachineMigrationPerformanceOption SMB -cimsession $servers

Exercise 12. : Configure “RoCE” on


Stretch-Clus
Task 1: Deploy networking with PowerShell
Step 1: Run the following PowerShell command in Management machine to configure
networking on Stretch-Clus. PowerShell window has to be elevated.

#configure "RoCE" on Stretch-Clus

$clusterName="Stretch-Clus"

$Servers=(Get-ClusterNode -Cluster $ClusterName).Name


#IPs

$StorNet="172.16.1."

$StorVLAN=1 #VLAN for Live Migration

$IP=11

$NanoServer=$true

if (!$NanoServer){

#install Hyper-V for core servers - in case you are deploying core servers
instead of Nano

foreach ($server in $servers) {Install-WindowsFeature -Name "Data-Center-


Bridging" -ComputerName $server}

$Servers | ForEach-Object {

Rename-VMNetworkAdapter -ManagementOS -Name SETSwitch -NewName Management


-ComputerName $_

Add-VMNetworkAdapter -ManagementOS -Name SMB_1 -SwitchName SETSwitch


-CimSession $_

Add-VMNetworkAdapter -ManagementOS -Name SMB_2 -SwitchName SETSwitch


-Cimsession $_

#configure IP Addresses

New-NetIPAddress -IPAddress ($StorNet+$IP.ToString()) -InterfaceAlias


"vEthernet (SMB_1)" -CimSession $_ -PrefixLength 24

$IP++

New-NetIPAddress -IPAddress ($StorNet+$IP.ToString()) -InterfaceAlias


"vEthernet (SMB_2)" -CimSession $_ -PrefixLength 24

$IP++

#Configure the host vNIC to use a Vlan. They can be on the same or different
VLans 

Set-VMNetworkAdapterVlan -VMNetworkAdapterName SMB_1 -VlanId $StorVLAN -Access


-ManagementOS -CimSession $Servers

Set-VMNetworkAdapterVlan -VMNetworkAdapterName SMB_2 -VlanId $StorVLAN -Access


-ManagementOS -CimSession $Servers
#Restart each host vNIC adapter so that the Vlan is active.

Restart-NetAdapter "vEthernet (SMB_1)" -CimSession $Servers

Restart-NetAdapter "vEthernet (SMB_2)" -CimSession $Servers

#Enable RDMA on the host vNIC adapters

Enable-NetAdapterRDMA "vEthernet (SMB_1)","vEthernet (SMB_2)" -CimSession $Servers

#Associate each of the vNICs configured for RDMA to a physical adapter that is up
and is not virtual (to be sure that each vRDMA NIC is mapped to separate pRDMA NIC)

Invoke-Command -ComputerName $servers -ScriptBlock {

$physicaladapters=(get-vmswitch SETSwitch).NetAdapterInterfaceDescriptions |
Sort-Object

Set-VMNetworkAdapterTeamMapping –VMNetworkAdapterName "SMB_1" –ManagementOS –


PhysicalNetAdapterName (get-netadapter -InterfaceDescription
$physicaladapters[0]).name

Set-VMNetworkAdapterTeamMapping –VMNetworkAdapterName "SMB_2" –ManagementOS –


PhysicalNetAdapterName (get-netadapter -InterfaceDescription
$physicaladapters[1]).name

#verify mapping

Get-VMNetworkAdapterTeamMapping -CimSession $servers -ManagementOS | ft


ComputerName,NetAdapterName,ParentAdapter

#Verify that the VlanID is set

Get-VMNetworkAdapterVlan –ManagementOS -CimSession $servers |Sort-Object -Property


Computername | ft ComputerName,AccessVlanID,ParentAdapter -AutoSize -GroupBy
ComputerName

#verify RDMA

Get-NetAdapterRdma -CimSession $servers | Sort-Object -Property Systemname | ft


systemname,interfacedescription,name,enabled -AutoSize -GroupBy Systemname

#verify ip config

Get-NetIPAddress -CimSession $servers -InterfaceAlias vEthernet* -AddressFamily


IPv4 | Sort-Object -Property PSComputername | ft
pscomputername,interfacealias,ipaddress -AutoSize -GroupBy pscomputername

##Configure QoS

New-NetQosPolicy "SMB" –NetDirectPortMatchCondition 445 –PriorityValue8021Action 3


-CimSession $servers
#Turn on Flow Control for SMB

Invoke-Command -ComputerName $servers -ScriptBlock {Enable-NetQosFlowControl –


Priority 3}

#Disable flow control for other traffic

Invoke-Command -ComputerName $servers -ScriptBlock {Disable-NetQosFlowControl –


Priority 0,1,2,4,5,6,7}

#validate flow control setting

Invoke-Command -ComputerName $servers -ScriptBlock { Get-NetQosFlowControl} |


Sort-Object -Property PSComputername | ft PSComputerName,Priority,Enabled -GroupBy
PSComputerName

#Apply policy to the target adapters. The target adapters are adapters connected
to vSwitch

### (unfortunately this is not possible to simulate inside VM and will throw
error) ###

Invoke-Command -ComputerName $servers -ScriptBlock {Enable-NetAdapterQos


-InterfaceDescription (Get-VMSwitch).NetAdapterInterfaceDescriptions}

#validate policy

Invoke-Command -ComputerName $servers -ScriptBlock {Get-NetAdapterQos | where


enabled -eq true} | Sort-Object PSComputerName

#Create a Traffic class and give SMB Direct 30% of the bandwidth minimum. The
name of the class will be "SMB"

Invoke-Command -ComputerName $servers -ScriptBlock {New-NetQosTrafficClass "SMB" –


Priority 3 –BandwidthPercentage 30 –Algorithm ETS}

#Configure networks in cluster

#rename networks

(Get-ClusterNetwork -Cluster $clustername | where Address -eq


$StorNet"0").Name="SMB"

(Get-ClusterNetwork -Cluster $clustername | where Address -eq


"10.0.0.0").Name="Management"

#configure Live Migration to use SMB and to use only SMB network
Get-ClusterResourceType -Cluster $clustername -Name "Virtual Machine" | Set-
ClusterParameter -Name MigrationExcludeNetworks -Value ([String]::Join(";",(Get-
ClusterNetwork -Cluster $clustername | Where-Object {$_.Name -ne "SMB"}).ID))

Set-VMHost –VirtualMachineMigrationPerformanceOption SMB -cimsession $servers

You might also like