Hardware for Node
- Step by Step for building a Server Hyper-V Cluster Lab to test Windows Server 2022
- A Server to act as an Active Directory Domain ( Required to create the cluster, all servers must be joined to a domain. )
- Server hardware for the cluster node.
- CPU: Ideally, two with the most amount of cores.
- All the Servers you use as Cluster nodes must have the same make of x64 CPU, capable of Virtualization (They do not need to be SLAT capable.)
- RAM: Add the maximum amount to each host cluster Server node.
- DISKS: For Host OS, use a min of 2 for Raid 1 or ideally 4 for Raid 10.
- Network cards per Server: 4 x 1GB, for the highest availability 8 using NIC Teaming per group.
Hardware for ISCSI Storage
- Server hardware for the ISCSI Storage.
- CPU: 64bit, ideally 2 x CPU
- RAM: Minimum of 4GB, the more the better.
- Disks: Use the Fastest possible disks, ideally PCIe or Sata SSD, for storage.
- Network cards per Server: 2 x 1GB (Using Windows Server 2022 NIC Teaming.)
Hardware Switches
Hardware Switches: Four switches as a minimum, for the highest failure availability eight.
Admin computer
Two or more NICs, OS: Windows Server 2022, CPU capable of Virtualization
(Does not need to be SLAT capable, only required for Windows 10 and 11)
Add the role Hyper-V and Windows ADK, Download and install.
Download Windows ADK
- Change computer name to Admin-Server
- Install Windows ADK
- Add Hyper-V role : Open Windows PowerShell session with elevated user rights.
- To do this, click the Windows Start button and type PowerShell. Right-click PowerShell and click Run as Administrator.
- Install-WindowsFeature -Name Hyper-V -ComputerName Admin-Server -IncludeManagementTools
- Start Hyper-V create 2 Virtual switches (Name: Internet -NIC connected to internet and Servers NIC connected to Server Switch.)
- Create a virtual machine using the above Windows Server 2022, ISO or VHD, with all your country settings, MS Updates.
- CMD prompt : cd C:\Windows\System32\Sysprep
- Sysprep.exe /generalize /oobe /shutdown /quiet
- Go to the VMs Folder Rename the virtual disk to W2022-Updated-Syspreped.vhd
- Copy the above, for use when needed for other Virtual Machines.
- Create a wim image for physical machines.
- Disk management : Action Tab : Attach VHD : Browse to the renamed virtual disk.
- Take a note of the drive letter. in my example it is H:\ change to yours in line 17.
- Create a folder name: C:\Wim
- In the search bar type, Deployment and imaging tools environment, highlight and right click run as administrator.
- Copy and Paste to CMD:
Dism /Capture-Image /ImageFile:C:\wim\W2022-Updates-Syspreped.wim /CaptureDir:H:\ /Name: ''Win Server 2022''
- Add the Role: Windows Deployment Server (More about click here.) ,configure to use WDS DHCP, then add boot image from Windows_Server_2022.ISO
- Upload the W2022-Updates-Syspreped.wim to WDS
- Set the Cluster Servers to network boot
Hyper V Cluster Domain Controller
Configure the Hyper-V Cluster Domain Controller
(If you do not want to use a Physical Server, create a Virtual Machine.)
- Setup the Hardware Raid 1 or 10
- Add the OS, Keep password the same for all Administrators in cluster.
- IP Static addresses, change computer name to DC1
- If you are using Windows Server 2022 Evaluation 180 Day trail. Connect to Internet, it will activate automatically.
- Add the static settings below, after adding the role AD DS, include the IP for the 2nd DC, which will a highly available virtual machine, which will be created later.
| Before adding AD |
After Adding AD |
| Un-tick IPv6 |
1st DNS 192.168.2.3 |
| IPv4 Settings |
2nd DNS 127.0.0.1 |
| 192.168.2.2 |
Advanced |
| 255.255.255.0 |
Wins Tab: Enable NetBIOS over TCP/IP |
| No gateway |
|
| 1st DNS 127.0.0.1 |
|
- Server Manager - Add Role - Active Directory - Domain Services - New
- Add Active Directory role Forest name corp.yourname.com NetBIOS name yourname
- Create new Admin User, add to Administrator, Enterprise Admin, Domain Admin and scheme Admin groups
- Rename Administrator to Yourname, Create a dummy administrator with a profile that looks like the administrator. Password = create a strong one.
- Create a group policy for and link to OU Server\OU Virtual Machines
- Computer Configuration\Policies\Administrative Templates\System\Power Management\Select an active power plan\enabled High Performance.
Configure the Hyper-V Cluster 1st Host
- Setup the Hardware Raid 1 or 10 for OS.
- Add OS, change name HVVM01, Server Manager - add roles Hyper-V and Cluster failover.
- Configure the 4 NICs and rename (Servers, Production, Migration and Heartbeat.)
- IP Static addresses. (Settings below are for the guide, use a different Network IP, if you prefer.)
| NIC: Servers. |
NIC: Production |
NIC: Migration |
NIC: Heartbeat |
| Un-tick IPv6. |
Un-tick IPv6. |
Un-tick IPv6. |
Un-tick IPv6. |
| IPv4 settings |
IPv4 settings |
IPv4 settings |
IPv4 settings |
| 192.168.2.10 |
192.168.3.3 |
192.168.4.2 |
192.168.22.2 |
| 255.255.255.0 |
255.255.255.0 |
255.255.255.0 |
255.255.255.0 |
| No gateway |
No gateway |
No gateway |
No gateway |
| 192.168.2.2 |
192.168.2.2 |
No DNS |
No DNS |
| 192.168.2.3 |
192.168.2.3 |
Advanced |
Advanced |
| Advanced |
Advanced |
DNS Tab: Untick register this connection in DNS. |
DNS Tab: Untick register this connection in DNS. |
| Wins Tab: |
Wins Tab: |
Wins Tab: |
Wins Tab: |
| Enable NetBIOS over TCP/IP |
Enable NetBIOS over TCP/IP |
Disable NetBIOS over TCP/IP |
Disable NetBIOS over TCP/IP |
- Open Hyper-V manager and create 2 external virtual switches Servers and Production, use the NICs with same name.
- Active Windows 2022 180 Day evaluation over internet.
- Join HVVM01 to the domain
Configure the Hyper-V Cluster 2nd Host.
- Setup the Hardware Raid 1 or 10 for OS.
- Add OS, change name HVVM02, Server manage - add roles Hyper-V and Cluster failover.
- Configure the 4 NICs and rename (Servers, Production, Migration and Heartbeat.)
- IP Static addresses.
| NIC: Servers. |
NIC: Production |
NIC: Migration |
NIC: Heartbeat |
| Un-tick IPv6 |
Un-tick IPv6 |
Un-tick IPv6 |
Un-tick IPv6 |
| IPv4 settings |
IPv4 settings |
IPv4 settings |
IPv4 settings |
| 192.168.2.11 |
192.168.3.7 |
192.168.4.3 |
192.168.22.3 |
| 255.255.255.0 |
255.255.255.0 |
255.255.255.0 |
255.255.255.0 |
| No gateway |
No gateway |
No gateway |
No gateway |
| 192.168.2.2 |
192.168.2.2 |
No DNS |
No DNS |
| 192.168.2.3 |
192.168.2.3 |
|
|
| Advanced |
Advanced |
Advanced |
Advanced |
| DNS Tab: keep default settings |
DNS Tab: keep default settings |
DNS Tab: Un-tick register this connection in DNS. |
DNS Tab: Un-tick register this connection in DNS. |
| Wins Tab: |
Wins Tab: |
Wins Tab: |
Wins Tab: |
| Enable NetBIOS over TCP/IP |
Enable NetBIOS over TCP/IP |
Disable NetBIOS over TCP/IP |
Disable NetBIOS over TCP/IP |
- Open Hyper-V manager and create 2 external virtual switches Servers and Production, use the NICs with same name.
- Active Windows 2022 180 Day evaluation over internet.
- Join HVVM02 to the domain
Configure the Storage Server.
- Add OS Hard disks Setup the Bios Hardware Raid 1 or 10.
- Add any PCIe or Sata SSD to use as storage for virtual Machines. Setup the Bios Hardware Raid 1 or 10.
- Add OS, change name HV Storage and add roles, File and Storage Services: Expand File and iSCSI Services.
- Tick boxes, ISCSI Target and ISCSI Target Storage provider VDS & VSS hardware providers.
- Configure the 1st NIC and rename Servers.
- IP Static addresses.
| NIC: Servers. |
NIC: |
| Un-tick IPv6. |
Un-tick IPv6. |
| IPv4 settings |
IPv4 settings |
| 192.168.2.12 |
Set by DHCP |
| 255.255.255.0 |
Leave all other settings as per default. |
| No gateway |
|
| 192.168.2.2 |
|
| 192.168.2.3 |
|
| Advanced |
|
| DNS Tab: keep default settings |
|
| Wins Tab: |
|
| Enable NetBIOS over TCP/IP |
|
- Activate Windows 2022 180 Day evaluation over internet.
- Join HVStorage to domain
- Setup Window NIC Teaming. Server Manager - Local Server - NIC Teaming - Name= Servers-Team - choose NIC's.
- Re add the IP Static address setting in step 5, to new Servers-Team LAN Connection.
- Create an ISCSI virtual Disk, Server Manager : File and Storage services : ISCSI : tasks : new ISCSI virtual disk wizard
- Choose the volume, to place the ISCSI virtual disk
- Specify ISCSI virtual disk name = Quorum
- Size = 512mb .VHDX (Fixed size recommended by Microsoft.)
- Assign ISCSI target : new ISCSI target : next
- Specify target name = Quorum
- Specify access servers : add IP address 192.168.2.10 and 192.168.2.11
- Start at 10 to 11 again, create a new virtual disk name = VMServers
- Size = 110GB .VHDX (Fixed size recommended by Microsoft.) If you are using Small size SSD disks set as expandable.
- Start at 10 to 11 again, create a new virtual disk name = VMworkstations
- Size = 400GB .VHDX (Fixed size recommended by Microsoft.) If you are using Small size SSD disks set as expandable.
Add the Virtual Disks to each of the Servers in the cluster.
HVVM01 : Server Manager Dashboard : tools : ISCSI initiator
- In Target box add 192.168.2.12
- Connect with the 3 targets. Also to add to Favourite Targets.
- Server Manager Dashboard: tools : computer management : disk management.
- Bring the Quorum disk online : initialize : Volume name Quorum : format.
- Bring the VMServers disk online : initialize : Volume name VMServers : format.
- Bring the VMworkstations disk online : initialize : Volume name VMworkstations : format.
HVVM02 - Server Manager Dashboard : tools : ISCSI initiator
- In Target box add 192.168.2.12
- Connect with the 3 targets. Also to add to Favourite Targets.
- Server Manager Dashboard : tools : computer management : disk management.
- Bring the Quorum disk online : initialize
- Bring the VMServers disk online : initialize
- Bring the VMworkstations disk online : initialize
Create Cluster.
- On the HVVM01 : Server Manager : tools : Failover Cluster Manager : open.
- In the Failover Cluster Manager, in the centre pane, click Create Cluster under Management pane.
- On the first Before You Begin page, click Next.
- On the Select Server page, type HVVM01, HVVM02 in Enter server name box and click Add. Verify that servers are in selected servers list and click Next.
- On the Access Point for Administering the Cluster page, in the Cluster name box, type corpvmcluster
- Un-tick any other subnets, use the 192.168.2.0 subnet.
- Under Address, in the IP address name box, type 192.168.2.13 and then click Next.
- On the Confirmation page, verify the information and click Next.
- After this confirmation, Creating New Cluster process begins.
- On the Summary page, verify that, you have successfully completed the Create Cluster Wizard, click View Report for more details.
- On the Summary page, click Finish.
Configuring Cluster Settings.
- Open Failover Cluster Manager, expand corpvmcluster.
- Expand Networks and then rename the Cluster Networks.
By default it is named as Cluster Network 1, Cluster Network 2, and Cluster Network 3 and so on.
- Right click the Heartbeat: properties: un-tick, Allow clients to connect through this network.
- Right click the Production: properties: tick all except, do not allow cluster network commutation on this network.
- Right click the Servers - properties: tick all except, Do not allow cluster network commutation on this network.
- Right click the Migration - properties: un-tick, Allow clients to connect through this network.
Configure Witness Disk.
- In the left pane, right-click the cluster name corpvmcluster, select More Actions, and then select Configure Cluster Quorum Settings.
- Click Next on the Before You Begin screen.
- Select Use typical settings (recommended) on the Select Quorum Configuration Option screen and click Next afterwards.
- If cluster disk 1, name = Quorum is selected except. (If not go back and choose 2nd option.)
- Note disk number might be different in your configuration, check the size of disk selected.
- Click next on the Confirmation screen.
- Click Finish on the Summary screen.
Enable Cluster Shared Volumes.
- Failover Cluster Manager: Cluster name: Expand Storage and select Disks.
- Right click on Cluster disk 1: properties: change name to Quorum Disk 1
- Right-click on Cluster disks 2 select Add to Cluster Shared Volumes and verifies that Cluster Disk2 has changed to Cluster Shared Volume. Right click again : properties - and change name to VMServers Disk 2
- Right-click on Cluster Disk 3 and select Add to Cluster Shared Volumes and verifies that Cluster Disk3 has changed to Cluster Shared Volume. Right click again : properties - and change name to VMworkstations Disk 3
- On one of the Cluster Server Nodes, Create folders: C:\ClusterStorage\volume1 (Create folders Base and Servers.)
- Do the same in C:\ClusterStorage\volume2 (Create folders Base and Workstations.)
- Add the Server2022EVAL.vhd and the .ISO file to C:\ClusterStorage\volume1\Base
Create highly available virtual machines.
- If you have already a Server VM, add it to the cluster, shut it down first, and go to its settings : change Processor : expand Compatibility : Tick the box : then export it to a network share or USB Hard disk.
- Copy the VM to the HVVM01, C:\ClusterStorage\Volume2\Servers
(Note: Volume number may be different in your configuration.)
- Open Hyper-V, import VM, browser to C:\ClusterStorage\Volume2\Servers\vmname
- Open Failover Cluster Manager : expand : corpvmcluster : right click roles : configure role : next : scroll to Virtual Machine.
- Next : select virtual machine from list : next :
- To create a Virtual Machine using the Failover Cluster Manager.
- Start the Failover Cluster Manager.
- Right click the cluster name in the left pane. Expand : Right click : Roles : Virtual Machines
- Select New Virtual Machine : choose a node to install the virtual machine. Click OK.
- Click Next on the Before You Begin screen.
- On the Specify Name and Location screen, Name = Yourname : select the Store the virtual machine in a different location option. C:\ClusterStorage\Volume1\Servers : Click Next.
- On the Specify Memory screen : change default 512 to 1024 : Tick enable Dynamic Memory. Then, click Next.
- On the Configure Networking screen, select the external switch Servers, and click Next.
- Click next on the Connect Virtual Hard Disk screen, Choose Attach a virtual hard disk later : Finish.
- Right click the virtual machine Yourname : Settings : IDE Controller 0 : Hard Drive : add : new.
- Choose disk format -VHD : next : Choose Differencing : next : Specify Name and location : Yourname.vhd : location : Browse : C:\ClusterStorage\Volume1\Servers\ : Select folder
- Browse to location C:\ClusterStorage\Volume1\Base\W2022-Updated-Syspreped.vhd : Apply.
- Stay in settings : Click on Memory : change maximum ram to 2048mb (more depending on workload.) if you have Ram to spare.
- Click on Processor : expand : Compatibility : Tick Migrate to a physical computer with a different processor version.
- Start and configure the VM with AD DC role, Make a 2nd DC in existing Forest. Name as DC2 and IP Settings as below.
| Before adding 2nd DC |
After Adding 2nd DC |
| Un-tick IPv6 |
1st DNS 192.168.2.2 |
| IPv4 Settings |
2nd DNS 127.0.0.1 |
| 192.168.2.3 |
Advanced |
| 255.255.255.0 |
Wins Tab: Enable NetBIOS over TCP/IP |
| No gateway |
|
| 1st DNS 127.0.0.1 |
|
Spreading the Load between Server Nodes.
Warning: If all the Domain Controllers in your LAB, are VMs : Open Failover Cluster Manager : right click VM : settings : Automatic Start Action : Automatically start if it was running when the service stopped.
Why? The Cluster needs to have at least 1 DC online, if all the DC VMs are shut down manually.
The Cluster will fail and you will not be able to access the Virtual Machines in the cluster to restart them.
- All the Server Nodes, in the cluster should ideally, be able to host all the virtual machines, if all other Nodes fail.
- Change the Priority setting on VMs that need to be always on, to High. Default is Medium.
- Test each node, by moving all the VMs to each one of the Server Nodes at a time.
- In the Failover Cluster Manager : right click the VM : move : live Migration : Select node : choose the server node to test.
- Do this for all the Virtual Machines.
- Connect to the test Server and open Task Manager, to check the loading on the RAM.
- Move the Virtual Machines, using live Migration to spread the load evenly on each of the Server nodes.
- Failover Cluster Manager : click on one of the VMs to highlight : middle of menu : Preferred owners : choose Node : Failover tab : tick allow failback : Immediately.
Testing Failover.
- Check each Server node : Server Manager : tools : iSCSI Initiator : check that all targets are connected : connect if not.
- Shut down one of the nodes, the virtual machines on this node, should now live migrate to the other available nodes.
- Restart and check that the VMs, have returned back to this Server node.
- Server Manager : tools : iSCSI Initiator : check that all targets are connected : re-connect if not.
Adding more switches for hardware failover.
If you have the extra switches, do this from the beginning. If you have please, do the following.
- If you have 4 spare switches, NICs and lan cables
- On each Server node, add the extra NICs and connect the cables to the extra switches.
- Label each switch (i.e. Servers, Production, Heartbeat and Migration.)
- Rename each NIC (i.e. Servers01, Production01, Heartbeat01 and Migration01.)
- Create NIC Teams : Server Manager : Local Server : NIC Teaming : Teams- Tasks : New Team : name : choose the servers and server01 : Ok.
- Re-add the IP Addresses (Search bar or run : type : ncpa.cpl) for Servers, Production, Heartbeat and Migration.
- On each Server Node : Open Hyper-V : create the extra virtual switches : name (i.e. Servers01) : choose nic : apply.
- Shutdown Virtual Machine : right click : settings : add hardware : network adapter : Server01 : apply.
- Restart Virtual Machine : Search bar or run : type : ncpa.cpl : rename the new virtual nic : Server01
- Server Manager : local server : create NIC Teams. ( i.e. Server VM connected to 192.168.2.0)
- Re-add IP Addresses.