(S2D) Deploy Storage Spaces Direct
Step 1: Deploy Windows Server
Step 1.1: Install the operating system
Step 1.2: Connect to the servers
Step 1.3: Join the domain and add domain accounts
Step 1.4: Install roles and features
Step 2: Configure the network
Step 3: Configure Storage Spaces Direct
Step 3.1: Clean drives
# Fill in these variables with your values
$ServerList = "Server01", "Server02", "Server03", "Server04"
foreach ($server in $serverlist) {
Invoke-Command ($server) {
# Check for the Azure Temporary Storage volume
$azTempVolume = Get-Volume -FriendlyName "Temporary Storage" -ErrorAction SilentlyContinue
If ($azTempVolume) {
$azTempDrive = (Get-Partition -DriveLetter $azTempVolume.DriveLetter).DiskNumber
}
# Clear and reset the disks
$disks = Get-Disk | Where-Object {
($_.Number -ne $null -and $_.Number -ne $azTempDrive -and !$_.IsBoot -and !$_.IsSystem -and $_.PartitionStyle -ne "RAW")
}
$disks | ft Number,FriendlyName,OperationalStatus
If ($disks) {
Write-Host "This action will permanently remove any data on any drives other than the operating system boot drive!`nReset disks? (Y/N)"
$response = read-host
if ( $response.ToLower() -ne "y" ) { exit }
$disks | % {
$_ | Set-Disk -isoffline:$false
$_ | Set-Disk -isreadonly:$false
$_ | Clear-Disk -RemoveData -RemoveOEM -Confirm:$false -verbose
$_ | Set-Disk -isreadonly:$true
$_ | Set-Disk -isoffline:$true
}
#Get-PhysicalDisk | Reset-PhysicalDisk
}
Get-Disk | Where-Object {
($_.Number -ne $null -and $_.Number -ne $azTempDrive -and !$_.IsBoot -and !$_.IsSystem -and $_.PartitionStyle -eq "RAW")
} | Group -NoElement -Property FriendlyName
}
}
Step 3.2: Validate the cluster
Test-Cluster -Node <MachineName1, MachineName2, MachineName3, MachineName4> -Include "Storage Spaces Direct", "Inventory", "Network", "System Configuration"
Step 3.3: Create the cluster
New-Cluster -Name <ClusterName> -Node <MachineName1,MachineName2,MachineName3,MachineName4> -NoStorage
Step 3.4: Configure a cluster witness
Step 3.5: Enable Storage Spaces Direct
Enable-ClusterStorageSpacesDirect
That command reaches out to all other cluster nodes, discovers their locally attached disks, and forms a single, unified storage pool.
📌 Cluster-awareness is built in — Enable-ClusterStorageSpacesDirect communicates with all nodes via the cluster service and WMI (Windows Management Instrumentation).
When you run Enable-ClusterStorageSpacesDirect, the system:
- Scans all cluster nodes,
- Identifies eligible disks (usually non-OS, raw),
- Creates one distributed storage pool,
- And marks it as cluster-wide.
Step 3.6: Create volumes
New-Volume -StoragePoolFriendlyName "S2D*" -FriendlyName Volume01 -FileSystem CSVFS_ReFS -Size 8500GB
The New-Volume cmdlet:
- Creates a virtual disk inside the S2D pool,
- Formats it with CSVFS_ReFS (Cluster Shared Volumes File System),
- Automatically adds it to Cluster Shared Volumes (CSV),
- Makes it available to all nodes in the cluster.
Step 3.7: Optionally enable the CSV cache
Step 3.8: Deploy virtual machines for hyper-converged deployments
https://learn.microsoft.com/en-us/windows-server/storage/storage-spaces/deploy-storage-spaces-direct