70-740, Teil 5.3.4. Ein hyperkonvergiertes „Direkte Speicherplätze“-Szenario in einem Cluster implementieren

70-740, Teil 5.3.4.

Ein hyperkonvergiertes „Direkte Speicherplätze“-Szenario in einem Cluster implementieren

Ideen für die Recherche im Web:

hyperkonvergenten Direkte Speicherplätze

Zum Nachschlagen:

https://docs.microsoft.com/de-de/windows-server/storage/storage-spaces/storage-spaces-direct-overview

https://docs.microsoft.com/de-de/windows-server/storage/storage-spaces/hyper-converged-solution-using-storage-spaces-direct

https://docs.microsoft.com/de-de/windows-server/storage/storage-spaces/create-volumes

https://docs.microsoft.com/de-de/windows-server/storage/storage-spaces/create-volumes

https://docs.microsoft.com/de-de/windows-server/storage/storage-spaces/add-nodes

https://blogs.technet.microsoft.com/larryexchange/2015/11/02/performance-consideration-for-disaggregated-and-hyper-converged-configurations/

Übungen:

#Beispiel 1

$mountResult = Mount-DiskImage -ImagePath „D:\iso\Windows2016.iso“ -PassThru

$mountResult | Get-Volume

$driveLetter = (($mountResult | Get-Volume).DriveLetter) + „:\“

$isoPath=$driveLetter + „NanoServer\NanoServerImageGenerator“

$isoPath

If(Test-Path „C:\NanoServerImageGenerator“)
{
}
else
{
Copy-Item $isoPath -Destination C:\ -Recurse
}

cd C:\NanoServerImageGenerator

Get-ExecutionPolicy
# Bei Bedarf: Set-ExecutionPolicy RemoteSigned
# https://technet.microsoft.com/de-de/library/ee176961.aspx

Import-Module .\NanoServerImageGenerator -Verbose

#get-help New-NanoServerImage -ShowWindow

#get-help New-NanoServerImage -Online

dir $driveLetter

Get-VMSwitch
$Switchname=(Get-VMSwitch | where {$_.SwitchType -eq “External”}).Name
echo $Switchname
$Secure = Read-Host -AsSecureString
#https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/convertto-securestring?view=powershell-5.1

1..3 | % {
######New-NanoServerImage -DeploymentType Guest -Edition Datacenter -TargetPath E:\NanoServerImageGenerator\MF$_.vhdx -Clustering -Compute -ComputerName MF$_ -Containers -DomainName kaffee.pause -EnableRemoteManagementPort -InterfaceNameOrIndex Ethernet -Ipv4Address 10.5.2.5$_ -Ipv4Dns 10.5.2.10 -Ipv4Gateway 10.0.2.1 -Ipv4SubnetMask 255.0.0.0 -MaxSize 100GB -MediaPath $driveLetter -Package Microsoft-NanoServer-DNS-Package -ReuseDomainNode -Storage -AdministratorPassword $Secure
#https://docs.microsoft.com/en-us/powershell/module/nanoserverimagegenerator/new-nanoserverimage?view=win10-ps

New-VM -VHDPath E:\NanoServerImageGenerator\MF$_.vhdx -Generation 2 -MemoryStartupBytes 1GB -Name MF$_ -SwitchName $Switchname
#https://technet.microsoft.com/de-de/library/hh848537.aspx

New-VHD –Path E:\NanoServerImageGenerator\MFfAc$_.vhdx –SizeBytes 10GB

Add-VMHardDiskDrive -VMName MF$_ -Path E:\NanoServerImageGenerator\MFfAc$_.vhdx

New-VHD –Path E:\NanoServerImageGenerator\MFfBc$_.vhdx –SizeBytes 10GB

Add-VMHardDiskDrive -VMName MF$_ -Path E:\NanoServerImageGenerator\MFfBc$_.vhdx

New-VHD –Path E:\NanoServerImageGenerator\MFfCc$_.vhdx –SizeBytes 10GB

Add-VMHardDiskDrive -VMName MF$_ -Path E:\NanoServerImageGenerator\MFfCc$_.vhdx

Start-VM -VMName MF$_

$User_Name=“MF$_“+“\administrator“

$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User_Name,$Secure

Invoke-Command -VMName MF$_ -Credential $Credential -ScriptBlock {Get-NetFirewallRule -DisplayGroup „*Remote*“ | ft DisplayName, Enabled}

Invoke-Command -VMName MF$_ -Credential $Credential -ScriptBlock {Get-NetFirewallRule -DisplayGroup „*Remote*“ | Enable-NetFirewallRule}

Invoke-Command -VMName MF$_ -Credential $Credential -ScriptBlock {Get-NetFirewallRule –Name “FPS-ICMP4-ERQ-Out” | Enable-NetFirewallRule}

}

###

New-Cluster -name MFNanoCluster1 -Node MF1, MF2, MF3 -StaticAddress 10.5.2.100 -S2D

###

#Beispiel 2

Get-VMSwitch * | Format-Table Name

$C=“C“

1..3| %{

New-VM -Name ClusterNod$_ -MemoryStartupBytes 2GB -BootDevice VHD -NewVHDPath E:\VMs\Nod$_$C.vhdx -Path E:\VMData -NewVHDSizeBytes 20GB -Generation 2 -Switch VSExtern

}

##VM Starten

1..3| %{

Start-VM -Name ClusterNod$_

}

### Firewall regeln setzen für alle 3 Computer
###Get-NetFirewallRule | fl DisplayGroup

1..3| %{

Enter-PSSession -VMname ClusterNod$_

Get-NetFirewallRule -DisplayGroup *cluster* | fl name, displayname

Set-NetFirewallRule -DisplayGroup „Failovercluster“

Enable-NetFirewallRule -DisplayGroup „Datei- und Druckerfreigabe“

Enable-NetFirewallRule -DisplayGroup „Remote-Ereignisprotokollverwaltung“

Enable-NetFirewallRule -DisplayGroup „Remotedienstverwaltung“

Enable-NetFirewallRule -DisplayGroup „Windows-Firewallremoteverwaltung“

Exit-PSSession

}

$Session_ClusterNod1 = New-PSSession -VMName ClusterNod1

$Session_ClusterNod2 = New-PSSession -VMName ClusterNod2

$Session_ClusterNod3 = New-PSSession -VMName ClusterNod3

invoke-command -Session $Session_ClusterNod1, $Session_ClusterNod2,$Session_ClusterNod3 {hostname}

invoke-command -Session $Session_ClusterNod1 {Rename-Computer -NewName ClusterNod1 -Restart}

invoke-command -Session $Session_ClusterNod2 {Rename-Computer -NewName ClusterNod2 -Restart}

invoke-command -Session $Session_ClusterNod3 {Rename-Computer -NewName ClusterNod3 -Restart}

invoke-command -Session $Session_ClusterNod1, $Session_ClusterNod2,$Session_ClusterNod3 {hostname}

$User_Name_Local=“administrator“

$Secure_Local = Read-Host -AsSecureString

$Credential_Local = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User_Name_Local,$Secure_Local

$Session_ClusterNod1 = New-PSSession -VMName ClusterNod1 -Credential $Credential_Local

$Session_ClusterNod2 = New-PSSession -VMName ClusterNod2 -Credential $Credential_Local

$Session_ClusterNod3 = New-PSSession -VMName ClusterNod3 -Credential $Credential_Local

$User_Name_AD=“kaffee\administrator“

$Secure_AD = Read-Host -AsSecureString

$Credential_AD = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User_Name_AD,$Secure_AD

invoke-command -Session $Session_ClusterNod1, $Session_ClusterNod2,$Session_ClusterNod3 {Add-Computer -Domain „kaffee.pause“ -LocalCredential administrator -Credential kaffee\administrator -Restart}

invoke-command -Session $Session_ClusterNod1, $Session_ClusterNod2,$Session_ClusterNod3 {Get-NetIPAddress -AddressFamily IPv4 -InterfaceAlias Ethernet | fl InterfaceIndex, IPAddress, InterfaceAlias}

invoke-command -Session $Session_ClusterNod1 {

Set-NetIPInterface -InterfaceAlias Ethernet -Dhcp Disabled

New-NetIPAddress -InterfaceAlias Ethernet -IPAddress 10.5.4.101 -DefaultGateway 10.0.4.1 -PrefixLength 8

Set-DNSClientServerAddress -InterfaceAlias Ethernet -ServerAddresses 10.5.4.10

ipconfig /all

}

invoke-command -Session $Session_ClusterNod2 {

Set-NetIPInterface -InterfaceAlias Ethernet -Dhcp Disabled

New-NetIPAddress -InterfaceAlias Ethernet -IPAddress 10.5.4.102 -DefaultGateway 10.0.4.1 -PrefixLength 8

Set-DNSClientServerAddress -InterfaceAlias Ethernet -ServerAddresses 10.5.4.10

ipconfig /all

}

invoke-command -Session $Session_ClusterNod3 {

Set-NetIPInterface -InterfaceAlias Ethernet -Dhcp Disabled

New-NetIPAddress -InterfaceAlias Ethernet -IPAddress 10.5.4.103 -DefaultGateway 10.0.4.1 -PrefixLength 8

Set-DNSClientServerAddress -InterfaceAlias Ethernet -ServerAddresses 10.5.4.10

ipconfig /all

}

invoke-command -Session $Session_ClusterNod1, $Session_ClusterNod2,$Session_ClusterNod3 {Get-NetIPAddress -AddressFamily IPv4 -InterfaceAlias Ethernet | fl InterfaceIndex, IPAddress, InterfaceAlias; ipconfig /all}

invoke-command -Session $Session_ClusterNod1,$Session_ClusterNod2,$Session_ClusterNod3 {Add-Computer -Domain „kaffee.pause“ -LocalCredential administrator -Credential kaffee\administrator -Restart}

Get-VM ClusterNod*

### oder Alternative

invoke-command -ComputerName ClusterNod1,ClusterNod2,ClusterNod3 -ScriptBlock {

Get-NetFirewallRule -DisplayGroup *cluster* | fl name, displayname

Set-NetFirewallRule -DisplayGroup „Failovercluster“

Enable-NetFirewallRule -DisplayGroup „Datei- und Druckerfreigabe“

Enable-NetFirewallRule -DisplayGroup „Remote-Ereignisprotokollverwaltung“

Enable-NetFirewallRule -DisplayGroup „Remotedienstverwaltung“

Enable-NetFirewallRule -DisplayGroup „Windows-Firewallremoteverwaltung“

}

 

### Rollen Instalieren

1..3| %{

Install-WindowsFeature -Name Failover-Clustering, File-Services -ComputerName ClusterNod$_ -IncludeAllSubFeature -IncludeManagementTools -Restart

#Install-WindowsFeature -Name Hyper-V -ComputerName ClusterNod$_ -IncludeAllSubFeature -IncludeManagementTools -Restart

}

### Zusätzliche Virtuelle Festplatten einrichten

###Nod1 bis 3

$D=“D“
$E=“E“
$F=“F“
1..3| %{

#Start-VM -Name ClusterNod$_

New-VHD -Path E:\Nod$_$D.vhdx -SizeBytes 20GB -Dynamic -LogicalSectorSizeBytes 4096 -PhysicalSectorSizeBytes 4096

New-VHD -Path E:\Nod$_$E.vhdx -SizeBytes 20GB -Dynamic -LogicalSectorSizeBytes 4096 -PhysicalSectorSizeBytes 4096

New-VHD -Path E:\Nod$_$F.vhdx -SizeBytes 20GB -Dynamic -LogicalSectorSizeBytes 4096 -PhysicalSectorSizeBytes 4096

#Stop-VM -Name ClusterNod$_

}

$D=“D“

$E=“E“

$F=“F“

1..3| %{

#Start-VM -Name ClusterNod$_

Add-VMHardDiskDrive -VMName ClusterNod$_ -Path E:\Nod$_$D.vhdx

Add-VMHardDiskDrive -VMName ClusterNod$_ -Path E:\Nod$_$E.vhdx

Add-VMHardDiskDrive -VMName ClusterNod$_ -Path E:\Nod$_$F.vhdx

#Stop_VM -Name ClusterNod$_

}

### Cluster erstellen mit Hilfe von Failovercluster-Mamager

start-vm -VMName ClusterNod*

Test-Cluster -Node ClusterNod1, ClusterNod2, ClusterNod3 -Include „Storage Spaces Direct“

dir C:\Windows\Cluster\Reports\

Get-Cluster CoreCluster1

#Remove-Cluster CoreCluster1
#Get-Cluster CoreCluster1

New-Cluster -Name CoreCluster1 -Node ClusterNod1, ClusterNod2, ClusterNod3 -StaticAddress 10.5.4.100 -NoStorage

Get-Cluster CoreCluster1

Get-Cluster -Name CoreCluster1 | fl *

Get-Cluster -Name CoreCluster1 | fl Name, S2DEnabled

Get-ClusterNode -Cluster CoreCluster1

Enter-PSSession -VMName ClusterNod1

Get-PhysicalDisk

Exit-PSSession

Get-SMBShare

dir D:\ClusterZeuge

mkdir D:\ClusterZeuge

dir D:\ClusterZeuge

New-SmbShare -Name „ClusterZeuge“ -Path „D:\ClusterZeuge“ -FullAccess „Kaffee\Administrator“, „Kaffee\CoreCluster1$“, „Kaffee\ClusterNode1$“,“Kaffee\ClusterNode2$“,“Kaffee\ClusterNode3$“

Get-SMBShare -Name ClusterZeuge | Get-SmbShareAccess

Set-ClusterQuorum -Cluster CoreCluster1 -FileShareWitness \\MF-Host\ClusterZeuge

1..3 | % {

Enter-PSSession -VMName ClusterNod$_

icm (Get-Cluster -Name CoreCluster1 | 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

Get-PhysicalDisk

Get-PhysicalDisk | ? CanPool -eq $true | ft

Exit-PSSession

}

Invoke-Command -VMName ClusterNod1 -ScriptBlock { Get-PhysicalDisk | ? CanPool -eq $true | ft}

Enable-ClusterStorageSpacesDirect –CimSession CoreCluster1

Get-StoragePool -CimSession CoreCluster1

#New-VirtualDisk -FriendlyName VirtualDisk1 -StoragePoolFriendlyName S2D* -CimSession CoreCluster1 -Size 10GB

Get-VirtualDisk -CimSession CoreCluster1 -FriendlyName *

#Bei Bedarf
#Get-VirtualDisk -CimSession CoreCluster1 -FriendlyName * | Remove-VirtualDisk

Get-Volume -CimSession CoreCluster1

Enable-NetFirewallRule -DisplayGroup „Remotevolumeverwaltung“ #Auf dem Quellrechener sowie auf dem Zielrechner

Invoke-Command -VMName ClusterNod1,ClusterNod2,ClusterNod3 -ScriptBlock {Enable-NetFirewallRule -DisplayGroup „Remotevolumeverwaltung“}

Invoke-Command -VMName ClusterNod1,ClusterNod2,ClusterNod3 -ScriptBlock {Get-NetFirewallRule -DisplayGroup „*Remote*“ | ft DisplayName, Enabled}

Invoke-Command -VMName ClusterNod1,ClusterNod2,ClusterNod3 -ScriptBlock {Get-NetFirewallRule -DisplayGroup „*Remote*“ | Enable-NetFirewallRule}

Invoke-Command -VMName ClusterNod1,ClusterNod2,ClusterNod3 -ScriptBlock {Get-PSSessionConfiguration; Enable-PSRemoting; Configure-SMRemoting.exe –Get; Configure-SMRemoting.exe –Enable}

get-clustersharedvolume -Cluster CoreCluster1

Get-ClusterResource -Cluster CoreCluster1

#Get-ClusterResource -Cluster CoreCluster1 | ?{$_.Name -eq “Virtueller Clusterdatenträger (VirtualDisk5)”}

#(Get-ClusterResource -Cluster CoreCluster1 | ?{$_.Name -eq “Virtueller Clusterdatenträger (VirtualDisk5)”}).Name = „VirtualDisk5“

#Get-ClusterResource -Cluster CoreCluster1

#(Get-ClusterResource -Cluster CoreCluster1 | ?{$_.Name -eq “Virtueller Clusterdatenträger (Volume2)”}).Name = „VirtualDisk2“

#Get-ClusterResource -Cluster CoreCluster1

New-Volume -CimSession CoreCluster1 -StoragePoolFriendlyName S2D* -FriendlyName „VirtualDisk1“ -FileSystem CSVFS_ReFS -Size 10GB

New-Volume -CimSession CoreCluster1 -StoragePoolFriendlyName S2D* -FriendlyName „VirtualDisk2“ -FileSystem CSVFS_ReFS -Size 10GB

Get-Volume -CimSession CoreCluster1

Get-StoragePool -CimSession CoreCluster1 S2D* | FT FriendlyName, FaultDomainAwarenessDefault, OperationalStatus, HealthStatus -autosize

Get-ClusterResource -Cluster CoreCluster1 -Name “VirtualDisk1”| Add-ClusterSharedVolume -Cluster CoreCluster1

Get-ClusterResource -Cluster CoreCluster1 -Name “VirtualDisk2”| Add-ClusterSharedVolume -Cluster CoreCluster1

Get-ClusterResource -Cluster CoreCluster1 -Name “VirtualDisk5”| Add-ClusterSharedVolume -Cluster CoreCluster1

Get-Cluster -Name CoreCluster1 | fl *

Invoke-Command -VMName ClusterNod1 -ScriptBlock {Get-VirtualDisk -CimSession CoreCluster1 | fl}

### Cluster mit Hilfe von Failovercluster-Mamager konfigurieren