Dell S3048-ON EMC Solutions for Microsoft Azure Stack HCI Networking Guide - Page 43

Get-Disk | Where Number -Ne $Null | Where IsBoot -Ne $True | Where

Page 43 highlights

If there are existing partitions or other data on the drives, the drives must be cleaned before creating the host cluster. Warning: With the exception of the boot drives, the following script removes all data from all disks on the hosts specified in $ServerList. For more information, see https://docs.microsoft.com/en-us/windowsserver/storage/storage-spaces/deploy-storage-spaces-direct. All disks eligible to be used in the storage pool may be cleaned by running the following script on the management system: PS> $ServerList = "storage-01", "storage-02", "storage-03", "storage-04" Invoke-Command ($ServerList) { 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 | Where Number -Ne $Null | Where IsBoot -Ne $True | Where IsSystem -Ne $True | Where PartitionStyle -Eq RAW | Group -NoElement Property FriendlyName } | Sort -Property PsComputerName, Count Note: Replace the names in $ServerList above with the Ready Node names used in your environment. When complete, the output of the above script lists disks and hostnames similar to the following: Count Name ----- ---- 2 ATA MZ7KM960HMJP0D3 4 ATA ST4000NM0265-2DC 2 ATA MZ7KM960HMJP0D3 4 ATA ST4000NM0265-2DC 2 ATA MZ7KM960HMJP0D3 4 ATA ST4000NM0265-2DC 2 ATA MZ7KM960HMJP0D3 4 ATA ST4000NM0265-2DC PSComputerName storage-01 storage-01 storage-02 storage-02 storage-03 storage-03 storage-04 storage-04 43 Dell EMC Solutions for Microsoft Azure Stack HCI Networking Guide

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63

43
Dell EMC Solutions for Microsoft Azure Stack HCI Networking Guide
If there are existing partitions or other data on the drives, the drives must be cleaned before creating the host
cluster.
Warning:
With the exception of the boot drives, the following script removes all data from all disks on the
hosts specified in
$ServerList
. For more information, see
server/storage/storage-spaces/deploy-storage-spaces-direct
.
All disks eligible to be used in the storage pool may be cleaned by running the following script on the
management system:
PS>
$ServerList = "storage-01", "storage-02", "storage-03", "storage-04"
Invoke-Command ($ServerList) {
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 | Where Number -Ne $Null | Where IsBoot -Ne $True | Where
IsSystem -Ne $True | Where PartitionStyle -Eq RAW | Group -NoElement -
Property FriendlyName
} | Sort -Property PsComputerName, Count
Note:
Replace the names in
$ServerList
above with the Ready Node names used in your environment.
When complete, the output of the above script lists disks and hostnames similar to the following:
Count Name
PSComputerName
----- ----
--------------
2 ATA MZ7KM960HMJP0D3
storage-01
4 ATA ST4000NM0265-2DC
storage-01
2 ATA MZ7KM960HMJP0D3
storage-02
4 ATA ST4000NM0265-2DC
storage-02
2 ATA MZ7KM960HMJP0D3
storage-03
4 ATA ST4000NM0265-2DC
storage-03
2 ATA MZ7KM960HMJP0D3
storage-04
4 ATA ST4000NM0265-2DC
storage-04