Capstone

Date
Project TypeTechnology Support Professional (TSP)
ByAidan Waugh

Overview

Deliverables

From the laptop host Thinkpad complete the following:

Tables & Diagrams

Network Diagram

Network & IP Information

Networks

NameNetworkPurposeSubnetHost IP RangeSwitch Type
WAN192.168.1.0 /24Home NetworkExternal
LAN192.168.3.0 /28LAN255.255.255.240 (/28)192.168.3.1 - 192.168.3.14Internal
iSCSI192.168.10.0 /29iSCSI SAN255.255.255.248 (/29)192.168.10.1 - 192.168.10.6Private
HB192.168.20.0 /29Heartbeat255.255.255.248 (/29)192.168.20.1 - 192.168.20.6Private
LM192.168.30.0 /30Live Migration255.255.255.252 (/30)192.168.30.1 - 192.168.30.2Private

IP Addresses & Info

NameIPRAMNotes
DC1192.168.3.1 /28512
DC2192.168.3.2 /28512
LinDHCP192.168.3.3 /28512
SAN192.168.10.3 /29192.168.3.4 /28512
HV1192.168.10.1 /29192.168.20.1192.168.3.5 /28192.168.30.14096\\192.168.3.5\d$ (before CSV) \\192.168.3.5\c$\ClusterStorage\Volume1\
HV2192.168.10.2 /29192.168.20.2192.168.3.6 /28192.168.30.24096\\192.168.3.6\d$ (before CSV) \\192.168.3.6\c$\ClusterStorage\Volume1\
HV-Cluster192.168.3.7 /28
FILE1192.168.20.3192.168.3.8 /28512
FILE2192.168.20.4192.168.3.9 /28512
FS-Cluster192.168.3.10 /28
FS192.168.3.11 /28\\fs\Company_Data$ \\fs\HomeDir$
Thinkpad (Host)192.168.1.74 /24192.168.3.13 /2816 GB (Host)
pfSense192.168.1.10 /24192.168.3.14 /28512

cap.int Domain ADDS Diagram

Server File & Storage Diagram

1.0 Setup

The host Thinkpad is a Type I Hypervisor with 16GB RAM. Download all operating system files for the virtual machines (Windows Server 2019, pfSense, CentOS 8) and sysprep Windows Server 2019 Core to save time and hard disk space. Create the network switches to allow for a local area network (LAN), iSCSI, heartbeat (HB) for file servers, and live migration (LM) of virtual machines.

1.0 Download ISO Files

1.2 Sysprep Windows Server 2019 - Core

  1. In Hyper-V create a new VM named “ParentServer2019-Core” with 4096 MB of memory
  1. Turn off the VM’s automatic checkpoints
  1. Connect and start the VM
  1. Install Windows Server Datacenter (without Desktop Experience) then reboot
  1. Set a admin password
  1. Enter PS by typing powershell
  1. From PowerShell open the System Preparation Tool (Sysprep) with:
    cd C:\Windows\System32\Sysprep\
    ls
    .\sysprep.exe
  1. Set SysPrep to the following:
    • System Cleanup Action: Enter System Audit Mode
    • Generalize: unchecked
    • Shut down options: Reboot
  1. Install all updates by entering sconfig > type6 To Download an Install Updates
  1. Reboot the VM
  1. Set SysPrep to the following:
    • System Cleanup Action: Enter System Out-of-Box Experience (OOBE)
    • Generalize: Checked
    • Shut down options: Shutdown
  1. Delete the ParentServer2019-Core VM from Hyper-V and make the vhdx file read only
  1. Create a VM on the host with the differencing disk by either:
    • Option 1: In Hyper-V, create a new differencing hard disk > create a new VM and attach the child vhdx
    • Option 2: Use the following script:
      #
      # Create a VM with Windows Server 2019 (Core) with 2GB Static Memory on a Differencing Disk
      # Connect to the LAN switch
      # Disable automatic checkpoints & enable VM Guest Services
      #
      $VMName = Read-Host -Prompt 'Input the VM name'
      $parentpath = "V:\VMs\VHDX\ParentServer2019-Core.vhdx"
      $VHDPath = "V:\VMs\VHDX\" + $VMName + ".vhdx"
      
      # Create VM with a differencing disk, update settings ,and start vm
      New-VHD -ParentPath $parentpath -Path $VHDPath -Differencing
      New-VM -Name $VMName -MemoryStartupBytes 2GB -VHDPath $VHDPath -Generation 2 -SwitchName LAN
      Set-VM $VMName -AutomaticCheckpointsEnabled $false
      Set-VMMemory $VMName -DynamicMemoryEnabled $false
      Enable-VMIntegrationService -VMName $VMName -Name "Guest Service Interface"
      Start-VM -Name $VMName
      VMConnect.exe

1.3 Create Virtual Switches in Hyper-V

  1. From the host’s (Thinkpad laptop) Hyper-V Manager > click Virtual Switch Manager...
  1. Click new virtual network switch > and create the following:
    Switch NameSwitch TypeNotes
    WANExternal
    LANInternal192.168.3.0 /28 → 14 hosts, 16 IPs 192.168.3.1 - 192.168.3.14
    iSCSIPrivateiSCSI SAN: 192.168.10.0 /29 → 6 hosts, 8 IPs 192.168.10.1 - 192.168.10.6
    HBPrivateFS cluster heartbeat 192.168.20.0 /29 → 6 hosts, 8 IPs 192.168.20.1 - 192.168.20.6
    LMPrivateLive Migration192.168.30.0 /30 → 2 hosts, 4 IPs 192.168.30.1 - 192.168.30.2
  1. (Optional) Go to the host’s Network Connections > view the adapter properties
    The host’s adapter became a Hyper-V Extensible virtual switch and the previous settings migrated to vEthernet WAN upon the external virtual switch creation
  1. (Optional) on the host, enter ipconfig /all

1.4 Set IP Addressing Values on Home Router (Optional)

  1. From a web browser on the host machine go to 192.168.1.254 and login
  1. Set a IP addressing range for DHCP and make note of the excluded range

2.0 pfSense NAT & Firewall

Create a OpenBSD NAT/Firewall Router with pfSense on the WAN network. The network LAN has double NAT as the physical home router is the first. Create firewall rules to block HV1, HV2, SAN and DC2 from accessing the internet.

2.1 Create the VM and Install pfSense

  1. Create a VM named “pfSense” with the following:
    • Name: “pfSense”
    • Generation: Generation 2
    • Memory: 2048 MB Dynamic (this will be set to 512 MB Static after configuration is complete)
    • Network: WAN
    • Hard Disk: 40GB Dynamic Expanding
    • Operating System: pfSense.iso
  1. Right click the pfSense VM > select Settings... > Edit the following:
    • Security: Uncheck Enable Secure Boot
    • Checkpoints: Uncheck Use Automatic Checkpoints
    • Click Add Hardware > Network Adapter > Virtual Switch: select LAN
  1. In Hyper-V right-click on the pfSense VM > Connect... > click Start
    • Use the arrow keys to navigate, SPACE to toggle and ENTER to select
  1. Complete the installation with the following:
    • Copyright and Trademark Notice > Accept
    • Welcome to pfSense: Select Install > Install pfSense > OK
    • Keymap Selection: Leave the default option Continue with default keymap as is> Select
    • Partitioning: Leave the default Auto (ZFS) Guided Root-on-ZFS selected > OK
    • Configure options: Install Proceed with Installation > Select
    • Select Virtual Device Type: Select Stripe - No Redundancy > OK
    • ZFS Configuration: Press the Space Bar to select the Msft Virtual Disk > OK
    • Select YES when asked to destroy the da0 disk
    • The distribution files will extract and install
  1. When asked to make any final manual modifications when the installation is finished, select YES
  1. From the shell type poweroff
    poweroff stops the VM from rebooting off the iso file in a continuous loop
  1. Open the Hyper-V settings for pfSense
  1. Click Firmware > Select the Hard Drive pfSense.vhdx and move up to become first in the boot order
  1. Click SCSI Controller > DVD Drive > Remove the pfsense.iso file
  1. Expand the WAN Network Adapter > Click Advanced Features > View the MAC Address
  1. Expand the LAN Network Adapter > Click Advanced Features > View the MAC Address

2.2 Configure WAN and LAN Interfaces on pfSense

  1. Start the pfSense VM
  1. View the valid interfaces hn0 and hn1 and notice the last hexadecimal digit (hn0 = 03 → WAN network adapter)
  1. Configure the interface’s for WAN hn0 and LAN hn1 with the following:
    • Do VLANS need to be setup now? > n
    • Enter the WAN interface name > hn0
    • Enter the LAN interface name > hn1
    • Do you want to proceed? > y to write configuration
  1. Set the LAN interface IP to 192.168.3.14 /28 by selecting option 2 and entering the following:
    • Enter the number of the interface you wish to configure > 2
    • Enter the new LAN IPv4 address > 192.168.3.14
    • Enter the new LAN IPv4 subnet bit count > 28
    • For a WAN, enter the new LAN IPv4 upstream gateway address > press ENTER for none
    • Enter the new LAN IPv6 address > press ENTER for none
    • Do you want to enable the DHCP server on LAN? > y
    • Do you want to revert to HTTP as the webConfigurator protocol? > y
  1. (Optional) Set the WAN interface IP to 192.168.1.10 /24 by selecting option 2 and entering the following:
    • Enter the number of the interface you wish to configure > 1
    • Enter the new LAN IPv4 address > 192.168.1.10
    • Enter the new LAN IPv4 subnet bit count > 24
    • For a WAN, enter the new LAN IPv4 upstream gateway address > 192.168.1.254
    • Enter the new LAN IPv6 address > press ENTER for none

2.3 Test Networking

  1. On the Thinkpad host, go to the vEthernet (LAN) network adapter > Properties > IPv4
  1. Set a static IP of 192.168.3.13 with a subnet mask 255.255.255.240
  1. From pfSense, selecting option 7 to ping the following hosts:
    • google.ca
    • Thinkpad Host WAN192.168.1.74 & LAN 192.168.3.13
      WAN
      LAN
  1. From Host Thinkpad , ping 192.168.3.14 the LAN interface on pfSense

2.4 Mange pfSense from the web GUI

  1. From the host Thinkpad, go to a web browser and enter 192.168.3.14 in the address bar
  1. Enter the default pfSense credentials to login
    • Username: admin
    • Password: pfsense
  1. Complete the 9 steps in the Wizard / pfSense Setup
    • Step 1 - Netgate Global support: > Click Next
    • Step 2 - General Information: Leave the hostname, domain, and DNS settings as is > Next
    • Step 3 - Time Server Information: Select timezone US/Pacific > Next
    • Step 4 - Configure WAN Interface: Leave DHCP Selected Type as Static > Next
    • Step 5 - Configure LAN interface: Leave the LAN IP address and subnet mask as 192.168.3.14 /28 > Next
    • Step 6 - Set Admin webGUI Password: EnterPa$$w0rd as the new admin password > Next
    • Step 7 - Reload Configuration: Click Reload
    • Step 8 - Reload in progress: Wait for the reload to finish
    • Step 9 - Wizard completed: Click Check for Updates
  1. View the pfSense dashboard

2.5 Configure Firewall Rules

  1. From the pfSense Web GUI go to the Firewall tab > click Aliases
  1. Click New to make a alias for both nested Hyper-V Servers
    • Name: ‘HV’
    • Type: Select Hosts
    • IP: 192.168.3.5 and 192.168.3.6
    • Click Save
  1. Repeat for SAN 192.168.3.4 & DC2 192.168.3.2
  1. Go to Firewall > Rules > click LAN
  1. Click Add to create a new firewall rule to block the alias HV from reaching the internet with the following:
    • Action: Select Block
    • Protocol: Select Any
    • Address Family: IPv4+IPv6
    • Source: Select Single host or alias > HV
    • Destination: Select Any
    • Click Save
  1. Repeat for Alias SAN and DC2
    End result when VMs are created and the firewall rules are enabled
  1. Disable all of the firewall rules while the network infrastructure is being created
  1. In Hyper-V, set the RAM for pfSense to 512 MB Static
  1. ⏲ Take a checkpoint of pfSense named “FW configuration complete”

3.0 Domain Controller

In Windows Server 2019 core, create a DC and a domain named “cap.int” with all the data stored on a secondary disk. Make a domain administrator account aidan@cap.int which will be used for the rest of the project.

3.1 Create VM DC1

  1. On the host Thinkpad and open PowerShell as an administrator and run the script below to create a VM with the following properties:
    • Name: DC1
    • Generation: Generation 2
    • Memory: 2048 MB Static (this will be set to 512 MB Static after configuration is complete)
    • Network: LAN
    • Hard Disk: Differencing disk to ParentServer2019-Core.vhdx
    • Operating System: Windows Server 2019 (Core)
    • Automatic Checkpoints: Disabled
    • VM Guest Services: Enabled
    #
    # Create a VM with Windows Server 2019 (Core) with 2GB Static Memory on a Differencing Disk
    # Connect to the LAN switch
    # Disable automatic checkpoints & enable VM Guest Services
    #
    $VMName = Read-Host -Prompt 'Input the VM name'
    $parentpath = "V:\VMs\VHDX\ParentServer2019-Core.vhdx"
    $VHDPath = "V:\VMs\VHDX\" + $VMName + ".vhdx"
    
    # Create VM with a differencing disk, update settings ,and start vm
    New-VHD -ParentPath $parentpath -Path $VHDPath -Differencing
    New-VM -Name $VMName -MemoryStartupBytes 2GB -VHDPath $VHDPath -Generation 2 -SwitchName LAN
    Set-VM $VMName -AutomaticCheckpointsEnabled $false
    Set-VMMemory $VMName -DynamicMemoryEnabled $false
    Enable-VMIntegrationService -VMName $VMName -Name "Guest Service Interface"
    Start-VM -Name $VMName
    VMConnect.exe
  1. Enter Pa$$w0rd as the new credentials for Administrator

3.2 Server Configuration with sconfig

  1. On DC1 open Server Configuration by enteringsconfig
  1. Select 8to edit Network Settings
  1. Select option 1 to Set Network Adapter Address
    • Select: s for Static IP
    • Enter Static IP address: 192.168.3.1
    • Enter Subnet Mask: 255.255.255.240
    • Enter Default Gateway: 192.168.1.14
  1. From the Network Adapter Settings options, select option 2 to set DNS Servers > enter new preferred DNS server: 8.8.8.8
  1. From the Server Configuration options, select option 15 to Exit to Command Line
  1. Typepowershell
  1. Test network connectivity with:
    • ping google.ca
    • ping 192.168.3.14 (pfSense)
    • ping 192.168.3.13 (Thinkpad Host)
    • tracert google.ca
  1. Return to Server Configuration with sconfig
  1. Download and install updates by selecting option 6
    • Search for all updates with A
    • Install all updates with A
  1. From Server Configuration, select option 11 for Windows Activation
    • Select 2 to Activate Windows
    • Select 1 to Display License Info
    Server Trial gives 180 days
  1. From Server Configuration, select option 2 to change the computer name to “DC1”
  1. Restart the server with option 13 to apply the name change

3.3 Configuration with PowerShell

  1. Enter PowerShell on DC1 with powershell
  1. Rename the local user account Administrator to “_sysadmin” with the following:
    Get-LocalUser
    Rename-LocalUser -Name "Administrator" -NewName "_sysadmin"
    #View changes
    Get-LocalUser
  1. Log off as user Administrator with sconfig > Select option 12
  1. Log into DC1 with the user _sysadmin
  1. Open powershell
  1. Rename the network adapter from Ethernet to “LAN” with the following:
    Get-NetAdapter
    Rename-NetAdapter -Name "Ethernet" -NewName "LAN"
    Get-NetAdapter
    
    #To view additional properties of the adapter (can omit -Name or -Property) 
    Get-NetAdapter -Name "LAN" | Format-List -Property *
    For VM’s that have multiple adapters, view the MAC Address in Hyper-V and reference the -Name or -ifIndex
  1. In Hyper-V, create and attach a 10 GB Dynamically expanding VHDX named DC1db to DC1
  1. From powershell on DC1 initialize, partition, and format the volume with the following:
    Get-Disk
    Initialize-Disk -Number 1
    New-Partition -DiskNumber 1 -UseMaximumSize
    Get-Partition -DiskNumber 1
    Get-Partition -DiskNumber 1 -PartitionNumber 2 | Format-Volume -FileSystem NTFS
    Get-Partition -DiskNumber 1 -PartitionNumber 2 | Set-Partition -NewDriveLetter D
  1. Create directories ‘SYSVOL’ and ‘NTDS’ in the new volume D:\ with md SYSVOL & md NTDS
  1. ⏲ Checkpoint DC1 & name it “Before AD Role”

3.3 Add AD DS Role

  1. From PowerShell DC1, install the Active Directory Domain Services role with the following:
    #Install ADDS and Group Policy Management Console (GPMC)
    Install-WindowsFeature -Name AD-Domain-Services,GPMC -IncludeManagementTools -Verbose
    
    #Make sure that the AD-Domain-Services role is installed
    Get-WindowsFeature -Name *AD*
    
    #use ADDSDeployment module cmdlets to deploy a new domain
    Get-Command -Module ADDSDeployment
  1. ⏲ Checkpoint DC1 with the name “Before new domain”
  1. From PowerShell create a new forest root domain cap.int with the following:
    # 
    # Windows PowerShell script for AD DS Deployment
    # Install-ADDSForest: Installs a new forest root domain
    #
    
    Import-Module ADDSDeployment
    Install-ADDSForest `
    -DatabasePath "D:\NTDS" `
    -DomainMode "WinThreshold" `
    -DomainName "cap.int" `
    -DomainNetbiosName "cap" `
    -ForestMode "WinThreshold" `
    -InstallDns:$true `
    -LogPath "D:\NTDS" `
    -NoRebootOnCompletion:$false `
    -SysvolPath "D:\SYSVOL" `
    -Force:$true
    
    #Enter Pa$$w0rd as the SafeModeAdministrator password
  1. Reboot the DC1 server (may take up to 10 minutes on first reboot) and login with userPrincipleName (UPN) _sysadmin@cap.int or cap\_sysadmin
    • ❗ To change the user, have the VM connection in ‘Basic Session’ and hit the ESC key twice
  1. (Optional) Verify the successful installation of the services in PowerShell
    # List the status of the AD related services on DC
    Get-Service adws,kdc,netlogon,dns
    
    # List configuration details of the DC
    Get-ADDomainController
    
    # List details of Active Directory Domain
    Get-ADDomain cap.int
    
    # List Active Directory Forest details
    Get-ADForest cap.int
  1. ⏲ Checkpoint DC1 and name it “Before Aidan Admin Creation”

3.4 Create Domain Administrator aidan@cap.int

  1. In PowerShell, create a new User named “Aidan” & copy the properties of _sysadmin
    Import-Module ActiveDirectory
    
    #Create new Active Directory User
    New-ADUser `
    -Name "Aidan" `
    -GivenName "Aidan" `
    -Surname "Waugh" `
    -SamAccountName "Aidan" `
    -UserPrincipalName "Aidan@cap.int" `
    -AccountPassword (ConvertTo-SecureString "Password123" -AsPlainText -Force) `
    -ChangePasswordAtLogon $true `
    -Enabled $true
    
    #View User Details (Optional)
    Get-ADUser -Identity Aidan -Properties *
    
    #Copy _Sysadmin's property "Member of"
    $getusergroups = Get-ADUser –Identity _sysadmin -Properties memberof | Select-Object -ExpandProperty memberof
    
    #Assign Aidan to be a member of the same groups > become a domain admin
    $getusergroups | Add-ADGroupMember -Members Aidan -verbose
    
    #Verify
    Get-ADUser -Identity Aidan -Properties memberof | Select-Object -ExpandProperty memberof
  1. Login to DC1 with the aidan@cap.int account
  1. ⏲ In Hyper-V, delete the checkpoint subtree on DC1
  1. ⏲ Checkpoint DC1 and name it “Before Thinkpad joins domain”

4.0 Add Host Thinkpad to the Domain

Join the host Thinkpad to the cap.int domain. As all Windows Servers are core, accessing Server Core from a domain joined machine will allow configuration with a graphical user interface. If enough memory is on the host machine, create a Windows 10 VM insead.

4.1 Join Thinkpad to the cap.int Domain

  1. Set the LAN vEthernet adapter DNS settings to 192.168.3.1
  1. Verify that DC1 can be found
  1. On Thinkpad right-click the Windows Icon > System and view the About Page
  1. Click Rename this PC (advanced) > click Change...
  1. In the popup Computer Name/Domain Changes complete the following:
    • Domain: cap.int
    • Credentials: aidan@cap.int
  1. Restart Thinkpad
    • ❗ Note - as Thinkpad is a Type 1 Hypervisor, any VM’s that are running will restart when the host does. And can be accessed from any account thinkpad\aidan or cap\aidan
  1. Log into the local user account thinkpad\aidan
  1. Reboot & log into thinkpad\aidan
  1. View the computer name from Settings > About and notice that the full device name is now thinkpad.cap.int
  1. Switch user and log into cap\aidan. If using RDP to access Thinkpad, enter cap\aidan as the new credentials.
    • View the networking - the IP’s are the same
    • Open Hyper-V and notice that the VMs are present
    • ❗ The rest of the project should be completed on Thinkpad logged in as the domain administrator cap\aidan. Errors will occur if working from the local computer account even when the domain credentials are used.

4.2 Access DC1 from Server Manager on Thinkpad

  1. On Thinkpad search for “Optional Features” > click Add a feature > Install the following Remote Server Administration Tools (RSAT) tools:
  1. Open Server Manager
  1. In the toolbar click Manage > Add Servers
  1. Select the DNS tab > search for dc1 & select > click OK to add
    Logged in as cap\aidan
    If using the local thinkpad\aidan account, servers can not be found with the Active Directory tab
  1. If using the local thinkpad\aidan account (not recommended), right click server DC1 > select Manage as... > Enter domain admin credentials aidan@cap.int
    “Manage as...” removes the Kerberos error. This does not occur from cap\aidan

5.0 Configure DNS on DC1

The forward lookup zone is setup automatically and sets the forwarders during the domain creation from -InstallDns:$true however, the reverse lookup zone needs to be created and configured.

5.1 Forward and Reverse Lookup Zones

  1. In Server Manager’s left panel, click on DNS
  1. Right click DC1 > Select DNS Manager
  1. From DNS Manager, right click DC1.cap.int > Properties > Open the Forwarders tab
    The previous DNS address 8.8.8.8 is now set as the forwarder & the DC1 Interface DNS points to itself. This was all done automatically during the DNS installation with -InstallDns:$true
  1. Navigate to Forward Lookup Zones and click on cap.int to view the existing entries
    The Forward Lookup Zone does not need to be configured
  1. Right click the directory Reverse Lookup Zones > select New Zone.. to open the Wizard
  1. Complete the New Zone Wizard with the following:
    • Zone Type: Primary Zone
    • Active Directory Zone Replication Scope: To all DNS servers running on domain controllers in this domain: proj.int (2nd option)
    • Reverse Lookup Zone Name: IPv4 Reverse Lookup Zone
    • Network ID: 192.168.3
    • Dynamic Update: Allow only secure dynamic updates (1st option which is recommended for Active Directory)
  1. ⏲ Checkpoint DC1 and name it “DNS complete”

6.0 Create an OU Structure and Create Users in ADUC

Create Organization Units (OU) to organize the location of domain users, admins, and servers. Not only does this organize the domain into logical groupings of objects, it allows for granularity when applying Group Policies in the future.

6.1 Organize Active Directory Users and Computers

  1. From Server Manager, right click DC1 > select Active Directory User and Computers
  1. Click on cap.int and view the existing organizational units (OU)
    • DC1 → Domain Controllers
    • Thinkpad (computer) → Computers
    • Aidan (user) → Users
    Default ADUC, notice the OU Structure and location accounts and servers
  1. Create OUs to match the following organizational diagram.
    • Move the Thinkpad computer object from Computers to Win10
    • Move user Aidan from Users to Domain_Users - any GPO’s applied to the domain users will not affect the administrator.
    Domain administrator account
  1. (Optional) View the distinguished name (the OU path required for PowerShell)
    ADSI Edit tool (Active Directory Service Interface Editor) - Right click DC1 in Server Manager > select ASDI Edit
  1. Create 4 users in ADUC or with PowerShell
    #
    #PowerShell commands for basic user creation
    #
    Import-Module ActiveDirectory
    New-ADUser `
    -Name "Amy Li" `
    -GivenName "Amy" `
    -Surname "Li" `
    -SamAccountName "Amy.Li" `
    -UserPrincipalName "amy.li@cap.int" `
    -Path "OU=FIN_Accountants,OU=FIN,OU=Domain_Users,DC=cap,DC=int" `
    -AccountPassword (ConvertTo-SecureString "Password123" -AsPlainText -Force) `
    -ChangePasswordAtLogon $true `
    -Enabled $true
  1. ⏲ Checkpoint DC1 and name it “Before LinDHCP”
  1. Shut down DC1 and set the memory to 512 MB static
  1. Start DC1

7.0 DHCP

Create a Linux DHCP server running CentOS 8 that is joined to the cap.int domain.

7.1 Create VM LinDHCP & Install Linux CentOS 8

  1. On Thinkpad’s Hyper-V, create a new VM named “LinDHCP” with the following:
    • Memory: 2048 MB Static (this will be set to 512 MB after configuration)
    • Network: LAN
    • Operating System: CentOS-Stream-8.iso
  1. Edit the following Hyper-V settings of LinDHCP
    • Secure Boot: Disabled
    • Checkpoints: Uncheck automatic checkpoints
  1. Connect and start the LinDHCP VM
  1. Select Install CentOS Stream 8-stream > Press ENTER
  1. On the welcome installation screen, select language English (Canada) > Click Continue to go to the Installation Summary Page
    CentOS Installation Summary Page
  1. Click Time & Date > Pick Vancouver on the map> Done
  1. Click Installation Destination > Click on the disk and ensure it is selected > Done
  1. Click Software Selection > Select Server as the base environment and Network Servers as additional software to be installed
  1. Click Network & Host Name
    • Enter the Host Name as “LinDHCP”
    • To setup the eth0 (LAN interface) in the bottom left corner of the screen click Configure...
  1. From the Editing LAN popup click on the tab IPv4 Settings
  1. Enter the following settings for the LAN network interface then click Save:
    • Connection Name: “LAN”
    • Method: Manual
    • Address: 192.168.3.3
    • Netmask: 28
    • Gateway: 192.168.3.14
    • DNS Servers: 192.168.3.1
    • Search Domains: cap.int
  1. Connect the ethernet by clicking the on/off toggle and view the summary of the configured settings > Click Done to return to the Installation Summary Page
  1. Click User Creation and create a administrator user named “_lsysadmin” with the password Pa$$w0rd > Done
  1. Click Root Password and enter Pa$$w0rd > Done
  1. Click Begin Installation
  1. When the installation is complete, click Reboot System
  1. Login to LinDHCP with _lsysadmin and Pa$$w0rd
  1. View networking configuration with ifconfig
  1. Test internet connectivity by entering ping google.ca
  1. ❗ Note: Pay attention to the prompt $ or #
    use su or sudo <command>
  1. Update the OS with # dnf update (note that # yum update -y also works)
  1. (Optional) Install traceroute with # yum install traceroute -y and run $ traceroute google.ca

7.2 Install and Configure DHCP

  1. Install the dhcp server package and dependencies with # dnf install dhcp-server
  1. Open the dhcpd configuration file with # nano /etc/dhcp/dhcpd.conf
  1. Write the following into dhcpd.conf

    ❗ Note: all entries need to be manually entered as copying into a Linux guest VM does not work, or create from a SSH session.

    # set lease times
    default-lease-time 600;
    max-lease-time 7200;
    
    # declare the DHCP Server
    authoritative;
    
    # Set Network address, subnet mask and gateway
    subnet 192.168.3.0 netmask 255.255.255.248 {
    	option routers 192.168.3.14;
    	option broadcast-address 192.168.3.15;
    	option subnet-mask 255.255.255.240;
    	option domain-search "cap.int";
      option domain-name-servers 192.168.3.1;
    	# IP address scope range - set only 1 which will be used for thinkpad
      range 192.168.3.13 192.168.3.13;  
    }
    
    #Set DHCP Reservations for servers, find the MAC address in Hyper-V Settings
    host DC1 {
    	hardware ethernet 00:15:5D:05:4A:06;
    	fixed-address 192.168.3.1;
    }
    
    host LinDHCP {
    	hardware ethernet 00:15:5D:05:4A:08;
    	fixed-address 192.168.3.3;
    }
  1. When finished editing press CTRL+S then CTRL+X to save and exit
    • Note: CTRL is shown as ^
  1. Start the service dhcpd, check the status to verify it is active, and set the service to start on reboot with:
    • # systemctl start dhcpd
    • # systemctl status dhcpd
    • # systemctl enable dhcpd.service
  1. Reboot the DHCP server and verify that the dhcpd service starts automatically with:
    • # reboot
    • # systemctl status dhcpd

7.3 Test DHCP on Thinkpad

  1. On Thinkpad set the LAN network adapter settings to Obtain an IP address automatically
  1. On Thinkpad open PowerShell as an administrator and run the following:
    • ❗ If using RDP to access Thinkpad exit the session and work directly on the host. Reconnect after the settings are renewed.
    ipconfig /release
    ipconfig /renew
    ipconfig /all
  1. View the DHCP Server IP for vEthernet LAN and notice it points to LinDHCP
  1. From LinDHCP view the DHCP leases with $ cat /var/lib/dhcp/dhcpd.leases

7.4 Join LinDHCP to cap.int Domain

  1. Install the required packages on LinDHCP
    • # dnf install realmd sssd oddjob oddjob-mkhomedir adcli samba-common-tools krb5-workstation
  1. Join the cap.int domain
    • Use the Aidan admin credentials # realm join --user=aidan cap.int
    • View the computer object in ADUC
  1. Move the computer object LINDHCP into the OU=DHCP
  1. On LinDHCP login with the domain admin aidan@cap.int
  1. In DNS Manager on Thinkpad add a A record for LinDHCP
  1. ⏲ Checkpoint LinDHCP and name it “Functional DHCP - future reservations need to be added”
  1. Shut down the VM and set the memory to 512 MB static

8.0 iSCSI SAN

Create a SAN virtual machine which will not join the domain as it is mimicking physical hardware. It does need to be added to Server Manager for a to have a GUI. This iSCSI target will have RAID 6 to allow for 2 disk failure and a ReFS file system on the 2 volumes. The main iSCSI virtual disk will be 100GB as it will contain the VHDX for FILE1, FILE2, DC2 as well as the file share data. The second vDisk will be used as the quorum witness.

8.1 Create the SAN VM with Server Core

  1. ⏲ Checkpoint DC1 and name it “Before SAN”
  1. In Hyper-V on Thinkpad, create a new VM named “SAN” with using the script from Appendix E to create the following:
    • Memory: 2048 MB Static (will be set to 512 MB after)
    • Network: LAN
    • Hard Disk: Differencing disk to ParentServer2019-Core.vhdx
    • Operating System: Windows Server 2019 (Core)
  1. Connect and start the SAN virtual machine
  1. Set the admin password to Pa$$w0rd
  1. Set LAN networking in sconfig
    • IP Address: 192.168.3.4
    • Subnet: 255.255.255.240 (/28)
    • Default Gateway: 192.168.3.14
    • DNS: 192.168.3.1 & 8.8.8.8
  1. From PowerShell run the following:
    Get-NetAdapter
    Rename-NetAdapter -Name "Ethernet" -NewName "LAN"
    
    Get-LocalUser
    Rename-LocalUser -Name "Administrator" -NewName "_lsysadmin"
    
    Restart-Computer -Force
  1. From sconfig select option 2 to rename the computer to “SAN”
  1. Verify all post-install tasks are complete and are configured correctly as per Appendix G
  1. Restart the VM with Restart-Computer -Force

8.2 Add a Non-Domain Member to Server Manager

  1. On Thinkpad open PowerShell and run the following commands:
    # Update hosts file to map SAN's IP to name "SAN"
    Add-Content -Path C:\Windows\System32\drivers\etc\hosts -Value "192.168.3.4 SAN"
    
    #Start the WinRM service
    Start-Service -Name WinRM
    
    #Set SAN host as trusted
    Set-Item -Path WSMan:\localhost\Client\TrustedHosts -Value SAN -Concatenate -Force
    
    #View the list
    Get-ChildItem -Path WSMan:\localhost\Client\TrustedHosts | Format-List
  1. Open Server Manager and add SAN from the DNS tab
  1. To fix the Kerberos authentication error, right-click SAN > Manage As > Enter the following credentials
    • User: san\_lsysadmdin - as SAN is a workgroup computer not a cap.int domain member, the domain value is san\ for the VM’s name
    • Password: Pa$$w0rd
      Use the local admin account as SAN is not a cap.int domain member

8.3 Setup the iSCSI SAN RAID 6 Hardware

  1. From Thinkpad on PowerShell create eight 25GB disks and attach to the SAN VM with the following:
    • ❗ This may take some time as the disk size is fixed
    New-VHD -Path V:\VMs\VHDX\Disk1.vhdx -Fixed -SizeBytes 25GB
    Add-VMHardDiskDrive -VMName SAN -Path V:\VMs\VHDX\Disk1.vhdx
    
    New-VHD -Path V:\VMs\VHDX\Disk2.vhdx -Fixed -SizeBytes 25GB
    Add-VMHardDiskDrive -VMName SAN -Path V:\VMs\VHDX\Disk2.vhdx
    
    New-VHD -Path V:\VMs\VHDX\Disk3.vhdx -Fixed -SizeBytes 25GB
    Add-VMHardDiskDrive -VMName SAN -Path V:\VMs\VHDX\Disk3.vhdx
    
    New-VHD -Path V:\VMs\VHDX\Disk4.vhdx -Fixed -SizeBytes 25GB
    Add-VMHardDiskDrive -VMName SAN -Path V:\VMs\VHDX\Disk4.vhdx
    
    New-VHD -Path V:\VMs\VHDX\Disk5.vhdx -Fixed -SizeBytes 25GB
    Add-VMHardDiskDrive -VMName SAN -Path V:\VMs\VHDX\Disk5.vhdx
    
    New-VHD -Path V:\VMs\VHDX\Disk6.vhdx -Fixed -SizeBytes 25GB
    Add-VMHardDiskDrive -VMName SAN -Path V:\VMs\VHDX\Disk6.vhdx
    
    New-VHD -Path V:\VMs\VHDX\Disk7.vhdx -Fixed -SizeBytes 25GB
    Add-VMHardDiskDrive -VMName SAN -Path V:\VMs\VHDX\Disk7.vhdx
    
    New-VHD -Path V:\VMs\VHDX\Disk8.vhdx -Fixed -SizeBytes 25GB
    Add-VMHardDiskDrive -VMName SAN -Path V:\VMs\VHDX\Disk8.vhdx
    ❗ Because SAN has so many disks, do NOT checkpoint this VM, this will also apply to the nested servers HV1, and HV2
  1. In SAN’s settings in Hyper-V, add a Network Adapter and connect it to the iSCSI virtual switch
  1. On SAN go to sconfig > Option 8 > set the Network Adapter Settings to the following:
    • IP Address: 192.168.10.3 (Static)
    • Subnet Mask: 255.255.255.248
  1. From PowerShell in SAN rename the new network adapter to “iSCSI”
    Get-NetAdapter
    Rename-NetAdapter -Name "Ethernet" -NewName "iSCSI"
    
    #View Changes
    Get-NetAdapter
  1. Enable jumbo packets with the size 9014 bytes by entering the following in PS:
    # View settings before
    Get-NetAdapterAdvancedProperty -Name "iSCSI"
    
    # Enable jumbo frames and set size
    Set-NetAdapterAdvancedProperty -Name "iSCSI" -RegistryKeyword "*JumboPacket" -Registryvalue 9014
    
    # View changes
    Get-NetAdapterAdvancedProperty -Name "iSCSI"

8.4 Configure SAN’s Storage Pool, Virtual Disks, and Volumes

  1. From Server Manager > go to File and Storage Services > Volumes > Storage Pools
  1. Under the Storage Pools section > Windows Storage > Right click Primordial > New Storage Pool... to open the Wizard
  1. Complete the New Storage Pool Wizard with the following:
    • Pool Name: “Pool1”
    • Physical Disks: Select all 6 and set the allocation to Automatic
    • Confirm & click Create
  1. Create a virtual disk named “vDisk” from PowerShell on SAN with the following

    ❗ Windows Server 2019 has a known bug where vDisks can not be made from Server Manager which is why PowerShell is used instead

    # Create a RAID 6 virtual disk by setting resiliency=parity & physical disk redundancy=2
    New-VirtualDisk `
    -StoragePoolFriendlyName "Pool1" `
    -FriendlyName "vDisk" `
    -Size 100GB `
    -ProvisioningType Fixed `
    -ResiliencySettingName "Parity" `
    -PhysicalDiskRedundancy 2
  1. From Server Manager on Thinkpad > go to Volumes > Disks
  1. Expand SAN (2) right click vDisk > click Bring Online
  1. Right-click vDisk again > select Initialize
  1. In the section Volumes click the link To create a volume, start the New Volume Wizard
  1. Complete the New Volume Wizard with the following:
    • Server and Disk: Select SAN and Disk 9
    • Size: 100 GB (the maximum available capacity)
    • Drive Letter or folder: Assign to drive letter D
    • File System Settings: File system set to ReFS and label the volume “HVData”

8.5 Add the iSCSI Target Role on SAN

  1. In Server Manager click All Servers in the left panel
  1. Right click server SAN > click Add Roles and Features
  1. Install the iSCSI Target Server role >Accept recommended addons which includes the File Server role

8.6 Create an iSCSI Virtual Disk

  1. Open Server Manager navigate to File and Storage Spaces > iSCSI
  1. Click the link To create an iSCSI virtual disk, start the New iSCSI Virtual Wizard
  1. Complete the iSCSI Virtual Disk Wizard with the following
    • Name: “HVData”
    • Disk Size: 98.3 GB (the maximum)
    • iSCSI Target: Create new target named “HVData” and add IP addresses that will be used for the nested Hyper-V servers to be the initiators 192.168.10.1 and 192.168.10.2 for HV1 and HV2
  1. Notice that the target and virtual disk status is Not Connected this will be setup later

8.7 Create a 2GB vDisk for the Quorum Witness

  1. From Server Manager go to File and Storage Services > Volumes > Storage Pools
  1. On SAN run create a virtual disk from the free 22 GB in Pool1 with the following PS script:
    # Create a RAID 6 virtual disk by setting resiliency=parity & physical disk redundancy=2
    New-VirtualDisk `
    -StoragePoolFriendlyName "Pool1" `
    -FriendlyName "HVWitness" `
    -Size 2GB `
    -ProvisioningType Fixed `
    -ResiliencySettingName "Parity" `
    -PhysicalDiskRedundancy 2
    Access a PS session on SAN from Server Manager on Thinkpad (or connect to the VM directly)
  1. From Volume > Disks, bring HVData online, initialize, create volume
  1. Go to the iSCSI tab > click TASKS for iSCSI Virtual Disks > Click New iSCSI Virtual Disk
  1. Complete the iSCSI Virtual Wizard and add HVWitness
    • Notice that the existing iSCSI target already exists from the last disk
  1. ❗Notice the change of free space on the virtual disk before and after the iSCSI virtual disk has been made - this is expected
  1. (Optional) On SAN enter Get-PSDrive in PowerShell to see the volumes
    • D:\→ HV Data
    • E:\→ HVWitness
  1. Shut down the SAN virtual machine
  1. Set the memory to 512 MB Static

9.0 Configure 2 Nested Hyper-V Failover Cluster Servers

Create 2 nested Hyper-V servers which will contain FILE1, FILE2, and DC2 VMs. Each Hyper-V machine needs an external switch for LAN and HB with the network adapters set to enable MAC spoofing. The nested Hyper-V machines will connect to the iSCSI SAN and the disk will be a cluster shared disk (CSV) to allow both VMs access at the same time. Both HV’s will be clustered together to allow for resiliency and live migration of VM’s.

9.1 Create the Hyper-V VM & Complete Post-Install Tasks

  1. Create a VM named “HV1” with 4GB of RAM using the script from Appendix E
  1. Start the virtual machine HV1 and set the administrator password to PaSSw0rd
  1. Enter powershell and run the post installation tasks script below: (See Appendix F for future VMs)
    • $IP = 192.168.3.5
    • $SrvName = HV1
    • $SrvOUPath = OU=HYPERV,OU=Servers,DC=cap,DC=int
    #
    # Post-installation tasks
    #
    $IP = Read-Host -Prompt 'Enter IP 192.168.3.x'
    $SrvName = Read-Host -Prompt 'EnterServerNAME'
    $SrvOUPath = Read-Host -Prompt 'AD Path OU=X,OU=Servers,DC=cap,DC=int'
    $MaskBits = 28
    $Gateway = "192.168.3.14"
    $Dns = "192.168.3.1"
    $IPType = "IPv4"
    
    
    # Retrieve the network adapter that you want to configure
    $adapter = Get-NetAdapter | ? {$_.Status -eq "up"}
    # Remove any existing IP, gateway from our ipv4 adapter
    If (($adapter | Get-NetIPConfiguration).IPv4Address.IPAddress) {
     $adapter | Remove-NetIPAddress -AddressFamily $IPType -Confirm:$false
    }
    If (($adapter | Get-NetIPConfiguration).Ipv4DefaultGateway) {
     $adapter | Remove-NetRoute -AddressFamily $IPType -Confirm:$false
    }
     # Configure the IP address and default gateway
    $adapter | New-NetIPAddress `
     -AddressFamily $IPType `
     -IPAddress $IP `
     -PrefixLength $MaskBits `
     -DefaultGateway $Gateway
    # Configure the DNS client server IP addresses
    $adapter | Set-DnsClientServerAddress -ServerAddresses $DNS
    # Rename the Network Adapter
    Rename-NetAdapter -Name "Ethernet" -NewName "LAN"
    
    # Name Computer, add to Domain and OU placement
    $cred = Get-Credential cap\aidan
    Add-Computer -DomainName cap.int -Credential $cred -OUPath $SrvOUPath
    $computer = Get-WmiObject win32_computersystem
    $r = $computer.rename("$SrvName", $cred.GetNetworkCredential().Password, $cred.username)
    
    #Rename the local admin account
    Rename-LocalUser -Name "Administrator" -NewName "_lsysadmin"
    
    # Restart-Computer -Force
  1. When complete enterRestart-Computer -Force
  1. Login to the SAN virtual machine as cap\aidan
  1. Complete the following post-install tasks in powershell (see Appendix G for future reference)
    • whoami: verify server is a domain member and that the admin aidan@cap.int is logged in
    • tracert google.ca: verify internet connectivity and DNS
    • ping LinDHCP: test DNS to a domain server
    • ipconfig: verify IPv4 address, subnet, default gateway
    • Get-LocalUser: verify the local admin account has been renamed to _lsysadmin
    • Get-NetAdapter: verify the network adapter has been renamed
  1. Complete the following post-install tasks in sconfig (see Appendix G for future reference)
    • 11 Windows Activation, verify Windows is activated and has the 180 day trial
    • 6 Download and Install updates
  1. Complete the following post-install tasks from Server Manager (see Appendix G for future reference)
    • Open DNS Manager and view the host A record
    • Open ADUC and verify the computer object is in the correct OU
  1. Complete the following post-install tasks from Thinkpad (see Appendix G for future reference)
    • Add the HV1 VM to Server Manager and manage as cap\aidan
    • ⏲ Checkpoint (if needed, but try to keep to a minimum)

10. Repeat all steps to make the 2nd server HV2

9.2 Complete Nested Hypervisor Hardware and Network Requirements

  1. On Thinkpad’s Hyper-V manager, open the settings for HV1
  1. Under Hardware > Processor > Set to 2 Virtual Processors
  1. Under Hardware > Network Adapter LAN > Advanced Features > Check Enable MAC address spoofing
  1. Add Network Adapter’s to the iSCSI, HB, and LM switches
  1. Start HV1 and enter sconfig > 8 view network settings & view the MAC addresses of each adapter in Hyper-V Manager
    The order the net adapter is added in HV1 settings > the index #.
  1. From sconfig set the network adapters with the following:
    Index# - NetworkIP AddressSubnet
    1 - LAN192.168.3.5255.255.255.240
    2 - iSCSI192.168.10.1255.255.255.248
    3 - HB192.168.20.1255.255.255.248
    4 - LM192.168.30.1255.255.255.252
  1. From PowerShell rename the network adapters

    ❗ Match the Ethernet to the MAC address each time before running!

    Get-NetAdapter | Sort-Object -Property "InterfaceDescription"
    
    Rename-NetAdapter -Name "Ethernet" -NewName "iSCSI"
    Rename-NetAdapter -Name "Ethernet 2" -NewName "HB"
    Rename-NetAdapter -Name "Ethernet 3" -NewName "LM"
    #View
    Get-NetAdapter | Sort-Object -Property "InterfaceDescription"
  1. Restart the server to apply the renaming changes with Restart-Computer -Force
  1. Verify that the proper IP address is assigned to the network adapter (compare to MAC address) and that the net adapter is renamed with ipconfig /all, Hyper-V Manager, and/or with the following code:
    #View
    Get-NetAdapter | Sort-Object -Property "ifIndex" -Descending |Format-Table -Property "ifIndex", "Name", "MacAddress" 
    Get-NetIPAddress -AddressFamily IPv4 | Sort-Object -Property "ifIndex" -Descending | Format-Table -Property "ifIndex", "IPAddress", "PrefixLength"
    Get-NetIPConfiguration | Sort-Object -Property "InterfaceIndex" -Descending |  Format-Table -Property "InterfaceIndex", "InterfaceAlias", "IPv4Address"
  1. Enable jumbo frames on the network adapter connected to iSCSI with the following:
    # View settings before
    Get-NetAdapterAdvancedProperty -Name "iSCSI"
    # Enable jumbo frames and set size
    Set-NetAdapterAdvancedProperty -Name "iSCSI" -RegistryKeyword "*JumboPacket" -Registryvalue 9014
    # View changes
    Get-NetAdapterAdvancedProperty -Name "iSCSI"
    
    # Test sending jumbo frames (after the VM's have been made and also have jumbo frames enabled)
    ping 192.168.10.3 -f -l 8500
  1. From HV1 send a ping with jumbo frames to SAN ping 192.168.10.3 -f -l 8500
    • ❗ No DNS settings are set for this network requiring IP addresses
    • -f Specifies that echo Request messages are sent with the Do not Fragment flag in the IP header set to 1 (available on IPv4 only). The echo Request message can't be fragmented by routers in the path to the destination. This parameter is useful for troubleshooting path Maximum Transmission Unit (PMTU) problems.
    • /l <size> Specifies the length, in bytes, of the Data field in the echo Request messages. The default is 32. The maximum size is 65,527.
  1. Open the firewall so the server allows ICMP pings
    #Allow Ping
    netsh advfirewall firewall add rule name="ICMP Ping Allow" protocol="icmpv4:8,any" dir=in action=allow
    
    #Block ping (for referenc)
    netsh advfirewall firewall add rule name="ICMP Ping Block" protocol="icmpv4:8,any" dir=in action=block
  1. Shutdown the HV1 VM
  1. Enable nested virtualization for the virtual machine by running the following from PowerShell on the host Thinkpad:
    #Run from Thinkpad Host while the guest VM is off
    Get-VMProcessor -VMName HV1 | fl
    Set-VMProcessor -VMName HV1 -ExposeVirtualizationExtensions $true 
  1. Repeat steps 1-14 for HV2
    Index# - NetworkIP AddressSubnet
    1 - LAN192.168.3.6255.255.255.240
    2 - iSCSI192.168.10.2255.255.255.248
    3 - HB192.168.20.2255.255.255.248
    4 - LM192.168.30.2255.255.255.252

9.3 Connect HV1 to the iSCSI Target

  1. From HV1 enteriscsicpl to open the iSCSI Initiator
  1. In the iSCSI Initiator Properties popup, click the Discovery tab
    1. Click Discover Portal and enter in SAN’s IP 192.168.10.3 and click Advanced...
    1. Set Local adapter: to Microsoft iSCSI Initiator
    1. Set Initiator IP: 192.168.10.1 the IP of HV1
    1. Click OK at the bottom of the window
  1. Click on the Targets tab > click Connect
    • If the connection fails, restart the Storage Server (SAN) or restart the iSCSI Target Service.

Refresh Server Manager and see the target status = Connected

  1. Go to Volumes > Disks > and expand HV1
  1. Right click iSCSI disk > bring online, initialize, and create a volume with NTFS named “HVData”
    View the drives on HV1 with the PS command Get-PSDrive
  1. Enable File Sharing by running the following command on HV1’s PowerShell:
    • Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Any
  1. Make the directories VMs\VHDX on the iSCSI virtual disk from file explorer \\192.168.3.5\d$ or PowerShell mkdir VMs\VHDX

8. Repeat steps 1-3 & 6 on HV2 for the iSCSI initiator. The drive does not need to be formatted again and note that only 1 VM can be connected at a time

9.4 Add the Hyper-V Role

  1. ‼ Login to account cap\aidan on Thinkpad and complete the rest of the project from here. Multiple issues are caused from working from the thinkpad\aidan account in future steps
  1. ⏲ Checkpoint DC1 and name it “Before Nested HV”
  1. From Server Manager right-click HV1 > select Add Roles and Features
  1. Complete the Add Roles and Features Wizard and install the role Hyper-V with the following:
    • Server Roles: Select Hyper-V
    • Features: ❗ Select Failover Clustering or install separately after
    • Virtual Switches: Leave all unchecked as switches will be made manually later
    • Migration: Leave unchecked
    • Default Stores: Default VHDX file location = D:\VMs\VHDX , VM configuration files = D:\VMs
    • Confirmation: Check Restart the destination server automatically if required
  1. Verify the role installation by running the following PS command on HV1
    • Get-WindowsFeature Hyper*
  1. From Hyper-V Manager on Thinkpad, right click Hyper-V Manager > Connect to Server > Browse and select HV1
  1. Click HV1 in Hyper-V Manager > Virtual Switch Manager
  1. Create a new virtual network switch named “LANext” and connect it to External network: Microsoft Hyper-V Network Adapter

9.5 Configure Hyper-V Failover Clustering

  1. From Server Manager install the feature Failover Clustering to HV1 & HV2
  1. In Server Manager go to the Tools drop down and select Failover Cluster Manager
  1. Right-click Failover Cluster Manager > Select Validate Configuration
  1. Complete the Validate a Configuration Wizard with the following:
    • Select Servers: HV1.cap.int and HV2.cap.int
    • Testing Options: Select Run all tests
    • Summary: View results and any errors. Check Create the cluster now using the validated nodes
  1. Complete the Create Cluster Wizard with the following:
    • Access Point for Administering the Cluster: Name = HV-Cluser, Address = 192.168.3.7
    • Confirmation: Uncheck Add all eligible storage to the cluster
  1. View HV-Cluster.cap.int
  1. In Failover Cluster Manager navigate to HV-Cluster.cap.int > Storage > Disks
  1. Click Add Disk and add both Cluster Disk 1 and 2 (HVdata and Quorum)
  1. Rename the disks from Cluster Disk # to “HV-Data” and “HV-Witness”
  1. Right click the disk HV-Data > Select Add to Cluster Shared Volumes
    • Cluster Shared Volumes (CSV) enable multiple nodes in a Windows Server failover cluster to simultaneously have read-write access to the same LUN (disk) that is provisioned as an NTFS volume
    HVData D:\ is now in the C:\ drive
  1. Right click HV-Cluster.cap.int > More Actions > Click Configure Cluster Quorum Settings....
  1. Complete the Configure Cluster Quorum Wizard with the following:
    • Select Quorum Configuration Option: Click Select the quorum witness
    • Select Quorum Witness: Click Configure a disk witness
    • Configure Storage Witness: Click HV-Witness
  1. In Failover Cluster Manager > Networks > Rename the networks from Cluster Network # to the proper network name
  1. (Optional) Click through all the HV-Cluster.cap.int options
  1. (Optional) Run ipconfig on HV1 and HV2
  1. (Optional) View Server Manager > click Refresh > and notice that HV-Cluster is added automatically

9.6 Test Live Migration and Hyper-V Failover

  1. Test failover clustering by pausing HV1 on Thinkpad’s Server Manager > verify the cluster remains > then resume HV1
  1. Test failover clustering by pausing HV2 on Thinkpad’s Server Manager > verify the cluster remains > then resume HV2
  1. Go to Hyper-V Manager on Thinkpad > Click HV2 > Hyper-V Settings
  1. Change the default locations from D:\ to the ClusterStorage on C:\
    • Virtual Hard Disks: C:\ClusterStorage\volume1\vms\vhdx\
    • Virtual Machines: C:\ClusterStorage\volume1\vms\
  1. Copy over the ParentServer2019-Core.vhdx file from Thinkpad to \\192.168.3.5\c$\ClusterStorage\Volume1\VMs\VHDX (or to \\192.168.3.6 as both have access)
  1. Go to Roles > Click Virtual Machines... > New Hard Disk... > create a differencing vhdx named ‘File1’
  1. In Roles > Virtual Machines... > Click New Virtual Machine... > Create a VM named “File1” with 1024 MB Static Memory that is connected to the child differencing disk and the LAN external switch
  1. Notice that when the VM is created, the High Availability Wizard automatically appears and runs
  1. Within Failover Cluster Manager > Roles > right-click File1 > Connect and start
  1. Set FILE1’s property preferred owners to be both HV virtual machines
  1. Test live migration by going clicking Move > Live Migration > Select Node.... > Select the other HV VM
    • When complete notice that the Owner Node changes to the other HV virtual machine
  1. Create another VM named ‘FILE2’ on the HV# that is not in use > verify that a separate role is created and that the VM’s boot and run while on different nested Hypervisors

10.0 File Server Cluster

Within the nested Hyper-V cluster create 2 VM’s for FILE1 and FILE2. The machines will be clustered together for failover and use a VHD Set for the file server role which will have a SMB share.

10.1 Server Role, Hardware, and HB Network Setup

  1. ⏲ Checkpoint DC1 and name it “Before FS and cluster”
  1. On FILE1 and FILE2 run the post install tasks from Appendix F
    • ❗ for spaces and line breaks the script has ^M this is ok and it will run as expected
  1. Complete the verification checks as per Appendix G
  1. On FILE1 and FILE2 install the role File Server and feature Failover Clustering
  1. In Failover Cluster Manager navigate to Roles > Under the Actions panel click Virtual Machines... > Select New Hard Disk..
  1. Complete the Virtual Hard Disk Wizard with the following to create a VHD Set:
    • Format: VHDSet
    • Type: Dynamically Expanding
    • Name: “FSdata.vhds”
    • Location: The cluster storage volume
    • Size: 15 GB
    • ❗ If a Fixed disk is created instead it may take up to 20 minutes to create - choose dynamic
  1. Create a 2nd VHDS named “FSwitness” that is 3GB in size
  1. In File Explorer view the new VHDS file and notice that there are 2 files per set
    • Virtual machines connect to the .VHDS file and data is stored in the .AVHDX file
    • .vhds is a configuration file that contains metadata, and is used for maintaining simultaneous access to the disk from multiple cluster nodes.
    • .avhdx (“automatic .vhdx”) is an actual virtual disk where the data resides. It can be fixed or dynamic.
  1. From PowerShell on HV1 (or HV2) run the following command to attach the VHD Set to the FILE machines :
    • Add-VMHardDiskDrive -VMName FILE2 -Path "C:\ClusterStorage\Volume1\VMs\VHDX\FSdata.vhds" -SupportPersistentReservations
  1. Repeat so both HV1 and HV2 has FSdata.vhds & FSwitness.vhds
  1. From Server Manager navigate to File and Storage Spaces > Volumes > Disks
  1. Bring FSdata.vhds & FSwitness.vhds online, initialize, and create volumes with the file system NTFS
  1. On HV1 view the available network adapters in sconfig or PowerShell Get-NetAdapter
  1. View which adapter (by IP or adapter name) is connected to the HB network & the corresponding interface description number Hyper-V Network Adapter#
  1. In the Hyper-V Manager for HV1 > Virtual Switch Manager... > Create a new virtual network switch:
    • Switch Type: External
    • ❗ Select the Microsoft Hyper-V Network Adapter # that corresponds to the HB network
    • Name: HBext
  1. Repeat on HV2 to create another external switch
  1. On Hyper-V Manager for Thinkpad > Open the settings for HV1
  1. Expand the HB Network Adapter > Advanced Features > Check Enable MAC address spoofing
    ❗ MAC Spoofing must be enabled or the FILE machines will not be able to communicate outside of the nested Hyper-V host
  1. Repeat on HV2 to enable MAC spoofing on the HB adapter
  1. On FILE1 & FILE2 from sconfig or PowerShell set the following:
    IPv4 FILE1192.168.20.3
    IPv4 FILE1192.168.20.4
    Subnet255.255.255.248
    NetAdapter NameHBext
  1. Verify connectivity on the HB network 192.168.20.0 /29 by sending pings from FILE1 to FILE2 and vice versa

10.2 Create and Configure the Cluster

  1. From Failover Cluster Manager validate the configuration for FILE1 and FILE2 by running all tests
  1. Complete the Create Cluster Wizard with the following:
    • Cluster Name: “FS-Cluster”
    • IP Address: 192.168.3.10
    • Add all eligible storage to the cluster: Uncheck
  1. View results - notice that there are 2 clusters connected in the manager HV-Cluster and FS-Cluster
  1. From Storage > Disks > Add both VHDS to the cluster & rename
  1. Configure the cluster quorum and add the disk FS-Witness to be the disk witness resource
  1. Rename the networks in FS-Cluster to “LAN” and “HB”

10.3 Allow CNO FS-Cluster to Create Computer Objects in AD DS

  1. ❗ Without this step, the File Server role will install but will be offline and have errors because FS will not be created because the Cluster Name Object (CNO) FileServerCluster does not have permission to create computer objects.
    The file server role will add but have a failed status without editing the FS OU Permission Properties
  1. From Server Manager > Right-click DC1 > Open Active Directory Users and Computers (ADUC)
  1. On the View menu taskbar check Advanced Features so it is selected
  1. Right-click the FS OU where the FS-Cluster CNO (Cluster Name Object) is located > select Properties
  1. On the Security tab, select Advanced > Add
  1. In the Permission Entry window click Select a principal > Object Types > Select Computers
  1. Add the object FS-Cluster
  1. In the Permission Entry dialog box set the following:
    • Type: Allow
    • Applies to: This object and all descendant objects
    • Permissions: Select Create Computer objects

10.4 Add the File Server Role

  1. In Failover Cluster Manager navigate to > FS-Cluster.cap.int > Roles > Click Configure Role...
  1. Create the role File Server with the following:
    • Client Access Point: Name = “FS” & IP= 192.168.3.11
    • Storage Disk: FS-Data
  1. View results

10.5 Create File Share

  1. Click on the File Server object FS in the cluster roles > Click Add File Share to open the New Share Wizard
  1. Complete the first 4 steps in the wizard as follows:
    • Select Profile: SMB Share - Quick
    • Share location: Click Type a custom path and create and select the directory “Company_Data”
    • Share Name: Add the $ after the share name so the remote path shows as \\fs\Company_Data$
    • Configure share settings: Select all four options
  1. On the Permissions step click Customize Permissions.. > Disable inheritance > click Convert inherited permissions into explicit permissions on this object
  1. Select entry for Principal Users (FILE1\Users) with Access = Special > click Remove
  1. Select entry for Principal Users (FILE1\Users) with Access = Read & Execute > Change the setting ‘Applies to’ to This folder only
    FILE1 user permissions & result for the advanced security settings tab Permissions and Share
  1. Confirm the settings in the wizard > click Create
  1. From Thinkpad’s file explorer navigate to the share \\fs\Company_Data$
  1. Pause the owner VM to test the file share failover clustering, verify the share can still be accessed
  1. Set the memory on FILE1 and FILE2 to 512 MB

11.0 Create AGLDP Structure and GPOs

Create an AGDLP Security group structure for cap.int. Account, Global Groups (Role Based), Domain Local (tied to Read/Write (RE) or Read/Execute (RE) permissions), Permissions. Create a Group Policy Object (GPO) that maps the file share from step 10.5 to the domain user’s computer. Create another GPO to redirect the Desktop and Document folders to a new file share.

11.1 Setup AGDLP File Permissions for the Share

  1. Open Active Directory Users and Computers and go to the OU Security_Groups
  1. From ADUC or PS, in the OU IT_Groups create the following Global Groups & add the domain user as a member follows:
    Security Group NameGroup ScopeDomain Member
    IT_Managers_GGlobalBob Lo
    IT_ServiceDesk_GGlobalDan Wu
    #Create Security Group
    Get-Command -Module ActiveDirectory
    New-ADGroup "IT_Managers_G" `
    -Path "OU=IT_Groups,OU=Security_Groups,DC=cap,dc=int" `
    -GroupCategory Security `
    -GroupScope Global `
    -PassThru –Verbose
    
    #Add Member to Group - Phil.Gibbins
    Add-ADGroupMember -Identity "IT_Managers_G" -Members bob.lo
    
    #View group members to verify Phil was added, can also refresh in AD
    Get-ADGroupMember -Identity "IT_Managers_G"
  1. From ADUC or PS, in the OU FIN_Groups create the following Global Groups & add the domain user as a member follows:
    Security Group NameGroup ScopeDomain Member
    FIN_Accountants_GGlobalAmy Li
    FIN_Controllers_GGlobalSam Hu
  1. In the OU IT_Groups create the following Domain Local Groups & add global group as a member follows:
    Security Group NameGroup ScopeMember
    IT_Management_RW_DL Domain LocalIT_Managers_G
    IT_ServiceDesk_RW_DLDomain LocalIT_ServiceDesk_G
  1. In the OU FIN_Groups create the following Domain Local Groups & add the global group as a member follows:
    Security Group NameGroup ScopeMember
    FIN_Accounting_RW_DL Domain LocalFIN_Accountants_G
    FIN_Accounting_RE_DLDomain LocalFIN_Accountants_G
    FIN_Controllers_RW_DL Domain LocalFIN_Controllers_G
  1. On Thinkpad open the file explorer and access the share \\FS\Company_Data$
  1. Create 4 directories in the share - “IT_ServiceDesk”, “IT_Management”, “FIN_Accounting”, and “FIN_Controllers”
  1. Right-click the IT_Management directory > select Properties
  1. Open the tab Security > Click Edit to change permissions > add the group IT_Management_RW_DL
  1. Give the domain local group Read/Write permissions by checking Modify
    • Groups with RW → Modify Permission
    • Groups with RE → Read & Execute Permission
  1. In ADUC add FIN_Controllers_G as a member of FIN_Accounting_RW_DL to give the controllers Read/Write access of the directory FIN_Accounting as well
  1. Test the NTFS permission by logging into users amy.li (accountant) and sam.hu (finance controller) and open the share \\fs\company_data$

11.2 Create a Mapped Drive GPO

  1. From Server Manager > Tools > Group Policy Management
  1. In ‘Group Policy Objects’ > Right click New > Name the GPO “Mapped Drives”
  1. Right-Click the GPO Mapped Drives > Edit
  1. In Group Policy Management Editor expand User Configuration > Preferences > Windows Settings > click Drive Maps
  1. From Drive Maps, right-click New > Mapped Drive
  1. Create a new drive with the following properties:
    • Action: Create
    • Location: \\FS\Company_Data$
    • Reconnect: Check
    • Label as: “Department Directories”
    • Drive Letter: Use “S” for ‘Shared Drive’
    • Hide/Show this drive: Select Show this drive
  1. Apply the Mapped Drives GPO to the OU Domain_Users
  1. Test the drive mapping by logging as a domain user such as amy.li on Thinkpad> Open PowerShell and run gpupdate /force > logout
  1. Login as amy.li and wait for the GPO to be applied (the logon process will take ~3 minutes) and view the mapped drive and view the applied GPO with gpresult /r

11.3 Create a Folder Redirection GPO

  1. From Failover Cluster Manager for FS-Cluster.cap.int > Roles > Select FS > Click Add File Share
  1. Complete the first 4 steps in the New Share Wizard to with the following:
    • Profile: SMB Share Quick
    • Location: D:\HomeDir
    • Share Name: HomeDir$ (remote path will be \\fs\HomeDir$
  1. On the step Permissions on the wizard set the following
    • Disable inheritance > convert to objects
    • Remove the principal Users with access = special
    • Edit the principal Users > set the permission Applies to This folder only and check the advanced permission Create folders /append data
  1. Open Group Policy Management and create a GPO named “Folder Redirection” in the folder Group Policy Objects
  1. Right-click the GPO > and click Edit
  1. From the editor navigate to User Configuration > Policies> Windows Settings > Folder Redirection
  1. Right click the folder Desktop > select Properties and set the following:
    • Right click Desktop > Properties and edit as follows:
      • Setting: Basic – Redirect everyone’s folder to the same location
      • Target Folder Location: Create a folder for each user under the root path
      • Root Path: \\FS\\HomeDir$
      • ❗ Should this GPO ever be deleted/removed, set the Target Folder Location to Redirect to the local userprofile location
  1. Repeat on the Documents Folder
  1. Apply the GPO to the OU Domain_Users
  1. Test the drive mapping by logging as a domain user such as amy.li on Thinkpad> Open PowerShell and run gpupdate /force > logout
  1. Login as amy.li and wait for the GPO to be applied (the logon process will take ~3 minutes) and the Desktop and Document folder properties and view the applied GPO with gpresult /r

12.0 Create a secondary DC

Create a secondary domain controller DC2 that stores the data on a separate disk.

12.1 Create VM & Complete Post-Install Tasks

  1. ⏲❗ Checkpoint DC1 and name it “Before DC2”
  1. In Failover Cluster Manager for HV-Cluster create a new child differencing disk to ParentServer2019-core.vhdx parent
  1. Create a new VM named “DC2” with 1024 MB
  1. Complete all post install tasks and run script Appendix F with the following:
    • $IP: 192.168.3.2
    • $SrvName: DC2
    • $SrvOUPath: OU=Servers,DC=cap,DC=int
  1. Verify all post-install tasks are complete and working as per Appendix G
  1. In ADUC manually move DC2 into the Domain Controllers OU
  1. Create a 2nd vhdx named “DC2db” that is 10 GB and dynamically expanding
  1. Attach DC2db.vhdx to the virtual machine DC2
  1. Add DC2 to Server Manager
  1. From Server Manager, bring the disk online, initialize, and create a volume
  1. From PowerShell on DC2 create the directories “NTDS” and “SYSVOL” on the secondary D:\ volume

12.2 Promote DC2 to Domain Controller

  1. From DC2’s PowerShell install ADDS then verify with the following:
    • Install-windowsfeature -name AD-Domain-Services -IncludeManagementTools
    • Get-Command -Module ADDSDeployment
  1. Enter the following script to promote to domain controller
    #
    # Windows PowerShell script for AD DS Deployment
    #
    
    Import-Module ADDSDeployment
    Install-ADDSDomainController `
    -NoGlobalCatalog:$false `
    -CreateDnsDelegation:$false `
    -Credential (Get-Credential) `
    -CriticalReplicationOnly:$false `
    -DatabasePath "D:\NTDS" `
    -DomainName "cap.int" `
    -InstallDns:$true `
    -LogPath "D:\NTDS" `
    -NoRebootOnCompletion:$false `
    -SiteName "Default-First-Site-Name" `
    -SysvolPath "D:\SYSVOL" `
    -Force:$true
  1. From Server Manager, open Active Directory Sites an Services to view the replication
  1. Set DC2’s memory to 512 MB

Appendices

Appendix A: Network & IP Information

Networks

NameNetworkDetailsSubnetHost IP RangeSwitch Type
WAN192.168.1.0 /24Home Telus Network255.255.255.0 (/24)192.168.1.1 - 192.168.3.253External
LAN192.168.3.0 /28LAN255.255.255.240 (/28)192.168.3.1 - 192.168.3.14Internal
iSCSI192.168.10.0 /29iSCSI SAN255.255.255.248 (/29)192.168.10.1 - 192.168.10.6Private
HB192.168.20.0 /29Heartbeat255.255.255.248 (/29)192.168.20.1 - 192.168.20.6Private
LM192.168.30.0 /30Live Migration255.255.255.252 (/30)192.168.30.1 - 192.168.30.2Private

IP Addresses & Info

NameIPRAMNotes
DC1192.168.3.1 /28512
DC2192.168.3.2 /28512
LinDHCP192.168.3.3 /28512
SAN192.168.10.3 /29192.168.3.4 /28512
HV1192.168.10.1 /29192.168.20.1192.168.3.5 /28192.168.30.14096\\192.168.3.5\d$ (before CSV) \\192.168.3.5\c$\ClusterStorage\Volume1\
HV2192.168.10.2 /29192.168.20.2192.168.3.6 /28192.168.30.24096\\192.168.3.6\d$ (before CSV) \\192.168.3.6\c$\ClusterStorage\Volume1\
HV-Cluster192.168.3.7 /28
FILE1192.168.20.3192.168.3.8 /28512
FILE2192.168.20.4192.168.3.9 /28512
FS-Cluster192.168.3.10 /28
FS192.168.3.11 /28\\fs\Company_Data$ \\fs\HomeDir$
Thinkpad (Host)192.168.1.74 /24192.168.3.13 /2816 GB (Host)
pfSense192.168.1.10 /24192.168.3.14 /28512

Appendix B: Network Diagram

Appendix C: CAP.INT Domain ADDS Diagram

Appendix D: Server File and Storage Diagram

Appendix E: VM Server 2019 Core Creation with Child Differencing Disk

  1. On the host Thinkpad and open PowerShell as an administrator and run the following:
    #
    # Create a VM with Windows Server 2019 (Core) with 2GB Static Memory on a Differencing Disk
    # Connect to the LAN switch
    # Disable automatic checkpoints & enable VM Guest Services
    #
    $VMName = Read-Host -Prompt 'Input the VM name'
    $parentpath = "V:\VMs\VHDX\ParentServer2019-Core.vhdx"
    $VHDPath = "V:\VMs\VHDX\" + $VMName + ".vhdx"
    
    # Create VM with a differencing disk, update settings ,and start vm
    New-VHD -ParentPath $parentpath -Path $VHDPath -Differencing
    New-VM -Name $VMName -MemoryStartupBytes 2GB -VHDPath $VHDPath -Generation 2 -SwitchName LAN
    Set-VM $VMName -AutomaticCheckpointsEnabled $false
    Set-VMMemory $VMName -DynamicMemoryEnabled $false
    Enable-VMIntegrationService -VMName $VMName -Name "Guest Service Interface"
    Start-VM -Name $VMName
    VMConnect.exe
  1. From the new VM console, enter in the default admin password as Pa$$w0rd

Appendix F: Server Post-Install PS Script

  1. Complete the post installation tasks from the new VM with PowerShell with the following script:

    ❗ This script is set up for Proj.int 192.168.3.0/ 28

    #
    # Post-installation tasks
    #
    $IP = Read-Host -Prompt 'Enter IP 192.168.3.x'
    $SrvName = Read-Host -Prompt 'EnterServerNAME'
    $SrvOUPath = Read-Host -Prompt 'AD Path OU=X,OU=Servers,DC=cap,DC=int'
    $MaskBits = 28
    $Gateway = "192.168.3.14"
    $Dns = "192.168.3.1"
    $IPType = "IPv4"
    
    
    # Retrieve the network adapter that you want to configure
    $adapter = Get-NetAdapter | ? {$_.Status -eq "up"}
    # Remove any existing IP, gateway from our ipv4 adapter
    If (($adapter | Get-NetIPConfiguration).IPv4Address.IPAddress) {
     $adapter | Remove-NetIPAddress -AddressFamily $IPType -Confirm:$false
    }
    If (($adapter | Get-NetIPConfiguration).Ipv4DefaultGateway) {
     $adapter | Remove-NetRoute -AddressFamily $IPType -Confirm:$false
    }
     # Configure the IP address and default gateway
    $adapter | New-NetIPAddress `
     -AddressFamily $IPType `
     -IPAddress $IP `
     -PrefixLength $MaskBits `
     -DefaultGateway $Gateway
    # Configure the DNS client server IP addresses
    $adapter | Set-DnsClientServerAddress -ServerAddresses $DNS
    # Rename the Network Adapter
    Rename-NetAdapter -Name "Ethernet" -NewName "LAN"
    
    # Name Computer, add to Domain and OU placement
    $cred = Get-Credential cap\aidan
    Add-Computer -DomainName cap.int -Credential $cred -OUPath $SrvOUPath
    $computer = Get-WmiObject win32_computersystem
    $r = $computer.rename("$SrvName", $cred.GetNetworkCredential().Password, $cred.username)
    
    #Rename the local admin account
    Rename-LocalUser -Name "Administrator" -NewName "_lsysadmin"
    
    # Restart-Computer -Force

Appendix G: Server Post-Install Verification Checklist

  1. Login to the virtal machine using the domain admin account cap\aidan
  1. Complete the following in PowerShell
    • whoami: verify server is a domain member and that the admin aidan@cap.int is logged in
    • ipconfig: verify IPv4 address, subnet, default gateway
    • tracert google.ca: verify internet connectivity and DNS
    • ping LinDHCP: test DNS to a domain server
    • Get-LocalUser: verify the local admin account has been renamed to _lsysadmin
    • Get-NetAdapter: verify the network adapter has been renamed
  1. From sconfig (Server Configuration) complete the following options:
    • 11 Windows Activation, verify Windows is activated and has the 180 day trial
    • 6 Download and Install updates
  1. From Server Manager view the new entry in DNS Manager and ADUC
  1. Add the new VM to Server Manager
  1. ⏲ Checkpoint (optional)

Appendix H: Final Setup Screenshots

All of the virtual machines
Cluster Shared Volume that stores all FILE1, FILE2, DC2 data
Server Manager
Disk Summary
Network Shares

Appendix I: References