Skip to content

Get-StorageTierSupportedSize result is invalid #4122

Description

@i3v

Prerequisites

  • Existing Issue: Search the existing issues for this repository. If there is an issue that fits your needs do not file a new one. Subscribe, react, or comment on that issue instead.
  • Descriptive Title: Write the title for this issue as a short synopsis. If possible, provide context. For example, "Typo in Get-Foo cmdlet" instead of "Typo."
  • Verify Version: If there is a mismatch between documentation and the behavior on your system, ensure that the version you are using is the same as the documentation. Check this box if they match or the issue you are reporting is not version specific.

Links

Summary

The TierSizeMax property of the Get-StorageTierSupportedSize result is not explicitly defined and counterintuitive. AFAIU, it is also not calculated correctly. I think that this is a major bug in a critical subsystem and thus it should be fixed ASAP.

The example below demonstrates that although TierSizeMax is 6725 GB (while the AllocatedSize is 1777.5GB), but I can actually resize this tier to 12937.5 GB. Thus, TierSizeMax is neither "how large my pre-existing tier could become", nor "how large a new, additional tier could be".

Details

Here's the full example:

$StoragePoolName = "DataStorePool1"
$VDiskName = "DataStoreVDisk1"
$ResiliencySetting = "Simple"
$SSDTierName = "SSDTier"
$HDDTierName = "HDDTier"

#List all disks that can be pooled and output in table format (format-table)
Get-PhysicalDisk -CanPool $True | ft FriendlyName,OperationalStatus,Size,MediaType,SerialNumber

#Store all physical disks that can be pooled into a variable, $PhysicalDisks
$PhysicalDisks = (Get-PhysicalDisk -CanPool $True | Where FriendlyName -NE "ATA Samsung SSD 870")
$PhysicalDisks

#  Number FriendlyName         SerialNumber                             MediaType CanPool OperationalStatus HealthStatus Usage           Size
#  ------ ------------         ------------                             --------- ------- ----------------- ------------ -----           ----
#  9      NVMe Samsung SSD 970 0025_385A_01B2_1E04.                     SSD       True    OK                Healthy      Auto-Select  1.82 TB
#  0      ATA WDC WD181KRYZ-01 3WGN974J                                 HDD       True    OK                Healthy      Auto-Select 16.37 TB
#  10     NVMe Samsung SSD 970 0025_385A_01B2_1E13.                     SSD       True    OK                Healthy      Auto-Select  1.82 TB
#  6      XPG GAMMIX S70 BLADE 0000_0000_0000_0000_707C_18E8_B47D_B752. SSD       True    OK                Healthy      Auto-Select  7.28 TB
#  8      NVMe Samsung SSD 970 0025_385A_01B2_1E02.                     SSD       True    OK                Healthy      Auto-Select  1.82 TB
#  5      ATA WUH721818ALE6L4  6RG9Z5RW                                 HDD       True    OK                Healthy      Auto-Select 16.37 TB
#  1      ATA WDC WD181KRYZ-01 3WJKB5LK                                 HDD       True    OK                Healthy      Auto-Select 16.37 TB
#  4      ATA WUH721818ALE6L4  6RG9Z5UW                                 HDD       True    OK                Healthy      Auto-Select 16.37 TB

$PD_set1 = $PhysicalDisks | Where-Object { $_.SerialNumber -like "0025_385A_01B2_1E04*" -or $_.FriendlyName -like "*WD181KRYZ*"}

#Create a new Storage Pool using the disks in variable $PD_set1, to ensure appropriate number of columns
$SubSysName = (Get-StorageSubSystem).FriendlyName
New-StoragePool -PhysicalDisks $PD_set1 -StorageSubSystemFriendlyName $SubSysName -FriendlyName $StoragePoolName

#View the disks in the Storage Pool just created
Get-StoragePool -FriendlyName $StoragePoolName | Get-PhysicalDisk | Select FriendlyName, MediaType

#Create two tiers in the Storage Pool created. One for SSD disks and one for HDD disks
$SSDTier = New-StorageTier -StoragePoolFriendlyName $StoragePoolName -FriendlyName $SSDTierName -MediaType SSD -NumberOfColumns 1 -ResiliencySettingName $ResiliencySetting  # default interleave 

$HDDTier = New-StorageTier -StoragePoolFriendlyName $StoragePoolName -FriendlyName $HDDTierName -MediaType HDD -NumberOfColumns 2 -ResiliencySettingName $ResiliencySetting  # default interleave 

#Identify tier sizes within this storage pool
$SSDTierSizes = (Get-StorageTierSupportedSize -FriendlyName $SSDTierName -ResiliencySettingName $ResiliencySetting).TierSizeMax
$HDDTierSizes = (Get-StorageTierSupportedSize -FriendlyName $HDDTierName -ResiliencySettingName $ResiliencySetting).TierSizeMax

#Create a new virtual disk in the pool with a name of TieredSpace using the SSD and HDD tiers -----------------------------------------------

       
# case_20 (NTFS - formatted, 32K cluster size), final
$WbcSize  = 32GB
$ssd_usable = $SSDTierSizes - ($WbcSize * 2) - 20GB
$hdd_usable = $HDDTierSizes - 100GB
New-VirtualDisk -StoragePoolFriendlyName $StoragePoolName -FriendlyName $VDiskName -StorageTiers $SSDTier, $HDDTier -StorageTierSizes @($ssd_usable, $hdd_usable) -ResiliencySettingName $ResiliencySetting  -WriteCacheSize ($WbcSize) -ProvisioningType Fixed -NumberOfDataCopies 1 -Interleave 256KB

 
 
# check actual number of columns:
Get-VirtualDisk -FriendlyName "DataStoreVDisk1" | Get-StorageTier | Select FriendlyName, NumberOfColumns, ResiliencySettingName
#
# FriendlyName            NumberOfColumns ResiliencySettingName
# ------------            --------------- ---------------------
# DataStoreVDisk1-SSDTier               1 Simple
# DataStoreVDisk1-HDDTier               2 Simple


# add other disks
$PhysicalDisks = (Get-PhysicalDisk -CanPool $True | Where FriendlyName -NE "ATA Samsung SSD 870")
Add-PhysicalDisk -PhysicalDisks $PhysicalDisks -StoragePoolFriendlyName $StoragePoolName

Get-VirtualDisk -FriendlyName $VDiskName | Get-StorageTier
# 
# FriendlyName            TierClass   MediaType ResiliencySettingName FaultDomainRedundancy     Size FootprintOnPool StorageEfficiency
# ------------            ---------   --------- --------------------- ---------------------     ---- --------------- -----------------
# DataStoreVDisk1-SSDTier Performance SSD       Simple                0                      1.75 TB         1.75 TB           100.00%
# DataStoreVDisk1-HDDTier Capacity    HDD       Simple                0                     32.73 TB        32.73 TB           100.00%

# ======================================= Optimize =====================================================================

Optimize-StoragePool -FriendlyName $StoragePoolName
Get-StorageJob
# Name                         IsBackgroundTask ElapsedTime JobState PercentComplete BytesProcessed BytesTotal
# ----                         ---------------- ----------- -------- --------------- -------------- ----------
# DataStorePool1-Optimize      False            1.11:31:12  Running  97                    35.75 TB   36.72 TB
# DataStorePool1-Optimize      False            1.11:31:12  Running  97                    35.75 TB   36.72 TB
# DataStoreVDisk1-Regeneration True             00:00:10    Running  50                     4.06 GB       8 GB

Get-StorageTier | Select-Object FriendlyName, @{L='Size(GB)';E={$_.Size/1GB}}, @{L='AllocatedSize(GB)';E={$_.AllocatedSize/1GB}}
# FriendlyName            Size(GB) AllocatedSize(GB)
# ------------            -------- -----------------
# DataStoreVDisk1-SSDTier   1777.5            1777.5
# SSDTier                        0                 0
# DataStoreVDisk1-HDDTier    33426             33426
# HDDTier                        0                 0
#
# I've got no idea why it creates two new tiers, instead of using those I've explicitly provided...

Remove-StorageTier -FriendlyName $SSDTierName
Remove-StorageTier -FriendlyName $HDDTierName

Get-StorageTier | Select-Object FriendlyName, @{L='Size(GB)';E={$_.Size/1GB}}, @{L='AllocatedSize(GB)';E={$_.AllocatedSize/1GB}}
# FriendlyName            Size(GB) AllocatedSize(GB)
# ------------            -------- -----------------
# DataStoreVDisk1-SSDTier   1777.5            1777.5
# DataStoreVDisk1-HDDTier    33426             33426

$VD_SSDTierName = $VDiskName + "-" + "SSDTier"
$VD_HDDTierName = $VDiskName + "-" + "HDDTier"

$VD_SSDTier = Get-StorageTier -FriendlyName $VD_SSDTierName
$VD_HDDTier = Get-StorageTier -FriendlyName $VD_HDDTierName

$VD_SSDTierSize_buggy_max = (Get-StorageTierSupportedSize -FriendlyName $VD_SSDTierName -ResiliencySettingName $ResiliencySetting).TierSizeMax
$VD_HDDTierSize_buggy_max = (Get-StorageTierSupportedSize -FriendlyName $VD_HDDTierName -ResiliencySettingName $ResiliencySetting).TierSizeMax

$VD_SSDTierSize_buggy_max / 1GB
6725
# Bullshit, severely underestimated.

$VD_HDDTierSize_buggy_max / 1GB
33624
# This might be correct, if this is "how much can we add"

$VD_SSDTierSize_true_max = (Get-StoragePool -FriendlyName $StoragePoolName | Get-PhysicalDisk | Where-Object {$_.MediaType -eq 'SSD'} | Measure-Object -Property Size -Sum).Sum - ($WbcSize * 2) - 40GB
$VD_HDDTierSize_true_max = (Get-StoragePool -FriendlyName $StoragePoolName | Get-PhysicalDisk | Where-Object {$_.MediaType -eq 'HDD'} | Measure-Object -Property Size -Sum).Sum - 100GB

$VD_SSDTierSize_true_max / 1TB
# 12.633873552084

$VD_HDDTierSize_true_max / 1TB
# 65.38671875

# ======================================= Resize VD ====================================================================

Resize-StorageTier -FriendlyName $VD_SSDTierName -Size  $VD_SSDTierSize_true_max
Resize-StorageTier -FriendlyName $VD_HDDTierName -Size  $VD_HDDTierSize_true_max

Get-StorageTier | Select-Object FriendlyName, @{L='Size(GB)';E={$_.Size/1GB}}, @{L='AllocatedSize(GB)';E={$_.AllocatedSize/1GB}}
# FriendlyName            Size(GB) AllocatedSize(GB)
# ------------            -------- -----------------
# DataStoreVDisk1-SSDTier  12937.5           12937.5
# DataStoreVDisk1-HDDTier    66956             66956

(Get-VirtualDisk -FriendlyName "DataStoreVDisk1").Size / 1GB
79893.5

# speedcrunch: (2+2+2+8+18*4)*1e12/2^(30) = 80093.74141693115234375

# ======================================= Format VD ====================================================================

Get-VirtualDisk -FriendlyName $VDiskName | Get-Disk | Initialize-Disk -PartitionStyle GPT

$Partition = Get-VirtualDisk -FriendlyName $VDiskName | Get-Disk | New-Partition -UseMaximumSize -DriveLetter H

Format-Volume -Partition $Partition -FileSystem NTFS -AllocationUnitSize 64KB -NewFileSystemLabel "HData"
# DriveLetter FriendlyName FileSystemType DriveType HealthStatus OperationalStatus SizeRemaining     Size
# ----------- ------------ -------------- --------- ------------ ----------------- -------------     ----
# H           HData        NTFS           Fixed     Healthy      OK                     78.02 TB 78.02 TB

Suggested Fix

  1. Please explicitly define the intended meaning of the TierSizeMax in the docs

    • Is it "how large my pre-existing tier could become" or "how large a new, additional tier could be" or "just a mild suggestion about either"?
  2. Please document down the arithmetic behind this.

    • Is it correct, that I should subtract the $WbcSize * 2 (based on my old experiments, it looks like Write-Back cache footprint is twice it's size (i.e. it's probably always a 2-way mirror, despite this is not documented anywhere)
    • Please document down if I need to subtract a few more GB for the various metadata (how much?)
    • Please document down if I need to leave some "unallocated space" for the tier-optimization to work adequately.
    • Please document down how is the TierSizeMax related to the The capacity consumption of the storage pool {some-id} has exceeded the threshold limit set on the pool. Return Code: STATUS_SUCCESS message in the "StorageSpaces-Driver" event log. Especially, for the Fixed provisioning (tiered storage spaces).
  3. Please review the actual code behind the Get-StorageTierSupportedSize and fix it. Make it provide more adequate values. I guess that he VD_SSDTierSize_true_max and the VD_HDDTierSize_true_max in my example script are actually a better estimates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue-doc-bugSomething is out of date, unclear, confusing, or broken in the article. Blocks customer success.needs-triageWaiting - Needs triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions