70-740, Teil 5.3.2. „Direkte Speicherplätze“ mit Windows PowerShell aktivieren

70-740, Teil 5.3.2.

„Direkte Speicherplätze“ mit Windows PowerShell aktivieren

Ideen für die Recherche im Web:

Direkte Speicherplätze Windows PowerShell

Zum Nachschlagen:

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/manage-storage-spaces-direct

https://docs.microsoft.com/de-de/powershell/module/failoverclusters/enable-clusterstoragespacesdirect?view=win10-ps

Ü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

#Alternativ, Storage Spaces Direct wie folgt aktivieren.
#Get-Cluster -Cluster „MFNanoCluster1.kaffee.pause“ | Enable-ClusterStorageSpacesDirect