This blog on Hyper-V Storage Configuration is a three-part series. We will cover a number of different storage configurations with Microsoft Hyper-V, including their characteristics, features, configuration, and use cases.

In the first part, we discussed the Hyper-V related storage technologies – Direct Attached Storage, Shared Storage, Cluster Shared Volumes, Storage Spaces Direct & ReFS and looked at the process of configuring Hyper-V Direct Attached Storage.

In the previous post – second part, we discussed the process of configuring Hyper-V Shared Storage and Cluster Shared Volumes for Hyper-V.

In this last part – we’ll look at the process of configuring and managing Storage Spaces Direct and Resilient File System (ReFS).

Configuring Storage Spaces Direct

As mentioned in the overview portion, Storage Spaces Direct or S2D is a software-defined storage solution that provides the ability to have shared storage that is pooled together from internal storage to each Hyper-V cluster node. It is extremely important with Storage Spaces Direct to purchase a validated hardware/software solution where the hardware has been validated to work with Storage Spaces Direct. This is an extremely important design consideration to keep in mind. Outside of that basic requirement, there are also other considerations and requirements:

Download Banner
  • Minimum of (2) servers, maximum of 16
  • All servers are recommended to be of the same manufacturer and model
  • Intel Nehalem class or higher/AMD EPYC or later
  • 4 GB of RAM per TB of cache drive capacity on each server for S2D metadata
  • Any boot device supported by Windows Server
  • NICs that are RDMA capable, iWARP or RoCE
  • Drives supported include direct-attached SATA, SAS, or NVME drives that are physically attached. Cache and capacity drives are required as part of the configuration. No shared-SAS is supported. RAID cards must support simple pass-through mode.

Configuring Storage Spaces Direct and ReFS

Make sure the storage configuration for each S2D host is compatible (Image courtesy of Microsoft)

Beginning Storage Spaces Direct Configuration

Before you start configuring Storage Spaces Direct, you need to ensure your hard drives are free of any other partitions or data before getting started. The following PowerShell script as provided by Microsoft will clean all drives beside the OS boot drive.
# Fill in these variables with your values
$ServerList = “Server01”, “Server02”, “Server03”, “Server04”

Invoke-Command ($ServerList) {
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 | Where Number -Ne $Null | Where IsBoot -Ne $True | Where IsSystem -Ne $True | Where PartitionStyle -Eq RAW | Group -NoElement -Property FriendlyName
} | Sort -Property PsComputerName, Count

Validating and Create Your Cluster

You want to make sure your potential cluster nodes will pass the requirements for enabling Storage Spaces Direct. Microsoft has this covered with the Test-Cluster cmdlet.

  • Test-Cluster –Node –Include “Storage Spaces Direct”, “Inventory”, “Network”, “System Configuration”

After validating your cluster using the Test-Cluster cmdlet and everything passing, you need to actually create the cluster. You can do that with the following. Note the NoStorage option specified. We want to do this since we need to create the storage using the special Storage Spaces Direct cmdlets and syntax.

  • New-Cluster –Name < ClusterName > –Node < MachineName1,MachineName2,MachineName3,MachineName4 > –NoStorage

Enable Storage Spaces Direct in your Newly Formed Cluster

Storage Spaces Direct has a special cmdlet to put the storage system into the Storage Spaces Direct mode and do some things automatically, including:

  • Create a storage pool
  • Configures Storage Spaces Direct caches automatically. It will look at the available drive types and automatically choose the fastest drives as cache drives.
  • Creates two tiers as default tiers, including capacity and performance tiers

Use the following cmdlet to enable Storage Spaces Direct:

  • Enable-ClusterStorageSpacesDirect –CimSession < ClusterName >

Configuring Storage Spaces Direct and ReFS

Enabling Storage Spaces Direct on a Hyper-V Cluster

Create Storage Spaces Direct Storage Pool

After enabling Storage Spaces Direct, you need to create Storage Pool. This can be accomplished with a PowerShell cmdlet:

  • New-StoragePool -StorageSubSystemFriendlyName *Cluster* -FriendlyName S2D -ProvisioningTypeDefault Fixed -PhysicalDisk (Get-PhysicalDisk | ? CanPool -eq $true

Managing Storage Spaces Direct

Managing Storage Spaces Direct is easily accomplished using either PowerShell or the new management tool released by Microsoft, Windows Admin Center.

Windows Admin Center (WAC) is a web-based modern UI that is built from the ground up to manage Microsoft’s HCI platform with Windows Server 2019 and Storage Spaces Direct. It is the method to interact with and manage Storage Spaces Direct with a GUI tool.

Creating a Storage Spaces Direct Volume with WAC

Let’s see how we can create a new Storage Spaces Direct Volume using the Windows Admin Center.

Configuring Storage Spaces Direct and ReFS

Using the Windows Admin Center to create a new Storage Spaces Direct Volume

On the Create Volume dialog box, choose the name of the volume, resiliency setting, size and whether you want to use deduplication and compression.

Configuring Storage Spaces Direct and ReFS

Creating a new Storage Spaces Direct Volume and configuring the settings for the new volume

New S2D Volume is created using the Windows Admin Center. We can see the new Volume in WAC after creation.

Configuring Storage Spaces Direct and ReFS

New Storage Spaces Direct Volume created using Windows Admin Center

Resilient File System (ReFS)

Resilient File System (ReFS) touts many advantages and improvements over NTFS, including the following:

  • Integrity-streams – ReFS uses checksums for metadata and optionally for file data, it can detect corruptions. This includes storage spaces integrations where it can automatically repair detected corruption.
  • Data integrity scrubber proactively corrects errors – This periodically scans the volume and identifies corruptions and triggers a repair of the volume.
  • Real-time tier optimization – On Storage Spaces Direct, this not only tweaks capacity but also delivers high performance to your workloads. This includes creating tiers for your data to live on both for hot data and cold data. Hot data would be data that needs fast storage and cold data that is a capacity tier. So, the data gets written to the hot tier first and then moved over to the capacity tier.
  • Accelerated virtual machine operations – Hyper-V virtualized workloads specifically benefit from ReFS. With block cloning technology built into ReFS 3.1, block data is no longer moved but simply referenced with pointers to blocks. This tremendously increases performance on creating fixed-size VHDs based on sparse VDL technology that allows for zeroing out files rapidly. The new block cloning technology enables rapid merge operations for checkpoints in Hyper-V
  • Scalability – Scalability improvements starting with Windows Server 2016 ReFS also allow for extremely large datasets without any impact on performance, unlike previous file systems.

New features for Resilient File System (ReFS) with Windows Server 2019:

  • Deduplication and Compression – This leads to huge space savings with Hyper-V virtual machines since there is a lot of duplication at the block level for virtual machines, especially in VDI implementations.

***Note*** – As mentioned above, it is not recommended to use Resilient File System (ReFS) with Cluster Shared Volumes as this causes all I/O to be performed in File Redirection Mode which can lead to huge performance issues. Resilient File System is the recommended file system for use with Storage Spaces Direct implementations used with Hyper-V.

Implementing Resilient File System is as simple as formatting a new volume with the new file system. This can be done using the disk management console or by using diskpart.

Configuring Storage Spaces Direct and ReFS

Formatting a new Windows Server 2019 volume with ReFS

Summarizing the Hyper-V Storage Configuration Guide

We have covered a lot of territory with the Hyper-V storage configuration guide. There are many different types of storage configuration options available with Windows Server 2019 Hyper-V. These include direct-attached storage, shared storage, cluster shared volumes, storage spaces direct, and ReFS.

Depending on the type of storage that is chosen in the Hyper-V environment, each storage configuration has a different set of characteristics including the ease of which they can be configured, the requirements, complexity of the solution, and features and capabilities they each possess.

While direct-attached storage is the easiest type of Hyper-V storage to make use of, it is fairly limited in the enterprise features that can be utilized when using it. When you want to begin using the true enterprise Hyper-V features that come along with Hyper-V Cluster implementations, you have to step up into shared storage or Storage Spaces Direct implementations to take advantage of these.

Other types of Hyper-V storage technologies like the Cluster Shared Volume (CSV) and Resilient File System (ReFS) are not necessarily dependent on the storage implementation, however, you need to make a note of when these should be used as is the case with using ReFS along with Cluster Shared Volumes implemented with Shared Storage as this can lead to performance issues.

Windows Server 2019 brings to the table the most diverse storage feature set of any Windows Server release and allows you as the IT admin to have a number of options to fit your specific use cases. By being informed on how these technologies are implemented and their various features, you are well-equipped to make a good decision when choosing a solution to store your data in a Hyper-V environment.

Follow our Twitter and Facebook feeds for new releases, updates, insightful posts and more.

Like what you read? Rate us
5.0
01