# Deploying a Hyper-V Failover Cluster on Windows Server 2025 CoreWindows Server 2025 Datacenter Core
# Deployment requirements・ Installing Active Directory Domain Controller on Windows Server 2019 ・ Upgrade and conversion options for Windows Server
DISM / online / Get-CurrentEdition DISM / online / Set-Edition :ServerDatacenterCor / ProductKey:D764K-2NDRG-47T6Q-P8T8W-YP6DF / AcceptEula slmgr. vbs / dlv slmgr / ipk <key>
# System Configuration# Create the LBFO teaming, assign interface IP address.New-NetLbfoTeam - Name "Team_Mgmt" - TeamMembers "Integrated NIC 1 Port 1-1" , "SLOT 3 Port 1" - TeamingMode SwitchIndependent - LoadBalancingAlgorithm Dynamic - Confirm:$false Get-NetLbfoTeamMember - Team "Team_Mgmt" New-NetIPAddress - InterfaceAlias "Team_Mgmt" - IPAddress 10. 10. 10. 221 - AddressFamily IPv4 - PrefixLength 24 - DefaultGateway 10. 10. 10. 1New-NetIPAddress - InterfaceAlias "Team_Mgmt" - IPAddress 10. 10. 10. 222 - AddressFamily IPv4 - PrefixLength 24 - DefaultGateway 10. 10. 10. 1Set-DnsClientServerAddress - InterfaceAlias "Team_Mgmt" - ServerAddresses ( "10.10.10.206" , "10.10.10.207" ) Get-NetIPConfiguration - InterfaceAlias "Team_Mgmt" - DetailedNew-NetLbfoTeam - Name "Team_Htbt" - TeamMembers "Integrated NIC 1 Port 2-1" , "SLOT 3 Port 2" - TeamingMode SwitchIndependent - LoadBalancingAlgorithm Dynamic - Confirm:$false Get-NetLbfoTeamMember - Team "Team_Htbt" New-NetIPAddress - InterfaceAlias "Team_Htbt" - IPAddress 100. 100. 100. 221 - AddressFamily IPv4 - PrefixLength 24New-NetIPAddress - InterfaceAlias "Team_Htbt" - IPAddress 100. 100. 100. 222 - AddressFamily IPv4 - PrefixLength 24
# Rename computer, join a domain.Rename-Computer - NewName "HYPERV01" - RestartRename-Computer - NewName "HYPERV02" - RestartAdd-Computer - DomainName sj. local - DomainCredential 'sj\hypervadmin' Add-LocalGroupMember - Group "Administrators" - Member 'sj\hypervadmin' Get-LocalGroupMember - Group "Administrators" Restart-Computer
# Set date and timezone.Set-TimeZone - Id "China Standard Time" - PassThruw32tm / config / manualpeerlist:"156.xxx.xxx.170" / syncfromflags:manual / update w32tm / resync w32tm / query / status w32tm / query / source net stop w32time net start w32time
# Install Failover Clustering, Hyper-V and NetworkATC roles.Install-WindowsFeature - Name "Hyper-V" , "Failover-Clustering" , "NetworkATC" - IncludeAllSubFeature - IncludeManagementToolsRestart-Computer
# Installing Hitachi HDLM Software.mkdir C:\Soft Copy-Item - Path "E:\Temp\DLMforHV_090101.iso" - Destination "C:\Soft\" Copy-Item - Path "E:\Temp\HDS VSP GX00 SN410662 D103 122415012300.plk" - Destination "C:\hdlm_license" Mount - DiskImage - ImagePath "C:\Soft\DLMforHV_090101.iso" G:\HDLM_Windows\DLMTools\installhdlm - f G:\HDLM_Windows\DLMTools\sample_installhdlm. ini Dismount-DiskImage - ImagePath "C:\Soft\DLMforHV_090101.iso" Get-Disk Set-Disk 1 - ErrorAction Stop - IsOffline $false Set-Disk 2 - ErrorAction Stop - IsOffline $false Set-Disk 3 - ErrorAction Stop - IsOffline $false Set-Disk 4 - ErrorAction Stop - IsOffline $false Initialize-Disk - Number 1 - PartitionStyle GPTInitialize-Disk - Number 2 - PartitionStyle GPTInitialize-Disk - Number 3 - PartitionStyle GPTInitialize-Disk - Number 4 - PartitionStyle GPTNew-Partition - DiskNumber 1 - UseMaximumSize | Format-Volume - FileSystem NTFS - NewFileSystemLabel "vmdata01" - Confirm:$false New-Partition - DiskNumber 2 - UseMaximumSize | Format-Volume - FileSystem NTFS - NewFileSystemLabel "vmdata02" - Confirm:$false New-Partition - DiskNumber 3 - UseMaximumSize | Format-Volume - FileSystem NTFS - NewFileSystemLabel "vmdata03" - Confirm:$false New-Partition - DiskNumber 4 - UseMaximumSize - DriveLetter Q | Format-Volume - FileSystem NTFS - NewFileSystemLabel "quorum" - Confirm:$false
PS C:\> Get-PnpDevice | Where-Object { $_ . Status -ne "OK" } | Format-Table - AutoSizeStatus Class FriendlyName InstanceId -- -- -- -- -- - -- -- -- -- -- -- -- -- -- -- -- Unknown CDROM Microsoft Virtual DVD-ROM SCSI\CDROM&VEN_MSFT&PROD_VIRTUAL_DVD-ROM\2&1F4ADFFE&0&000001 Degraded System Microsoft Multi-Path Device Specific Module ROOT\MPIO\0001 Degraded System HDLM Multi-Path Device Specific Module ROOT\MPIO\0002 Unknown SCSIAdapter Microsoft VHD Loopback Controller { 8E7BD593-6E6C-4C52-86A6-77175494DD8E} \MSVHDHBA\1&3030E83&0&01
# (Option) Disable Credential GuardPS C:\> ( Get-CimInstance - ClassName Win32_DeviceGuard - Namespace root\Microsoft\Windows\DeviceGuard) . SecurityServicesRunning1 PS C:\> notepad disable_deviceguard. regWindows Registry Editor Version 5. 00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa] "LsaCfgFlags" =dword:00000000[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard] "LsaCfgFlags" =dword:00000000PS C:\> Start-Process . \disable_deviceguard. regPS C:\> Get-ItemProperty - Path "Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa" - Name LsaCfgFlagsPS C:\> Get-ItemProperty - Path "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard" - Name LsaCfgFlagsPS C:\> ( Get-CimInstance - ClassName Win32_DeviceGuard - Namespace root\Microsoft\Windows\DeviceGuard) . SecurityServicesRunning0 PS C:\> Restart-Computer
0: Credential Guard is disabled (not running) 1: Credential Guard is enabled (running)
・ Configure Credential Guard
# Hyper-V Failover Cluster# Create a Failover Cluster.Test-Cluster - Node "HYPERV01" , "HYPERV02" - Include "Storage" , "Inventory" , "Network" , "System Configuration" New-Cluster - Name "VMCluster" - Node "HYPERV01" , "HYPERV02" - StaticAddress "10.10.10.208" - NoStorageGet-ClusterAvailableDisk - Cluster "VMCluster" | Add-ClusterDisk Set-ClusterQuorum - Cluster "VMCluster" - NodeAndDiskMajority "Cluster Disk 1" Add-ClusterSharedVolume - Cluster "VMCluster" - Name "Cluster Disk 2" Add-ClusterSharedVolume - Cluster "VMCluster" - Name "Cluster Disk 3" Add-ClusterSharedVolume - Cluster "VMCluster" - Name "Cluster Disk 4" Get-ClusterSharedVolume - Cluster "VMCluster"
# Create Hyper-V vSwitches.Get-NetAdapter - Physical | Format-Table Name, InterfaceDescription, StatusNew-VMSwitch - Name "Internet_vSwitch" - NetAdapterName "Embedded NIC 1" - AllowManagementOS $false New-VMSwitch - Name "OA_vSwitch" - NetAdapterName "Integrated NIC 1 Port 3-1" , "SLOT 3 Port 3" - EnableEmbeddedTeaming $true - AllowManagementOS $false Set-VMSwitchTeam - Name "OA_vSwitch" - LoadBalancingAlgorithm DynamicGet-VMSwitchTeam - Name "OA_vSwitch" New-VMSwitch - Name "iDMZ_vSwitch" - NetAdapterName "Integrated NIC 1 Port 4-1" , "SLOT 3 Port 4" - EnableEmbeddedTeaming $true - AllowManagementOS $false Set-VMSwitchTeam - Name "iDMZ_vSwitch" - LoadBalancingAlgorithm DynamicGet-VMSwitchTeam - Name "iDMZ_vSwitch"
# Setting Live Migration on Each Host.Enable-VMMigration Get-VMHost | Select-Object Name, VirtualMachineMigrationEnabled, VirtualMachineMigrationAuthenticationType, VirtualMachineMigrationPerformanceOption, MaximumVirtualMachineMigrations, UseAnyNetworkForMigration, VirtualMachineMigrationNetworks Set-VMHost - UseAnyNetworkForMigration $true ( Get-Cluster ) . MaximumParallelMigrations = 5Set-VMHost VirtualMachineMigrationPerformanceOption TCPIP
# Remove network adapter binding.Get-NetAdapterBinding - ComponentID "vms_pp" Disable-NetAdapterBinding - Name "Integrated NIC 1 Port 3-1" , "SLOT 3 Port 3" - ComponentID "vms_pp"
# Create a Temp internat vSwitch.New-VMSwitch - Name "Internet_vSwitch" - NetAdapterName "Embedded NIC 1" - AllowManagementOS $true Remove-VMSwitch - Name "Internet_vSwitch" Get-NetAdapter - InterfaceAlias "Embedded NIC 1" | Remove-NetIPAddress - Confirm:$false Get-NetAdapter - InterfaceAlias "Embedded NIC 1" | Set-NetIPInterface - Dhcp Disabled
# WSManCredSSP.Get-Item WSMan:localhost\client\TrustedHosts
# SCVMM CimClass.Get-CimClass - Namespace root/virtualization/v2 - classname * vmm*
# Troubleshooting# The Cluster IP ConflictIssue: Cluster IP address resource 'Cluster IP Address' cannot be brought online because a duplicate IP address '192.168.3.210' was detected on the network. Please ensure all IP addresses are unique.
PS C:\> Get-ClusterResource Name State OwnerGroup ResourceType -- -- -- -- - -- -- -- -- -- -- -- -- -- -- -- Cluster Disk 1 Online Cluster Group Physical Disk Cluster IP Address Failed Cluster Group IP Address Cluster Name Offline Cluster Group Network Name Storage Qos Resource Online Cluster Group Storage QoS Policy Manager User Manager Online User Manager Group User Manager Virtual Machine Cluster WMI Online Cluster Group Virtual Machine Cluster WMI Virtual Machine Configuration Rocky Online Rocky Virtual Machine Configuration Virtual Machine Rocky Online Rocky Virtual Machine
Workaround: Change a new cluster ip address.
PS C:\> $clusterResource = Get-ClusterResource - Name "Cluster IP Address" PS C:\> Set-ClusterParameter - InputObject $clusterResource - Name "Address" - Value "192.168.3.213" PS C:\> Start-ClusterResource - Name "Cluster IP Address" Name State OwnerGroup ResourceType -- -- -- -- - -- -- -- -- -- -- -- -- -- -- -- Cluster IP Address Online Cluster Group IP Address PS C:\> Get-ClusterResource Name State OwnerGroup ResourceType -- -- -- -- - -- -- -- -- -- -- -- -- -- -- -- Cluster Disk 1 Online Cluster Group Physical Disk Cluster IP Address Online Cluster Group IP Address Cluster Name Online Cluster Group Network Name Storage Qos Resource Online Cluster Group Storage QoS Policy Manager User Manager Online User Manager Group User Manager Virtual Machine Cluster WMI Online Cluster Group Virtual Machine Cluster WMI Virtual Machine Configuration Rocky Online Rocky Virtual Machine Configuration Virtual Machine Rocky Online Rocky Virtual Machine PS C:\> ipconfig / flushdns