Windows Server Hybrid Administrator: Prüfung AZ-800: Administering Windows Server Hybrid Core Infrastructure: VHD- und VHDX-Dateien verwalten
Ideen für die Recherche im Web:
Zum Nachschlagen:
Übungen:
Virtuelle Festplatten erstellen und verwalten
Get-Command *vhd* Get-Command New-VHD Get-Help New-VHD -detailed #Get-Help New-VHD -Examples #Get-Help Get-Service -Examples #Get-Help New-VHD -Online #Get-Help Get-Service -Online #https://docs.microsoft.com/de-de/powershell/module/hyper-v/new-vhd?view=windowsserver2019-ps dir N:\ #md N:\VHDs New-VHD -Path N:\VHDs\Festplatte1.vhdx -SizeBytes 10GB #VhdType : Dynamic #LogicalSectorSize : 512 #PhysicalSectorSize : 4096 fsutil fsinfo ntfsinfo N: fsutil fsinfo ntfsinfo N: | Select-String 'Sektor ' #Bytes pro Sektor : 512 #Bytes pro physikalischem Sektor : 512 New-VHD -Path N:\VHDs\Festplatte3.vhdx -SizeBytes 10GB -PhysicalSectorSizeBytes 512 #LogicalSectorSize : 512 #PhysicalSectorSize : 512 Get-Command *vhd* #Get-VHD #Set-VHD #Mount-VHD #Resize-VHD #https://www.windowspro.de/script/vhds-auslesen-powershell-groesse-speicherort-typ-fragmentierung
Virtuelle Festplatten erstellen und in einem Speicherpool verwenden
#Get-Help New-VHD -detailed New-VHD -Path C:\VHDs\virtuelle_Festplatten\vHDD1.vhdx -Fixed -SizeBytes 10GB -PhysicalSectorSizeBytes 512 New-VHD -Path C:\VHDs\virtuelle_Festplatten\vHDD2.vhdx -Fixed -SizeBytes 10GB -PhysicalSectorSizeBytes 512 New-VHD -Path C:\VHDs\virtuelle_Festplatten\vHDD3.vhdx -Fixed -SizeBytes 10GB -PhysicalSectorSizeBytes 512 Mount-DiskImage -ImagePath C:\VHDs\virtuelle_Festplatten\vHDD1.vhdx Mount-DiskImage -ImagePath C:\VHDs\virtuelle_Festplatten\vHDD2.vhdx Mount-DiskImage -ImagePath C:\VHDs\virtuelle_Festplatten\vHDD3.vhdx Get-PhysicalDisk | sort -Property DeviceId #Get-PhysicalDisk | Out-GridView #get-disk|where {$_.NumberOfPartitions -eq 0} #Get-Disk|where {$_.PartitionStyle -eq "RAW" -and $_.BusType -eq "SCSI"}|Initialize-Disk -PartitionStyle MBR Get-Disk|where {$_.PartitionStyle -eq "RAW" -and $_.NumberOfPartitions -eq 0}|Initialize-Disk -PartitionStyle GPT <# Initialize-Disk -Number 1 -PartitionStyle GPT Initialize-Disk -Number 2 -PartitionStyle GPT Initialize-Disk -Number 3 -PartitionStyle GPT #> #Get-Disk|where {$_.PartitionStyle -eq "RAW" -and $_.BusType -eq "SCSI"}|Initialize-Disk -PartitionStyle GPT #Dismount-DiskImage -ImagePath C:\VHDs\virtuelle_Festplatten\vHDD1.vhdx #Dismount-DiskImage -ImagePath C:\VHDs\virtuelle_Festplatten\vHDD2.vhdx #Dismount-DiskImage -ImagePath C:\VHDs\virtuelle_Festplatten\vHDD3.vhdx #Abfrage,welche physischen Datenträger im ursprünglichen Pool verfügbar sind. Get-StoragePool -IsPrimordial $true | Get-PhysicalDisk -CanPool $True <# Schritt 1: Erstellen eines Speicherpools Speicherpool namens StoragePool1 erstellen, bei dem alle verfügbaren Datenträger verwendet werden. New-StoragePool –FriendlyName StoragePool1 –StorageSubsystemFriendlyName "Windows Storage*" –PhysicalDisks (Get-PhysicalDisk –CanPool $True) #> #Beispiel wird der neue Speicherpool StoragePool1 erstellt, bei dem vier der verfügbaren Datenträger verwendet werden. New-StoragePool –FriendlyName StoragePool1 –StorageSubsystemFriendlyName "Windows Storage*" –PhysicalDisks (Get-PhysicalDisk PhysicalDisk1, PhysicalDisk2, PhysicalDisk3, PhysicalDisk4) #Cmdlet-Beispielsequenz zeigt, wie der verfügbare physische Datenträger PhysicalDisk5 als Hotspare zum Speicherpool StoragePool1 hinzugefügt wird. $PDToAdd = Get-PhysicalDisk –FriendlyName PhysicalDisk5 Add-PhysicalDisk –StoragePoolFriendlyName StoragePool1 –PhysicalDisks $PDToAdd –Usage HotSpare <# Schritt 2: Erstellen eines virtuellen Datenträgers virtueller 5-GB-Datenträger namens VirtualDisk1 im Speicherpool StoragePool1 erstellt. #> New-VirtualDisk –StoragePoolFriendlyName StoragePool1 –FriendlyName VirtualDisk1 –Size (5GB) <#Gespiegelter virtueller Datenträger namens VirtualDisk1 im Speicherpool StoragePool1 wird erstellt. Der Datenträger nutzt die maximale Speicherkapazität des Speicherpools. (–ResiliencySettingName Mirror oder Parity#> New-VirtualDisk –StoragePoolFriendlyName StoragePool1 –FriendlyName VirtualDisk1 –ResiliencySettingName Parity –UseMaximumSize <#Schritt 3: Erstellen eines Volumes werden die Datenträger für den virtuellen Datenträger VirtualDisk1 initialisiert, eine Partition mit einem zugewiesenen Laufwerkbuchstaben wird erstellt, und das Volume wird dann mit dem Standard-NTFS-Dateisystem formatiert. #> Get-VirtualDisk –FriendlyName VirtualDisk1 | Get-Disk | Initialize-Disk –Passthru | New-Partition –AssignDriveLetter –UseMaximumSize | Format-Volume Optimize-StoragePool -FriendlyName Storagepool1 -AsJob Get-Job