1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Storage Howto guide: Storage Spaces Tiering in Windows 10

Discussion in 'Hardware' started by phuzz, 10 Dec 2017.

  1. phuzz

    phuzz This is a title

    Joined:
    28 May 2004
    Posts:
    1,710
    Likes Received:
    24
    Server 2012R2 (and up) has a technology called "Storage Tiers". Basically this is the software equivalent of a hybrid-SSD, you have a mixture of SSDs and HDDs in the same storage space, frequently used data is kept on the SSDs, with less accessed data on the HDDs. Theoretically this gets you the benefits of the speed of an SSD with the cheap space of an HDD.

    Now this is normally only interesting to admins working with servers with lots of disks, but it turns out that, even though there's no indication in the GUI, all of the functionality is still part of Windows 10. The only problem is we have to do everything via PowerShell.
    The following is a write up/how to guide from me puzzling out how to make it work. I've been running a tiered mirror volume for a few months now, and it works like you'd expect. I'm posting this because I've only seen one other person document it, and hopefully this gets indexed by some search engines.

    You will need:
    • Some knowledge of PowerShell, and ideally of the Storage Spaces cmdlets.
    • You'll have to run all of these commands from an elevated command prompt, which gives you all the access rights you need to delete all your own data, so be careful eh?
    • At least two SSDs
    • At least two HDDs
    Go right ahead and plug your empty harddrives and SSDs in. I already had three HDDs in a Storage Pool, so this will deal only with adding the SSDs.

    Plug in your SSDs (oh, and make sure you've backed up any data you care about)

    In disk management, (attempt to) delete any existing partitions and make sure the new SSDs have a GPT partition table

    Code:
    Get-PhysicalDisk
    
    FriendlyName               SerialNumber         CanPool OperationalStatus HealthStatus Usage            Size
    ------------               ------------         ------- ----------------- ------------ -----            ----
    KINGSTON SV300S37A60G      AAAAAAAAA            False   OK                Healthy      Auto-Select   55.9 GB
    ST4000VN000-1H4168         AAAAAAAAA            False   OK                Healthy      Auto-Select   3.64 TB
    TOSHIBA DT01ACA200         AAAAAAAAA            False   OK                Healthy      Auto-Select   1.82 TB
    ST2000DM001-9YN164         AAAAAAAAA            False   OK                Healthy      Auto-Select   1.82 TB
    Samsung SSD 840 EVO 250GB  AAAAAAAAA            False   OK                Healthy      Auto-Select 232.89 GB
    KINGSTON SV300S37A60G      AAAAAAAAA            False   OK                Healthy      Auto-Select   55.9 GB
    TOSHIBA External USB 3.0   AAAAAAAAA            False   OK                Healthy      Auto-Select   3.64 TB
    SAMSUNG MZVLW512HMJP-00000 AAAAAAAAA            False   OK                Healthy      Auto-Select 476.94 GB
    There's our two drives, handily both have the same name. If they had different FriendlyNames, or the same as another disk that we didn't want to mess with, this would be more complicated.
    (and yes, I've blanked the serials)
    Code:
    Get-PhysicalDisk -FriendlyName "KINGSTON SV300S37A60G"
    
    FriendlyName          SerialNumber     CanPool OperationalStatus HealthStatus Usage          Size
    ------------          ------------     ------- ----------------- ------------ -----          ----
    KINGSTON SV300S37A60G AAAAAAAAAAAAAAAA False   OK                Healthy      Auto-Select 55.9 GB
    KINGSTON SV300S37A60G AAAAAAAAAAAAAAAA False   OK                Healthy      Auto-Select 55.9 GB
    
    CanPool is false :( why? Fortunately there is a way of finding out
    Code:
    Get-PhysicalDisk -FriendlyName "KINGSTON SV300S37A60G" | Format-Table FriendlyName,OperationalStatus,Size,MediaType,CannotPoolReason
    
    FriendlyName          OperationalStatus        Size MediaType CannotPoolReason
    ------------          -----------------        ---- --------- ----------------
    KINGSTON SV300S37A60G OK                60022480896 SSD         Insufficient Capacity
    KINGSTON SV300S37A60G OK                60022480896 SSD         Insufficient Capacity
    
    (we could have piped the command to fl, aka Format-List, which shows you all the data Get-PhysicalDisk has, and this is what I actually did first, but it produces too much output to paste without making this even longer, so we Format-Table instead and only ask for a few columns. I'll use the short form of ft from now on)

    Insufficient Capacity? wtf?
    Turns out that there was still a partition table or something on the disk, so, we need to reset it.
    ***warning, this is where you have to start being careful, otherwise you'll wipe a perfectly good harddrive***

    Reset our two SSDs. Note, I can get away with referring to them by name because I only care about these two drives.
    Code:
    Reset-PhysicalDisk -FriendlyName "KINGSTON SV300S37A60G"
    
    Did it work?
    Code:
    Get-PhysicalDisk -FriendlyName "KINGSTON SV300S37A60G" | ft
    
    FriendlyName          SerialNumber     CanPool OperationalStatus HealthStatus Usage          Size
    ------------          ------------     ------- ----------------- ------------ -----          ----
    KINGSTON SV300S37A60G AAAAAAAAAAAAAAAA True    OK                Healthy      Auto-Select 55.9 GB
    KINGSTON SV300S37A60G AAAAAAAAAAAAAAAA True    OK                Healthy      Auto-Select 55.9 GB
    
    yay!

    Code:
    Add-PhysicalDisk -PhysicalDisks $SSDs -StoragePoolFriendlyName "Storage Pool"
    (Yes, my main storage pool is called "Storage Pool", imaginative eh?)

    See if it worked
    Code:
    Get-StoragePool "Storage Pool" | Get-PhysicalDisk | ft FriendlyName,OperationalStatus,HealthStatus,Size,MediaType
    
    FriendlyName          OperationalStatus HealthStatus          Size MediaType
    ------------          ----------------- ------------          ---- ---------
    KINGSTON SV300S37A60G OK                Healthy        59861106688 SSD
    ST4000VN000-1H4168    OK                Healthy      4000762036224 HDD
    TOSHIBA DT01ACA200    OK                Healthy      2000381018112 HDD
    ST2000DM001-9YN164    OK                Healthy      2000381018112 HDD
    KINGSTON SV300S37A60G OK                Healthy        59861106688 SSD
    
    More yay! (They're also showing up in the GUI as well)

    Now time to add tiering:
    Code:
    New-StorageTier -StoragePoolFriendlyName "Storage Pool" -FriendlyName SSD_Tier -MediaType SSD
    New-StorageTier -StoragePoolFriendlyName "Storage Pool" -FriendlyName HDD_Tier -MediaType HDD
    Check what we have:
    Code:
    Get-StorageTier | ft FriendlyName,MediaType,PhysicalDiskRedundancy,ResiliencySettingName,Interleave
    
    FriendlyName MediaType PhysicalDiskRedundancy ResiliencySettingName Interleave
    ------------ --------- ---------------------- --------------------- ----------
    SSD_Tier     SSD                            1 Mirror                    262144
    HDD_Tier     HDD                            1 Mirror                    262144
    
    So each storage tier is limited to what kind of virtual disk you can create; Mirror, Parity and so on. Now, I've only got two SSDs so Mirror is the best I can do with them as part of a virtual disk, but I've got three HDDs and I'd like to be able to use them for a parity space, with some write caching, so I need a third storage tier set up for parity. It turns out I can have multiple tiers using the same drives:
    Code:
    New-StorageTier -StoragePoolFriendlyName "Storage Pool" -FriendlyName HDD_Parity_Tier -MediaType HDD -ResiliencySettingName Parity
    And now we have three:
    Code:
     Get-StorageTier | ft FriendlyName,MediaType,PhysicalDiskRedundancy,ResiliencySettingName,Interleave
    
    FriendlyName    MediaType PhysicalDiskRedundancy ResiliencySettingName Interleave
    ------------    --------- ---------------------- --------------------- ----------
    SSD_Tier        SSD                            1 Mirror                    262144
    HDD_Tier        HDD                            1 Mirror                    262144
    HDD_Parity_Tier HDD                            1 Parity                    262144
    
    Right, lets create a mirrored space, with storage tiers. Hmm, I want 1TB for now, and I don't want to use all the SSDs, so I think 955GB on the harddrives, and 45 on the SSDs. This is the only downside of storage tiers as they stand right now, you have to specify up front how big you want the disk, and you can't expand it later.
    Much easier working with short variables, so I'm going to specify the two tiers I want to work with right now:
    Code:
    $ssd_tier = Get-StorageTier -FriendlyName "SSD_Tier"
    $hdd_tier = Get-StorageTier -FriendlyName "HDD_Tier"
    Right, now the moment of truth:
    Code:
    New-VirtualDisk -StoragePoolFriendlyName "Storage Pool" -FriendlyName "Tierd-Mirror" -StorageTiers @($ssd_tier, $hdd_tier) -StorageTierSizes @(45GB, 955GB) -ResiliencySettingName Mirror -WriteCacheSize 1GB
    (took me a few goes before it worked, because I specified 55GB of SSD and 3955GB of HDD, neither of which is available, I am an idiot)
    Lets see if it worked:
    Code:
    Get-VirtualDisk | ft FriendlyName,HealthStatus,ResiliencySettingName,ProvisioningType,AllocatedSize
    
    FriendlyName HealthStatus ResiliencySettingName ProvisioningType AllocatedSize
    ------------ ------------ --------------------- ---------------- -------------
    Vid          Healthy      Parity                Thin              348429221888
    Tierd-Mirror Healthy                                             1073741824000
    Mirror       Healthy      Mirror                Thin              330980917248
    
    Hmm, resiliency setting is blank, I'm sure that'll be fine...
    And now it's showing up in the GUI, just need to format it from there.

    And now to check it's doing what it should. To force Windows to optimise the storage (ie to move the commonly accessed data to the SSDs), we use good old defrag

    Code:
    defrag m: /g /h /#
    Microsoft Drive Optimizer
    Copyright (c) Microsoft Corp.
    
    Invoking tier optimization on Mirror (M:)...
    
    
    The operation completed successfully.
    
    Post Defragmentation Report:
    
            Volume Information:
                    Volume size                 = 999.81 GB
                    Free space                  = 649.21 GB
    
            Storage Tier Optimization Report:
    
                    % I/Os Serviced from Perf Tier  Perf Tier Size Required
                    100%                            18.31 MB *
                    95%                             17.37 MB
                    90%                             16.43 MB
                    85%                             15.56 MB
                    80%                             14.62 MB
                    75%                             13.68 MB
                    70%                             12.81 MB
                    65%                             11.87 MB
                    60%                             10.93 MB
                    55%                             10.06 MB
                    50%                             9.12 MB
                    45%                             8.18 MB
                    40%                             7.31 MB
                    35%                             6.37 MB
                    30%                             5.43 MB
                    25%                             4.56 MB
                    20%                             3.62 MB
                    15%                             2.68 MB
                    10%                             1.81 MB
                    5%                              896.00 KB
    
            * Current size of the Performance tier: 44.87 GB
              Percent of total I/Os serviced from the Performance tier: 89%
    
            Size of files pinned to the Performance tier: 0 bytes
            Percent of total I/Os: 0%
    
            Size of files pinned to the Capacity tier: 0 bytes
            Percent of total I/Os: 0%
    
    I think we can now declare victory :)
    Hopefully this is enough to help other people do similar stupid things, like use undocumented, unsupported, enterprise storage technologies on their home machines.
     
  2. daveypro

    daveypro Minimodder

    Joined:
    5 Jul 2011
    Posts:
    116
    Likes Received:
    15
    nice guide mate, i will have a look at this later at home.
     
  3. phuzz

    phuzz This is a title

    Joined:
    28 May 2004
    Posts:
    1,710
    Likes Received:
    24
    Right, little update here. This week I've started to get some weird hangs in Windows, which I tracked down to anything that attempted to access my tiered mirror drive.
    A quick check in the Storage Spaces GUI confirmed my fears, one of the SSDs I was using as a cache was showing a warning. Fortunately 60GB SSDs are cheap as chips these days, so I grabbed a new one (well, two, I'm expecting the other Kingston SSD to go bad one of these days), and went to plug it in.
    First problem, the bad SSD had got so bad that the system wouldn't boot with it plugged in. Fortunately I'd made a note of the serial number of the failed one where it was listed in the StorageSpaces GUI.

    So, here's my little howto on "oh **** one of my tiered SSDs has died how do I fix it?"

    First, go into the Storage Spaces GUI and work out which one it is. Make sure to write down the SN so you unplug the right one (important if you're using otherwise identical drives).
    Get hold of a new disk of at least the same size (and maybe think about grabbing a pre-emptive replacement for the other SSD) and plug it in. (I've temporarily unplugged my DVD drive to give me a spare SATA port).
    Once the new disk is connected, boot up and go check it's detected in Disk Management, or use Powershell:

    Code:
    Get-PhysicalDisk
    Number FriendlyName               MediaType   CanPool OperationalStatus  HealthStatus Usage            Size
    ------ ------------               ---------   ------- -----------------  ------------ -----            ----
           SSD1                       SSD         False   Lost Communication Warning      Retired      55.75 GB
    2      TOSHIBA                    HDD         False   OK                 Healthy      Auto-Select   3.64 TB
    3      ST4000VN000-1H4168         HDD         False   OK                 Healthy      Auto-Select   3.64 TB
    1      SSD2                       SSD         False   OK                 Healthy      Auto-Select  55.75 GB
    9      Corsair Force LS SSD       SSD         False   OK                 Healthy      Auto-Select   55.9 GB
    4      WDC WD40EZRZ               HDD         False   OK                 Healthy      Auto-Select   3.64 TB
    The top line is my broken (and now disconnected) SSD, the new one is disk no. 9 (the Corsair drive)

    Now the new disk had some previous partitions on, so they need to be removed first. As there's only one Corsair drive this isn't too tricky: WARNING, this will wipe the disk, so be really bloody careful that it's the right one!
    Code:
    Reset-PhysicalDisk -FriendlyName "Corsair Force LS SSD"
    Now we just need to add it to the pool:
    First, create a variable who's contents is the new disk
    Code:
    $corse = Get-PhysicalDisk -FriendlyName "Corsair Force LS SSD"
    Now add that disk
    Code:
    Add-PhysicalDisk -PhysicalDisks $corse -StoragePoolFriendlyName "Storage Pool"
    (the name of your storage pool may vary, but it will probably be the one above).
    That's it for the Powershell this time, although I suppose there's no reason you couldn't run Optimize-StoragePool right now.
    Otherwise, let's head back to the GUI and make sure our new disk is showing up. (I forgot to get screenshots so you'll just have to imagine this bit).
    Hopefully it's showing up, so click the 'Change Settings' button, and then 'Optimise drive usage'. This will copy all the data onto the new disk. This might take a little while to complete, but when it has, you can go ahead and click the 'Remove' button next to your fialed drive, so it's compltely gone from the pool.
    That's it, disk crisis averted, and my tiered storage space is still ticking along (and the strange lags and hangs I was getting are gone now that the failing SSD is disconnected).
     

Share This Page