I’ve updated the script to automate the creation of a Storage Spaces Direct cluster. This script if very crude at this point in time with very little error handling and customization. I’ll most likely refactor it when the time allows it.

You can find the latest version of the script here:

New-NanoServerCluster.ps1

What this does:

Create a configurable number of cluster nodes

Creates a number of VDHX per cluster node of a configurable size

Joins them to the AD domain of your lab

Creates a Storage Spaces Direct storage pool

Creates a Storage Spaces virtual disk

Attempts to create an SOFS role (currently doesn’t work, see below)

If the script is ran again with the same parameters, it will clean whatever is already there (VM, computer objects, etc.)

A couple of things to note in this release:

Assumes the Hyper-V host is local (and not in the same domain as your lab)

Uses the domain controller to use the FailoverClusters cmdlets

The SOFS role fails to come online as you need to modify OU permissions to allow the cluster object to create computer objects, if someone can point me to how to achieve this in PowerShell, that would be appreciate.