# Clean the disks

In this phase we'll use a prepared Microsoft script ([Step 3.4](https://docs.microsoft.com/en-us/windows-server/storage/storage-spaces/hyper-converged-solution-using-storage-spaces-direct))to clean and add all the disks (8 in total) to our cluster.

```
icm (Get-Cluster -Name <cluster or node name> | 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
```

Your results shouldn't be different, if you are doing this setup completely virtually.

![](https://3108435343-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lp2rB1gAFhoLXwsXIIR%2F-Lp2rDugz51IbJxnu7OE%2F-Lp2s84hb6O7uhyu1Gm6%2FResult-clean-disk.PNG?generation=1568801858154293\&alt=media)

I didn't take any screenshot before (shame on me). But all this time this should've been empty. If you're stuck at this point in time, maybe troubleshoot this. We used "-nostorage" as a parameter when we [build the cluster](build-the-cluster).

![](https://3108435343-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lp2rB1gAFhoLXwsXIIR%2F-Lp2rDugz51IbJxnu7OE%2F-Lp2s84n_rhGSKAX1_Iq%2FNo-disks-clean-disks.PNG?generation=1568801858569702\&alt=media)
