In the first part of this article series, I showed you how to prepare your Hyper-V server and your virtual machines to act as a virtualized Storage Spaces Direct cluster. Now it’s time to deploy Microsoft Storage Spaces Direct on your virtualized hardware.
The first step in this process is to install the required roles onto each virtualized cluster node. The required roles include:
- Failover Clustering
- File Server (if you want to host any file shares, such as for a converged deployment)
You can use the Server Manager to install these roles, but being that the roles need to be installed on multiple virtual machines, it is usually easier to use PowerShell instead. Here is a command that you can use to install the required roles:
Install-WindowsFeature -Name "Hyper-V", "Failover-Clustering", "Data-Center-Bridging", "RSAT-Clustering-PowerShell", "Hyper-V-PowerShell", "FS-FileServer"
This is how to install the required components.
There are two things to keep in mind with regard to using the command shown above. First, the command must be run on each of your Storage Spaces Direct cluster nodes. Second, you will have to restart each node once the installation completes, as shown in Figure 2.
You will need to restart each node once the required roles are installed.
In a physical network environment, there would be some additional network configuration that would be required at that point. However, because Storage Spaces Direct is being deployed using virtual nodes, this step can be skipped per Microsoft documentation.
Now it’s time to determine whether the nodes have everything needed to support Storage Spaces Direct. The easiest way to do this is to open an elevated PowerShell session on one of the Storage Spaces Direct cluster nodes and use the Test-Cluster cmdlet to validate the cluster. Here is the command syntax:
–Include "Storage Spaces Direct", "Inventory", "Network", "System Configuration"
The Storage Spaces Direct cluster I built while writing this article series contains three cluster nodes: Node-1, Node-2 and Node-3. Therefore,, the test command would be:
Test-Cluster –Node Node-1, Node-2, Node-3 –Include "Storage Spaces Direct", "Inventory", "Network", "System Configuration"
This is what the cluster test looks like.
It’s normal for the test to generate warnings. Just make sure that there are no errors.
Assuming that the test did not produce any errors, it’s time to create the cluster. Here is the command:
Notice that this command makes use of the NoStorage switch. This switch is essential because the cluster will function as a Storage Spaces Direct cluster. Here is the full command used in my own environment:
New-Cluster –Name S2DCluster –Node Node-1, Node-2, Node-3 –NoStorage
The cluster creation process is in progress.
The cluster creation process has completed.
In a production environment, you would typically want to create a cluster witness so that the cluster can sustain multiple node failures. However, this is not a requirement in a lab environment.
Now that you have created the cluster, it’s a good idea to clean the cluster disks and prepare them for use. Microsoft provides a script that will detect available disks and make them available for use in the cluster. It is worth noting that this command will delete the volumes from every disk in the cluster nodes other than the boot disks. Figure 7 shows what it looks like when you run this script.
This is what it looks like when you add storage to the cluster.
Now that storage has been added, it is time to enable Storage Spaces Direct. According to the Microsoft documentation, you can do so by using this command:
I have occasionally had trouble getting this command to work correctly. There are two things I do to work around the problem. First, I install the Failover Cluster Manager, assign an IP address to the cluster, and then manually bring the cluster online as shown in Figure 8. It is worth noting that, at this point, no storage will be available to the cluster. Storage will be added automatically when Cluster Storage Spaces Direct is enabled.
This is one way of bringing the cluster online.
Once the cluster is up and running, the second step is to make sure that all available updates are installed on the cluster nodes. Even in Windows Server 2019, the Enable-ClusterStorageSpacesDirect cmdlet does not work correctly in the absence of these updates.
Once the cluster has been brought online and any available updates are installed, try running the Enable-ClusterStorageSpacesDirect cmdlet again. This time, it should run without issue, as shown in Figure 9.
This is how you enable Cluster Storage Spaces Direct.
The last step in the process is to create a cluster volume. You can create this volume by using the New-Volume cmdlet. Here is the cmdlet’s syntax:
New-Volume -FriendlyName "Volume1" -FileSystem CSVFS_ReFS -StoragePoolFriendlyName S2D* -Size 1TB
If the goal is, for example, to create a 20 GB volume on the S2DCluster created in the previous step, then the commands would look like this:
New-Volume -FriendlyName "Volume1" -FileSystem CSVFS_ReFS -StoragePoolFriendlyName S2D* -Size 20GB
You can see what this command looks like in Figure 10.
This is how you create a Storage Spaces Direct volume.
Once this process completes, the Storage Spaces Direct cluster is ready to use. You can see the completed cluster and its new volume in Figure 11.
The Storage Spaces Direct cluster is now ready to use.