Enabling Storage Caching in Windows Server

Microsoft has long supported storage caching for Storage Spaces Direct, but those using standalone Windows servers had to look for another solution. However, starting with Windows Server 2022, Microsoft has made it possible to enable storage caching for Windows Storage Spaces, even on standalone servers. The advantage of this technique is that it allows you to use an HDD as the capacity tier and an SSD as the high-speed tier, thereby increasing storage performance.

For the technique to work, you need a server that is running Windows Server 2022. This server requires at least one hard drive and at least one SSD, not including the boot drive. You’ll also need to install the Failover Clustering feature, which I’ll show you later in this article.

Before explaining how to enable storage caching, I should point out that a bug seems to prevent this technique from working on Hyper-V virtual machines. In preparation for this article, I created a Hyper-V virtual machine with some additional virtual hard disks. I used PowerShell to trick Windows into treating one of the virtual disks as an HDD and the other as an SSD. However, the storage pool creation process, which I will discuss later, removed media type attributes from virtual disks, preventing them from being used for storage bus caching. Even so, I want to show you how the setup process works.

The first thing you will need to do is check your server’s storage configuration. Remember that the system will need at least one HDD and one SSD, not including the boot drive. In addition, the hard disk and the SDD must be able to be included in a storage pool. You can check the disks by opening an elevated PowerShell session and entering the following command:

Get-PhysicalDisk | Select-Object FriendlyName, MediaType, CanPool

As you can see in Figure 1 below, my lab system has one boot disk, plus two data disks. I used custom friendly names to make it easier to keep track of my setup. Your friendly names will be different. One of my data drives is an HDD and the other is an SSD. The CanPool column reflects a True state for both disks, indicating that the disks can be included in a storage pool.

Figure 1

You can use the Get-PhysicalDisk cmdlet to verify that your system includes the required disks.

Once you’ve verified that your system’s storage meets the requirements for standalone storage caching, the next thing to do is install the failover clustering feature and management tools for it. Even though we’re not building a cluster per se, the storage bus cache borrows code from the failover clustering feature. You can install this feature and management tools by entering this command:

Install-WindowsFeature -Name Failover-Clustering –IncludeManagementTools

Storage Cache 2.jpg

Figure 2

You will need to install the failover clustering feature.

After installing the failover clustering feature, it’s time to enable the storage bus cache. This process involves the use of two simple commands. Upon entering these commands, Windows will create a new storage pool and then add eligible disks to the pool. Windows will also create a storage bus cache using the default settings. Here are the commands you will need to enter:

Import-Module StorageBusCache

Enable-StorageBusCache

Update-StorageBusCache

To verify that the storage bus cache was created, enter the Get-StorageBusCache cmdlet.

Storage Cache 3.jpg

picture 3

The storage bus cache has been created.

Normally, you would use commands such as those shown below to manually create a storage pool. However, the Enable-StorageBusCache cmdlet will create a storage pool for you, so you don’t have to worry about manually creating the pool. Still, I wanted to go ahead and manually create a storage pool, just so I could show you the last part of the process.

Here are the commands normally used to create a storage pool:

$PhysicalDisks = (Get-PhysicalDisk -CanPool $True)

New-StoragePool -FriendlyName MyPool -StorageSubsystemFriendlyName "Windows Storage*" -PhysicalDisks $PhysicalDisks

You can see what manually creating a storage pool looks like in Figure 4.

Storage Cache 4.jpg

Figure 4

I created a storage pool named MyPool.

As stated before, manually creating a storage pool is not necessary in this case, but I’ve included it as a workaround since I’m using a virtual machine. Although the Enable-StorageBusCache cmdlet should automatically create a storage pool, it is recommended to verify its creation with the Get-StoragePool cmdlet.

All you need to do now to complete the process is create a volume. The command shown here creates a 50 GB non-resilient volume on the storage pool named MyPool:

New-Volume -FriendlyName "MyVolume" -FileSystem ReFS -StoragePoolFriendlyName MyPool -ResiliencySettingName Simple -Size 50GB

Storage Cache 5.jpg

Figure 5

I created a volume on the storage pool.

If you want to learn more about caching the storage bus on stand-alone servers, see Microsoft’s documentation here.

Comments are closed.