2017年12月16日土曜日

Windows Server Insider Preview Build 17046でHCIを構成

Windows Server Insider Preview Build 17046では、インストール時の挙動が少し変わりました。Windows Server 2016 RTMと同じ挙動になった部分があります。
そこを中心にインストールを追っかけてみます。

Windows Server Insider Preview Build 17046を4台用意し、127GBの仮想ハードディスク4台を各々の仮想マシンへマウントしておきます。

Nested Hyper-V用に下記のコマンドレットをHyper-Vホストから実行します。
Set-VMProcessor -VMName g2wsip17046s2d1 -ExposeVirtualizationExtensions $true
Get-VMNetworkAdapter -VMName g2wsip17046s2d1 | Set-VMNetworkAdapter -MacAddressSpoofing On
Get-VMProcessor -VMName g2wsip17046s2d1 |fl vmname,ExposeVirtualizationExtensions
Get-VMNetworkAdapter -VMName g2wsip17046s2d1 |fl VMName,MacAddressSpoofing

Set-VMProcessor -VMName g2wsip17046s2d2 -ExposeVirtualizationExtensions $true
Get-VMNetworkAdapter -VMName g2wsip17046s2d2 | Set-VMNetworkAdapter -MacAddressSpoofing On
Get-VMProcessor -VMName g2wsip17046s2d2 |fl vmname,ExposeVirtualizationExtensions
Get-VMNetworkAdapter -VMName g2wsip17046s2d2 |fl VMName,MacAddressSpoofing

Set-VMProcessor -VMName g2wsip17046s2d3 -ExposeVirtualizationExtensions $true
Get-VMNetworkAdapter -VMName g2wsip17046s2d3 | Set-VMNetworkAdapter -MacAddressSpoofing On
Get-VMProcessor -VMName g2wsip17046s2d3 |fl vmname,ExposeVirtualizationExtensions
Get-VMNetworkAdapter -VMName g2wsip17046s2d3 |fl VMName,MacAddressSpoofing

Set-VMProcessor -VMName g2wsip17046s2d4 -ExposeVirtualizationExtensions $true
Get-VMNetworkAdapter -VMName g2wsip17046s2d4 | Set-VMNetworkAdapter -MacAddressSpoofing On
Get-VMProcessor -VMName g2wsip17046s2d4 |fl vmname,ExposeVirtualizationExtensions
Get-VMNetworkAdapter -VMName g2wsip17046s2d4 |fl VMName,MacAddressSpoofing
各仮想マシンのOS上で実行します。
Set-Item WSMan:\localhost\Client\TrustedHosts "*"
1台のノードから、Enter-PSSessionで、サービスアカウントにローカル管理者権限を追加、Hyper-Vやフェールオーバークラスターなどの機能をインストールします。
$myServer1 = "g2wsip17046s2d1.sshzk2016.local"
$user1 = "sshzk2016\sashizaki"
$myServer2 = "g2wsip17046s2d2.sshzk2016.local"
$user2 = "sshzk2016\sashizaki"
$myServer3 = "g2wsip17046s2d3.sshzk2016.local"
$user3 = "sshzk2016\sashizaki"
$myServer4 = "g2wsip17046s2d4.sshzk2016.local"
$user4 = "sshzk2016\sashizaki"

Enter-PSSession -ComputerName $myServer1 -Credential $user1
Net localgroup Administrators sshzk2016\sa_s2dcluster /add
Install-WindowsFeature -Name "Data-Center-Bridging","Failover-Clustering","Hyper-V","RSAT-Clustering-PowerShell","Hyper-V-PowerShell" -IncludeManagementTools
shutdown -r -t 0
exit

Enter-PSSession -ComputerName $myServer2 -Credential $user2
Net localgroup Administrators sshzk2016\sa_s2dcluster /add
Install-WindowsFeature -Name "Data-Center-Bridging","Failover-Clustering","Hyper-V","RSAT-Clustering-PowerShell","Hyper-V-PowerShell" -IncludeManagementTools
shutdown -r -t 0
exit

Enter-PSSession -ComputerName $myServer3 -Credential $user3
Net localgroup Administrators sshzk2016\sa_s2dcluster /add
Install-WindowsFeature -Name "Data-Center-Bridging","Failover-Clustering","Hyper-V","RSAT-Clustering-PowerShell","Hyper-V-PowerShell" -IncludeManagementTools
shutdown -r -t 0
exit

Enter-PSSession -ComputerName $myServer4 -Credential $user4
Net localgroup Administrators sshzk2016\sa_s2dcluster /add
Install-WindowsFeature -Name "Data-Center-Bridging","Failover-Clustering","Hyper-V","RSAT-Clustering-PowerShell","Hyper-V-PowerShell" -IncludeManagementTools
shutdown -r -t 0
exit
以上で、フェールオーバークラスターを組むための準備が完了です。
Test-Cluster -node $myServer1,$myServer2,$myServer3,$myServer4 -include "Storage Spaces Direct",Inventory,Network,"System Configuration"
を実行します。

New-Cluster -name s2dcluster04 -node $myServer1,$myServer2,$myServer3,$myServer4 -noStorage -static 192.168.3.14
でフェールオーバークラスターを構成します。


Windows Server Insider Preview Build 17046ではクラスターアカウント(コンピューターアカウント)の作成とともにクラスターアカウントをDNSに動的登録してくれます。この挙動は、Windows Server 2016の挙動に戻りました~

でファイル監視をフェールオーバークラスターに設定しておきます。
※ファイル監視であれば、本来、SOFSなどの冗長構成を持たせておくのがベストです。フェールオーバークラスターには、クラウド監視も使えます。

Get-Cluster -Name s2dcluster04
で、フェールオーバークラスターが動作しているか確認しておきます。


フェールオーバークラスターが動作しているので
icm (Get-Cluster -Name s2dcluster04 | Get-ClusterNode) {
Update-StorageProviderCache
Get-StoragePool | ? IsPrimordial -eq $false | Set-StoragePool -IsReadOnly:$false -ErrorAction SilentlyContinue
Get-StoragePool | ? IsPrimordial -eq $false | Get-VirtualDisk | Remove-VirtualDisk -Confirm:$false -ErrorAction SilentlyContinue
Get-StoragePool | ? IsPrimordial -eq $false | Remove-StoragePool -Confirm:$false -ErrorAction SilentlyContinue
Get-PhysicalDisk | Reset-PhysicalDisk -ErrorAction SilentlyContinue
Get-Disk | ? Number -ne $null | ? IsBoot -ne $true | ? IsSystem -ne $true | ? PartitionStyle -ne RAW | % {
$_ | Set-Disk -isoffline:$false
$_ | Set-Disk -isreadonly:$false
$_ | Clear-Disk -RemoveData -RemoveOEM -Confirm:$false
$_ | Set-Disk -isreadonly:$true
$_ | Set-Disk -isoffline:$true
}
Get-Disk |? Number -ne $null |? IsBoot -ne $true |? IsSystem -ne $true |? PartitionStyle -eq RAW | Group -NoElement -Property FriendlyName
} | Sort -Property PsComputerName,Count
でディスクのクリーンアップを行います。


Enable-ClusterStorageSpacesDirect
でS2Dを構成します。

New-Volume -FriendlyName "Volume1" -FileSystem CSVFS_ReFS -StoragePoolFriendlyName S2D* -Size 656GB -ResiliencySettingName Mirror
で、S2DにCSVを構成します。


あとは、仮想スイッチを作れば、仮想マシンを配置できるわけです。

0 件のコメント:

コメントを投稿