[Please help, STUPID MISTAKE] Recovering S2D after accidental clearing of virtual disks

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

Set Iron

New Member
Mar 18, 2020
7
0
1
Hello, I made a stupid mistake.
I was rebuilding one of two S2D clusters after an upgrade and I accidentally reset the wrong node.
I used this script:

Code:
$ServerList = "Server02", "Server04"
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
}

And I accidentally used server 02 and server 04 instead of server 03 and server 04.
Server 02 is part of another cluster and the script removed all virtual disks for all the nodes.
Does anyone know a way to recover the storage configuration?
Thank you so much to anyone who can help.