Storage Cache 5.jpg

How To Enable Storage Caching in Windows Server

Windows Server 2022 allows you to enable storage caching for Windows Storage Spaces, even on standalone servers. Here’s how.

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

To make the technique work, you need a server that is running Windows Server 2022. That server requires at least one HDD and at least one SSD, not counting the boot drive. You will also have to install the Failover Clustering feature, which I will show you how to do later in this article.

Before I explain how to enable storage caching, I need to 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 VM with a couple of extra 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 on, removed the media type attributes from the virtual disks, preventing them from being used for storage bus caching. Even so, I want to show you how the configuration process works.

The first thing that you will need to do is to check your server’s storage configuration. Remember, the system will need at least one HDD and one SSD, not counting the boot drive. Additionally, the HDD and SDD must be suitable for inclusion 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 a boot disk, plus two data disks. I have used custom friendly names to make it easier to follow my setup. Your friendly names will be different. One of my data disks is an HDD and the other is an SSD. The CanPool column reflects a status of True for both disks, indicating that the disks can be included in a storage pool.

Storage Cache 1.jpg

Figure 1

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

Once you have verified that your system’s storage adheres to the requirements for standalone storage caching, the next thing to do is install the Failover Clustering feature and the corresponding management tools. Even though we aren’t building a cluster per se, the storage bus cache borrows some code from the failover clustering feature. You can install this feature and the 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 you install the Failover Clustering feature, it’s time to enable the storage bus cache. This process involves using two simple commands. Upon entering these commands, Windows will create a new storage pool and then add the qualifying disks to the pool. Windows will also create a storage bus cache using the default settings. Here are the commands that 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

Figure 3

The storage bus cache was created.

Normally, you would have to use commands such as the ones 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 manual pool creation. Even so, I wanted to go ahead and manually create a storage pool, just so that 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 manual storage pool creation looks like in Figure 4.

Storage Cache 4.jpg

Figure 4

I have created a storage pool named MyPool.

As previously noted, manual storage pool creation is unnecessary in this case, but I included it as a workaround since I am using a virtual machine. Although the Enable-StorageBusCache cmdlet should automatically create a storage pool, it is a good idea 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 have created a volume on the storage pool.

If you want to know more about storage bus caching on standalone servers, check out Microsoft’s documentation here.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish