Create Tiered Storage Space
This article shows you how to create a tiered storage space under Windows Server 2019 using Powershell. In general it will also work with Windows 10. There is no consideration of columns in this article.
First of all the screenshots are made after successfully creating the vDisk, so they will vary from the expected results of the commands. I'm using 3 Samsung 860 EVO 1TB SSDs and 3 Seagate Exos X16 16TB HDDs.
1. Check the requirements
Get-PhysicalDisk | ft FriendlyName,CanPool,Size,MediaType,cannotpoolreason
If CanPool is false and you want to create a new pool from the disk then you need to check (and fix) the reasons for it.
2. Create a new Storage Pool with the name "MyPool" using the Storage Spaces subsytem For this we collect a list of all devices which can pool:
$disks = Get-PhysicalDisk |? {$_.CanPool -eq $true}
New-StoragePool -StorageSubsystemFriendlyName "Windows Storage*" -FriendlyName MyPool -PhysicalDisks $disks
3. Create the tiers for HDD and SSD with mirror resiliency and store it in a variable. For a multi-resilient volume you can also choose parity for the HDD tier. For performance reasons I choose mirror for both tiers.
$ssd_tier = New-StorageTier -StoragePoolFriendlyName MyPool -FriendlyName myVirtDisk-SSD_Tier -MediaType SSD -ResiliencySettingName Mirror
$hdd_tier = New-StorageTier -StoragePoolFriendlyName MyPool -FriendlyName myVirtDisk-HDD_Tier -MediaType HDD -ResiliencySettingName Mirror
4. Create the virtual disk using the tiers. Please note that with mirror you only have half the raw capacity (minus a few %) available.
New-VirtualDisk -StoragePoolFriendlyName MyPool -FriendlyName myVirtDisk -StorageTiers @($ssd_tier,$hdd_tier) -StorageTierSizes @(1400GB,215000GB)
5. After creating the virtualDisk you can still add drives (ideally with similar size and type) and the pool will increase automatically after 15 Minutes if you have only one pool (it can take hours to be completed). You can start the process manually and check for the progress:
Get-StoragePool -FriendlyName MyPool | Optimize-StoragePool
Get-StorageJob
After that you need to increase the tiers and the virtual Disk manually:
Resize-StorageTier -FriendlyName myVirtDisk-HDD_Tier -Size 215000GB
Resize-StorageTier -FriendlyName myVirtDisk-SSD_Tier -Size 1400GB
Please refer to the MS-Docs for an overview of the PS-Commands.
You can also see this on Youtube.