Sometimes after we have configured a piece of infrastructure in production it would be nice to see what we have done right?
Well, unfortunately for Storage Spaces Direct a lot of these functions are still trapped inside of the PowerShell Providers that are exposed.
So, we need to work a little bit of magic to get the information that we want out.
Fortunately for you there are some extremely smart people that work on the Microsoft Storage Team and one of them is Cosmos Darwin.
He has authored the amazing Script ShowPrettyLittleVolumes and I use it all the time when deploying Storage Spaces Direct.
Viewing S2D Volume info with Show Pretty Volume
This was a great script authored by Cosmos Darwin Storage PM at Microsoft. It will return a pretty little output from your newly minted S2D Cluster.
Here is the PowerShell Script he wrote:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | # Written by Cosmos Darwin, PM # Copyright (C) 2016 Microsoft Corporation # MIT License # 8/2016 Function ConvertTo-PrettyCapacity { <# .SYNOPSIS Convert raw bytes into prettier capacity strings. .DESCRIPTION Takes an integer of bytes, converts to the largest unit (kilo-, mega-, giga-, tera-) that will result in at least 1.0, rounds to given precision, and appends standard unit symbol. .PARAMETER Bytes The capacity in bytes. .PARAMETER RoundTo The number of decimal places for rounding, after conversion. #> Param ( [ Parameter ( Mandatory = $True , ValueFromPipeline = $True ) ] [Int64] $Bytes , [Int64] $RoundTo = 0 # Default ) If ( $Bytes -Gt 0) { $Base = 1024 # To Match PowerShell $Labels = ( "bytes" , "KB" , "MB" , "GB" , "TB" , "PB" , "EB" , "ZB" , "YB" ) # Blame Snover $Order = [Math] ::Floor( [Math] ::Log( $Bytes , $Base ) ) $Rounded = [Math] ::Round( $Bytes /( [Math] ::Pow( $Base , $Order ) ), $RoundTo ) [String] ( $Rounded ) + $Labels [ $Order ] } Else { 0 } Return } Function ConvertTo-PrettyPercentage { <# .SYNOPSIS Convert (numerator, denominator) into prettier percentage strings. .DESCRIPTION Takes two integers, divides the former by the latter, multiplies by 100, rounds to given precision, and appends "%". .PARAMETER Numerator Really? .PARAMETER Denominator C'mon. .PARAMETER RoundTo The number of decimal places for rounding. #> Param ( [ Parameter ( Mandatory = $True )] [Int64] $Numerator , [ Parameter ( Mandatory = $True )] [Int64] $Denominator , [Int64] $RoundTo = 0 # Default ) If ( $Denominator -Ne 0) { # Cannot Divide by Zero $Fraction = $Numerator / $Denominator $Percentage = $Fraction * 100 $Rounded = [Math] ::Round( $Percentage , $RoundTo ) [String] ( $Rounded ) + "%" } Else { 0 } Return } ### SCRIPT... ### $Output = @() # Query Cluster Volumes $Volumes = Get-StorageSubSystem Cluster* | Get-Volume ForEach ( $Volume in $Volumes ) { # Get MSFT_Volume Properties $Label = $Volume .FileSystemLabel $Capacity = $Volume .Size | ConvertTo-PrettyCapacity $Used = ConvertTo-PrettyPercentage ( $Volume .Size - $Volume .SizeRemaining) $Volume .Size If ( $Volume .FileSystemType -Like "*ReFS" ) { $Filesystem = "ReFS" } ElseIf ( $Volume .FileSystemType -Like "*NTFS" ) { $Filesystem = "NTFS" } # Follow Associations $Partition = $Volume | Get-Partition $Disk = $Partition | Get-Disk $VirtualDisk = $Disk | Get-VirtualDisk # Get MSFT_VirtualDisk Properties $Footprint = $VirtualDisk .FootprintOnPool | ConvertTo-PrettyCapacity $Efficiency = ConvertTo-PrettyPercentage $VirtualDisk .Size $VirtualDisk .FootprintOnPool # Follow Associations $Tiers = $VirtualDisk | Get-StorageTier # Get MSFT_VirtualDisk or MSFT_StorageTier Properties... If ( $Tiers .Length -Lt 2) { If ( $Tiers .Length -Eq 0) { $ReadFrom = $VirtualDisk # No Tiers } Else { $ReadFrom = $Tiers [0] # First/Only Tier } If ( $ReadFrom .ResiliencySettingName -Eq "Mirror" ) { # Mirror If ( $ReadFrom .PhysicalDiskRedundancy -Eq 1) { $Resiliency = "2-Way Mirror" } If ( $ReadFrom .PhysicalDiskRedundancy -Eq 2) { $Resiliency = "3-Way Mirror" } $SizeMirror = $ReadFrom .Size | ConvertTo-PrettyCapacity $SizeParity = [string] (0) } ElseIf ( $ReadFrom .ResiliencySettingName -Eq "Parity" ) { # Parity If ( $ReadFrom .PhysicalDiskRedundancy -Eq 1) { $Resiliency = "Single Parity" } If ( $ReadFrom .PhysicalDiskRedundancy -Eq 2) { $Resiliency = "Dual Parity" } $SizeParity = $ReadFrom .Size | ConvertTo-PrettyCapacity $SizeMirror = [string] (0) } Else { Write-Host -ForegroundColor Red "What have you done?!" } } ElseIf ( $Tiers .Length -Eq 2) { # Two Tiers # Mixed / Multi- / Hybrid $Resiliency = "Mix" ForEach ( $Tier in $Tiers ) { If ( $Tier .ResiliencySettingName -Eq "Mirror" ) { # Mirror Tier $SizeMirror = $Tier .Size | ConvertTo-PrettyCapacity If ( $Tier .PhysicalDiskRedundancy -Eq 1) { $Resiliency += " (2-Way" } If ( $Tier .PhysicalDiskRedundancy -Eq 2) { $Resiliency += " (3-Way" } } } ForEach ( $Tier in $Tiers ) { If ( $Tier .ResiliencySettingName -Eq "Parity" ) { # Parity Tier $SizeParity = $Tier .Size | ConvertTo-PrettyCapacity If ( $Tier .PhysicalDiskRedundancy -Eq 1) { $Resiliency += " + Single)" } If ( $Tier .PhysicalDiskRedundancy -Eq 2) { $Resiliency += " + Dual)" } } } } Else { Write-Host -ForegroundColor Red "What have you done?!" } # Pack $Output += [PSCustomObject] @{ "Volume" = $Label "Filesystem" = $Filesystem "Capacity" = $Capacity "Used" = $Used "Resiliency" = $Resiliency "Size (Mirror)" = $SizeMirror "Size (Parity)" = $SizeParity "Footprint" = $Footprint "Efficiency" = $Efficiency } } $Output | Sort Efficiency, Volume | FT |
And here is our Output running it:
Show-PrettyVolume.PS1
This script is a great way to see more detail on what has been configured in your S2D Cluster.
Here is a view of a larger system configured with multiple Virtual Disks and Resiliency Settings.
Show-PrettyVolume.PS1 in a larger farm
Well there you have it some more cool tricks to help you manage your very own Storage Spaces Direct cluster.
Hopefully you are moving some production workloads there as we speak.
I will leave you with this quote from my husband Dave Kawula:
What is the greatest Operating System on the face of this planet?
Only Windows Server 2016 – Mic Drop – By Dave Kawula
Thanks,
Cristal
Cristal Kawula
Cristal Kawula is the co-founder of MVPDays Community Roadshow and #MVPHour live Twitter Chat. She was also a member of the Gridstore Technical Advisory board and is the President of TriCon Elite Consulting. Cristal is also only the 2nd woman in the world to receive the prestigious Veeam Vanguard award.
BLOG: http://www.checkyourlogs.net
Twitter: @supercristal1 / @mvpdays / #mvphour
Checkout www.mvpdays.com to see where the MVPDays Roadshow will be next. Maybe it will be in a city near you.