Install-WindowsFeature -Name Hyper-V, Failover-Clustering, Data-Center-Bridging, BitLocker, FS-FileServer, RSAT-Clustering-PowerShell, FS-Data-Deduplication -IncludeAllSubFeature -IncludeManagementTools -verbose擷取驅動程式版本清單:
Get-PnpDevice | Select-Object Name, @{l='DriverVersion';e={(Get-PnpDeviceProperty -InstanceId $_.InstanceId -KeyName 'DEVPKEY_Device_DriverVersion').Data}} -Unique | Where-Object {($_.Name -like "*HBA*") -or ($_.Name -like "*mellanox*") -or ($_.Name -like "*Qlogic*") -or ($_.Name -like "*X710*") -or ($_.Name -like "*intel*") -or ($_.Name -like "*Broadcom*") -or ($_.Name -like "*marvell*") }指派叢集節點名稱:
Rename-Computer -NewName CN01 -Restart叢集測試
Test-Cluster -Node CN01, CN02 –Include 'Storage Spaces Direct', 'Inventory', 'Network', 'System Configuration'尋找儲存集區磁碟的狀態
Get-PhysicalDisk建立新的 S2D 叢集
New-Cluster -Name S2DSystem -Node CN01, CN02 -StaticAddress 192.168.10.33 -NoStorage -IgnoreNetwork 172.16.103.0/24, 172.16.104.0/24 -Verbose啟用 Storage Spaces Direct:
Enable-ClusterS2D -Verbose擷取先前命令的結果
Get-ClusterS2D Get-StoragePool Get-StorageSubSystem -FriendlyName *Cluster* | Get-StorageHealthReport以較低的優先順序設定主機管理網路以進行即時遷移:
$clusterResourceType = Get-ClusterResourceType -Name 'Virtual Machine' $hostNetworkID = Get-ClusterNetwork | Where-Object { $_.Address -eq ‘192.168.10.0’ } | Select-Object -ExpandProperty ID $otherNetworkID = (Get-ClusterNetwork).Where({$_.ID -ne $hostnetworkID}).ID $newMigrationOrder = ($otherNetworkID + $hostNetworkID) -join ';' Set-ClusterParameter -InputObject $clusterResourceType -Name MigrationNetworkOrder -Value $newMigrationOrder Set-VmHost -VirtualMachine MigrationPerformanceOption SMB分頁檔設定,以確保可以擷取記憶體傾印:
$blockCacheMB = (Get-Cluster).BlockCacheSize $blockCacheMB = (Get-Cluster).BlockCacheSize $pageFilePath = "C:\pagefile.sys" $initialSize = [Math]::Round(51200 + $blockCacheMB) $maximumSize = [Math]::Round(51200 + $blockCacheMB) $system = Get-WmiObject -Class Win32_ComputerSystem -EnableAllPrivileges if ($system.AutomaticManagedPagefile) { $system.AutomaticManagedPagefile = $false $system.Put() } $currentPageFile = Get-WmiObject -Class Win32_PageFileSetting if ($currentPageFile.Name -eq $pageFilePath) { $currentPageFile.InitialSize = $InitialSize $currentPageFile.MaximumSize = $MaximumSize $currentPageFile.Put() }else{ $currentPageFile.Delete() Set-WmiInstance -Class Win32_PageFileSetting -Arguments @{Name=$pageFilePath; InitialSize = $initialSize; MaximumSize = $maximumSize} } #Configure cluster witness. Active Directory Cluster Name Object must be given write access on file #share before running this step: Set-ClusterQuorum -NodeAndFileShareMajority \\VDC01\ClusterQuorum
停用 Server Message Block (SMB) 簽署;在正常 Windows Server 安裝時預設為停用。
Set-SmbServerConfiguration -RequireSecuritySignature $FALSE -force空白埠逾時組態變更:
Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\spaceport \Parameters -Name HwTimeout -Value 0x00002710 -Verbose Restart-Computer -Force