以下螢幕截圖呈現切換式網路上兩個節點 HCI 叢集的環境。 以下 PowerShell 資訊已針對此組態進行調整,但對於具有更多節點和無交換器網路拓撲的叢集進行修改仍有用。
您可以在可下載的 .PDF 版本「Microsoft HCI Solutions from Dell Technologies」部署指南第 12 至 21 頁找到以下腳本範例和安裝程式。
在叢集節點已安裝作業系統、新增至 Active Directory 網域,且日後的叢集網路已到位後,指令檔便會執行步驟。
組態專案:
- Windows 功能安裝:Hyper-V、容錯移轉叢集、資料中心橋接、BitLocker、FS-FileServer、RSAT-Clustering-PowerShell、FS-Data-重復資料刪除
- 驅動程式更新檢查: 檢查支援矩陣
- 重新命名叢集節點
- 叢集測試、驗證
- 建立 S2D 叢集
- Enable Storage Spaces Direct
- 設定主機「管理」網路優先順序以進行即時移轉
- 頁面檔案設定:允許記憶體傾印空間
- 設定叢集見證
- 空格埠逾時組態
下列腳本範例應針對部署 HCI 叢集的環境進行調整。 必須修改伺服器名稱、叢集名稱、叢集共用名稱稱和 IP 資訊,以符合安裝環境參數。
將下面的腳本文字複製到預期的部署指令檔時,請務必不要包裝 PowerShell 文字。
#Windows功能安裝:
Install-WindowsFeature -Name Hyper-V, Failover-Clustering, Data-Center-Bridging, BitLocker, FS-FileServer, RSAT-Clustering-PowerShell, FS-Data-Deduplication -IncludeAllSubFeature
-IncludeManagementTools -verbose
#Retrieve驅動程式版本清單:
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*") }
#Assign叢集節點名稱:
Rename-Computer -NewName CN01 -Restart
#Cluster測試
Test-Cluster -Node CN01, CN02 –Include 'Storage Spaces Direct', 'Inventory', 'Network', 'System Configuration'
#Find儲存集區磁片的狀態
Get-PhysicalDisk
#Creating新的 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
#Enabling Storage Spaces Direct:
Enable-ClusterS2D -Verbose
##Capturing先前命令的結果
Get-ClusterS2D
Get-StoragePool
Get-StorageSubSystem -FriendlyName *Cluster* | Get-StorageHealthReport
#Configure以較低優先順序執行即時移轉的主機管理網路:
$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
#Page檔案設定,以確保可以擷取記憶體傾印:
$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
#Disable SMB 簽署;正常 Windows Server 安裝預設為停用
Set-SmbServerConfiguration -RequireSecuritySignature $FALSE -force
#Spaces埠逾時組態變更:
Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\spaceport \Parameters -Name HwTimeout -Value 0x00002710 -Verbose Restart-Computer -Force