PowerShell Configuration for Storage Spaces Direct
Using PowerShell to configure Windows Server Storage Spaces Direct for Hyper-V turns a multi-node software-defined storage design into a repeatable administration workflow. Storage Spaces Direct (S2D) pools local media across a failover cluster and presents resilient volumes as Cluster Shared Volumes (CSV), giving virtual machines shared storage that supports live migration and clustered workload placement.
Before changing disks, document hardware, licensing, network addressing, and recovery expectations. For Australian organisations, an on-premises fabric can serve offices in Sydney or Melbourne while a recovery tier uses Microsoft’s Azure Australia East and Australia Southeast regions, helping teams balance latency, data residency, and operating costs.
Planning the Cluster and Storage
A production design should use at least three similarly configured nodes so quorum can survive a node or switch failure without losing cluster ownership. Give each node equivalent disk counts and capacities, and use a supported controller path: direct-attached media, an HBA in JBOD mode, or a validated hardware RAID arrangement for the operating system rather than pool media.
Capacity planning must account for replica overhead, metadata, free space, and the temporary reduction in fault tolerance during a rebuild. A three-copy mirror can consume roughly three times the raw capacity at the data-copy level, while parity changes both usable capacity and recovery time. For a contrasting view of quantitative decision-making, the site's Roulette strategy explainer shows why explicit assumptions and bounded risk matter.
Preparing Windows Server Nodes
Use a supported Windows Server Datacenter edition and the current Microsoft hardware compatibility list. Install the cluster, file-server, Hyper-V, and storage roles at the same patch level on every node; mixed updates, controller firmware, or uneven media can complicate pool validation.
Install-WindowsFeature -Name Failover-Clustering, FS-FileServer, Hyper-V, S2D -IncludeManagementTools
Restart-Computer -Force
Run the commands elevated on each node and restart when requested. S2D requires pool disks to remain unassigned: set RAID controllers to HBA/JBOD or pass-through where required, then confirm that Windows sees the expected raw devices. Dell PowerEdge, HPE ProLiant, and Lenovo ThinkSystem platforms are commonly supported in the Australian market, so record local warranty and RMA terms alongside each serial number.
Get-PhysicalDisk |
Select-Object FriendlyName, SerialNumber, MediaType, BusType, Size, CanPool
Check the rack path as well: Australian deployments commonly use AS/NZS 3112 outlets, and every PDU, UPS, and power feed must match the equipment’s electrical rating.
Creating the Failover Cluster
Create the failover cluster after the feature installation and node restart. Use a dedicated, highly available network for cluster communication, provide a static cluster address, and make sure every member can resolve the others. Do not attach ordinary disks with Add-ClusterDisk; S2D must control the storage pool itself.
$nodes = 's2d-01.au.example', 's2d-02.au.example', 's2d-03.au.example'
New-Cluster -Name 'AU-HyperV-S2D' -Node $nodes -StaticAddress '10.20.30.10'
Confirm that all nodes show Online, that quorum has the intended witnesses, and that the cluster and client networks are separated or protected appropriately. With an even number of voting members, add a properly placed file-share witness; with three nodes, verify that the quorum model still tolerates the planned maintenance and network failures.
Enabling Storage Spaces Direct
Run Enable-StorageSpacesDirect from one cluster node while every member is healthy and visible. The command coordinates the cluster-wide configuration and, depending on the Windows Server release, may create an initial primordial storage pool. Do not repeat it merely because another node has not yet refreshed.
Enable-StorageSpacesDirect -Verbose
Get-StoragePool
Get-VirtualDisk
Wait for the pool and associated resources to settle before creating workloads. If physical disks remain ineligible, inspect CanPool and CannotPoolReason, then correct controller mode, firmware, or disk state. The pool should contain matching, unassigned media across the intended nodes; asymmetry can remove the expected failure tolerance.
Building the Pool and Virtual Disk
Identify the primordial pool created for S2D and confirm that it spans the required nodes and disk sets. A pool’s capacity is raw aggregate media, not the space available after resiliency is applied, so keep rebuild headroom and leave some raw capacity unallocated.
$pool = Get-StoragePool |
Where-Object IsPrimordial |
Select-Object -First 1
$virtualDisk = New-VirtualDisk `
-FriendlyName 'HyperV-Data' `
-StoragePool $pool `
-ResiliencySettingName Mirror `
-NumberOfColumns 3 `
-SizeInBytes 2TB
A three-column mirror suits capacity-sensitive critical data where the node and disk topology can support three copies; a two-way mirror can improve usable capacity but tolerates fewer simultaneous failures. Validate any parity configuration separately because its write penalty and rebuild impact differ from mirroring.
Adding CSV and Completing Hyper-V Setup
Publish the new virtual disk as a Cluster Shared Volume, then verify that the same CSV is available from every cluster member. The shared-volume object is mounted through the cluster storage namespace, allowing Hyper-V to move a virtual machine and its VHDX files between nodes.
Get-VirtualDisk -FriendlyName 'HyperV-Data' |
Add-ClusterSharedVolume
Get-ClusterSharedVolume
Get-VMHost
Ensure the Hyper-V role was installed and rebooted before production use. Put virtual machine configuration, checkpoints, and VHDX files on the CSV rather than a node’s local disk, and select the CSV when creating or moving virtual machines. Test a restart, a live migration, and an orderly cluster failover before admitting tenant workloads.
Validating and Operating the Fabric
Run cluster and storage validation on a schedule and after firmware, driver, or Windows Server patching. Capture pool health, virtual disk operational status, reliability counters, CSV ownership, and recent events as a baseline so that a failed rebuild or degraded replica is visible before it becomes an outage.
Test-Cluster -Include 'Inventory', 'Network', 'System Configuration', 'Storage Spaces Direct'
Get-VirtualDisk | Get-StorageReliabilityCounter
Get-ClusterSharedVolume
For Australian support operations, align maintenance with daylight-saving changes in New South Wales, Victoria, South Australia, and Tasmania; Queensland and Western Australia do not shift their clocks. When a failed drive is replaced with an imported part, have the customs broker confirm GST and clearance documents, and match the serial number to the local manufacturer’s Australian warranty process. Regular validation, documented spares, and rehearsed recovery keep the S2D fabric aligned with its promised availability.