|
| 1 | +# Scenario Description |
| 2 | + |
| 3 | +* In this scenario 4 node S2D cluster can be created. |
| 4 | +* It is just simulation "how it would look like". Performance is not a subject here. |
| 5 | +* It is just to test look and feel |
| 6 | + |
| 7 | + |
| 8 | +# Scenario requirements |
| 9 | + |
| 10 | +* Windows 10 1511 with enabled Hyper-V or Windows 10 1607 (if nested virtualization is enabled) |
| 11 | +* 8GB Memory or 20GB if nested virtualization is used (for 4 node configuration) |
| 12 | +* SSD (with HDD it is really slow) |
| 13 | + |
| 14 | +# Labconfig.ps1 |
| 15 | + |
| 16 | + |
| 17 | +* Without Nested Virtualization |
| 18 | +````PowerShell |
| 19 | +$LabConfig=@{ |
| 20 | + DomainAdminName='Claus'; |
| 21 | + AdminPassword='LS1setup!'; |
| 22 | + Prefix = 'S2DHyperConverged-'; |
| 23 | + SwitchName = 'LabSwitch'; |
| 24 | + DCEdition='ServerDataCenter'; |
| 25 | + VMs=@() |
| 26 | +} |
| 27 | +
|
| 28 | +1..4 | % { |
| 29 | + $VMNames="S2D"; |
| 30 | + $LABConfig.VMs += @{ |
| 31 | + VMName = "$VMNames$_" ; |
| 32 | + Configuration = 'S2D' ; |
| 33 | + ParentVHD = 'Win2016NanoHV_G2.vhdx'; |
| 34 | + SSDNumber = 0; |
| 35 | + SSDSize=800GB ; |
| 36 | + HDDNumber = 12; |
| 37 | + HDDSize= 4TB ; |
| 38 | + MemoryStartupBytes= 512MB |
| 39 | + } |
| 40 | +} |
| 41 | +```` |
| 42 | + |
| 43 | +* With Nested Virtualization |
| 44 | +````PowerShell |
| 45 | +$LabConfig=@{ |
| 46 | + DomainAdminName='Claus'; |
| 47 | + AdminPassword='LS1setup!'; |
| 48 | + Prefix = 'S2DHyperConverged-'; |
| 49 | + SwitchName = 'LabSwitch'; |
| 50 | + DCEdition='ServerDataCenter'; |
| 51 | + VMs=@() |
| 52 | +} |
| 53 | +
|
| 54 | +1..4 | % { |
| 55 | + $VMNames="S2D"; |
| 56 | + $LABConfig.VMs += @{ |
| 57 | + VMName = "$VMNames$_" ; |
| 58 | + Configuration = 'S2D' ; |
| 59 | + ParentVHD = 'Win2016NanoHV_G2.vhdx'; |
| 60 | + SSDNumber = 0; |
| 61 | + SSDSize=800GB ; |
| 62 | + HDDNumber = 12; |
| 63 | + HDDSize= 4TB ; |
| 64 | + MemoryStartupBytes= 4GB; |
| 65 | + NestedVirt=$True |
| 66 | + } |
| 67 | +} |
| 68 | +```` |
| 69 | + |
| 70 | +# Configuration Script |
| 71 | +This script needs to run in DC |
| 72 | + |
| 73 | +* This part sets some variables. For example how many nodes you want to provision or how many disks you want to create |
| 74 | +````PowerShell |
| 75 | +# 3,4,8, or 16 nodes |
| 76 | +$numberofnodes=4 |
| 77 | +
|
| 78 | +#servernames |
| 79 | +1..$numberofnodes | ForEach-Object {$servers=$servers+@("S2D$_")} |
| 80 | +
|
| 81 | +#Cluster Name |
| 82 | +$ClusterName="S2D-Cluster" |
| 83 | +
|
| 84 | +#?Networking |
| 85 | +$Networking='Yes' |
| 86 | +
|
| 87 | +#Number of MultiResiliencyDisks Created |
| 88 | +$MRTNumber=$numberofnodes |
| 89 | +```` |
| 90 | + |
| 91 | +* This part will install required roles for DC to manage features |
| 92 | +````PowerShell |
| 93 | +#install features for management |
| 94 | +Install-WindowsFeature -Name RSAT-Clustering,RSAT-Clustering-Mgmt,RSAT-Clustering-PowerShell,RSAT-Storage-Replica,RSAT-Hyper-V-Tools |
| 95 | +```` |
| 96 | + |
| 97 | +* If you want to run Core servers, then you will need to enable hyper-v and another roles. Skip if you have NanoServers |
| 98 | +````PowerShell |
| 99 | +Invoke-Command -ComputerName $servers -ScriptBlock {Enable-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V -Online -NoRestart} |
| 100 | +foreach ($server in $servers) {Install-WindowsFeature -Name Failover-Clustering,Failover-Clustering-S2D,Hyper-V-PowerShell -ComputerName $server} |
| 101 | +
|
| 102 | +#restart and wait for computers |
| 103 | +Invoke-Command -ComputerName $servers -ScriptBlock {Restart-Computer -Force} |
| 104 | +Start-Sleep 60 |
| 105 | +```` |
| 106 | + |
| 107 | +* In this part networking is configured. Just to see how SET Switch looks like and how it looks like when you have 2 vNICS. In real world scenario you would have the same for iWARP, except vNICs should be configured as vRDMA NICs |
| 108 | +````PowerShell |
| 109 | +if ($Networking -eq "Yes"){ |
| 110 | + Invoke-Command -ComputerName $servers -ScriptBlock {New-VMSwitch -Name SETSwitch -EnableEmbeddedTeaming $TRUE -MinimumBandwidthMode Weight -NetAdapterName (Get-NetIPAddress -IPAddress 10.* ).InterfaceAlias} |
| 111 | + $Servers | ForEach-Object { |
| 112 | + Rename-VMNetworkAdapter -ManagementOS -Name SETSwitch -NewName Management1 -ComputerName $_ |
| 113 | + Add-VMNetworkAdapter -ManagementOS -Name Management2 -SwitchName SETSwitch -ComputerName $_ |
| 114 | + } |
| 115 | + Start-Sleep 5 |
| 116 | + Clear-DnsClientCache |
| 117 | +} |
| 118 | +```` |
| 119 | + |
| 120 | +* Test and Create new cluster. ClearDNSCLientCace is the same as ipconfig /flushdns. Its needed to know about new cluster dns record. |
| 121 | + |
| 122 | +````PowerShell |
| 123 | +Test-Cluster –Node $servers –Include “Storage Spaces Direct”,Inventory,Network,”System Configuration” |
| 124 | +New-Cluster –Name $ClusterName –Node $servers |
| 125 | +Start-Sleep 5 |
| 126 | +Clear-DnsClientCache |
| 127 | +```` |
| 128 | + |
| 129 | +* Enable S2D. It is specific to TP5 as you need to skip automatic configuration and skip eligibility checks (because all disks report with mediatype unknown, therefore eligibility check would fail) |
| 130 | + |
| 131 | +```PowerShell |
| 132 | +Enable-ClusterS2D -CimSession $ClusterName -AutoConfig:0 |
| 133 | +```` |
| 134 | +
|
| 135 | +* To work with remote storage subsystem from DC, it is useful to register it with this command. I'm using $ClusterName, so I'll always work with some node that's online. |
| 136 | +```PowerShell |
| 137 | +Get-StorageProvider | Register-StorageSubsystem -ComputerName $ClusterName |
| 138 | +```` |
| 139 | +
|
| 140 | +* Display what was configured with Enable-Clusters2D |
| 141 | +```PowerShell |
| 142 | +#display pool |
| 143 | +$pool=Get-StoragePool *$Clustername |
| 144 | +$pool |
| 145 | +
|
| 146 | +#Display disks |
| 147 | +Get-StoragePool *$Clustername | Get-PhysicalDisk |
| 148 | +
|
| 149 | +#display tiers (notice only capacity is available and is ) |
| 150 | +Get-StorageTier |
| 151 | +```` |
| 152 | +
|
| 153 | +* Create virtual disks. |
| 154 | +
|
| 155 | +```PowerShell |
| 156 | +if ($numberofnodes -le 3){ |
| 157 | + 1..$MRTNumber | ForEach-Object { |
| 158 | + New-Volume -StoragePoolFriendlyName $pool.FriendlyName -FriendlyName MultiResiliencyDisk$_ -FileSystem CSVFS_ReFS -StorageTierFriendlyNames Capacity -StorageTierSizes 2TB |
| 159 | + } |
| 160 | +}else{ |
| 161 | + 1..$MRTNumber | ForEach-Object { |
| 162 | + New-Volume -StoragePoolFriendlyName $pool.FriendlyName -FriendlyName MultiResiliencyDisk$_ -FileSystem CSVFS_ReFS -StorageTierFriendlyNames performance,capacity -StorageTierSizes 1TB,9TB |
| 163 | + } |
| 164 | +} |
| 165 | +start-sleep 10 |
| 166 | +```` |
| 167 | +
|
| 168 | +* Rename all CSVs to match virtual disks names |
| 169 | +```PowerShell |
| 170 | +Get-ClusterSharedVolume -Cluster $ClusterName | % { |
| 171 | + $volumepath=$_.sharedvolumeinfo.friendlyvolumename |
| 172 | + $newname=$_.name.Substring(22,$_.name.Length-23) |
| 173 | + Invoke-Command -ComputerName (Get-ClusterSharedVolume -Cluster $ClusterName -Name $_.Name).ownernode -ScriptBlock {param($volumepath,$newname); Rename-Item -Path $volumepath -NewName $newname} -ArgumentList $volumepath,$newname -ErrorAction SilentlyContinue |
| 174 | +} |
| 175 | +```` |
| 176 | +
|
| 177 | +* Configure Quorum (File Share Witness) |
| 178 | +
|
| 179 | +```PowerShell |
| 180 | +###Configure quorum### |
| 181 | +#ConfigureWitness |
| 182 | +#Create new directory |
| 183 | +$WitnessName=$Clustername+"Witness" |
| 184 | +Invoke-Command -ComputerName DC -ScriptBlock {param($WitnessName);new-item -Path c:\Shares -Name $WitnessName -ItemType Directory} -ArgumentList $WitnessName |
| 185 | +$accounts=@() |
| 186 | +$Servers | % {$accounts+="corp\$_$"} |
| 187 | +$accounts+="corp\$ClusterName$" |
| 188 | +$accounts+="corp\Domain Admins" |
| 189 | +New-SmbShare -Name $WitnessName -Path "c:\Shares\$WitnessName" -FullAccess $accounts -CimSession DC |
| 190 | +# Set NTFS permissions |
| 191 | +Invoke-Command -ComputerName DC -ScriptBlock {param($WitnessName);(Get-SmbShare "$WitnessName").PresetPathAcl | Set-Acl} -ArgumentList $WitnessName |
| 192 | +#Set Quorum |
| 193 | +Set-ClusterQuorum -Cluster $ClusterName -FileShareWitness "\\DC\$WitnessName" |
| 194 | +
|
| 195 | +```` |
| 196 | +
|
| 197 | +# How it looks like end-to-end (when you just paste the script). |
| 198 | +Note, there are small differences (we did not configure fault domains, but it is displayed on GIF as I did it a while ago. |
| 199 | +
|
| 200 | + |
0 commit comments