@PSUStevens headshot

@PSUStevens blog

You are reading the blog of @PSUStevens.
You can reach me through one of the social accounts below.

How to Get Everpure Flashmodule Capacity

In this blog post I cover a lightweight PowerShell Script for auditing Everpure FlashArray flash module capacity

PSUStevens

5 minutes read

What is the capacity of each of these generic flash modules?

If you manage one or more Everpure FlashArrays, you’ve probably needed a quick answer to a simple question: What flash modules are installed, in which slot, and what is the capacity of each one? If this is you, then continue reading for more details.

Purity//FA’s UI and the combination of the CLI commands purehw and puredriveexpose this information, but neither is convenient when you want a clean tabular view across several arrays at once — for example, when planning a capacity expansion, validating that two arrays are configured identically, or feeding the data into a spreadsheet for an asset audit.

This post walks through Get-PfaModuleCapacity.ps1, a small PowerShell script I wrote that produces exactly that view. The full source is on GitHub.


What the script does

By default,Get-PfaModuleCapacity.ps1 connects to one or more Everpure FlashArray using the official PureStoragePowerShellSDK2 module and for each flash module the script produces a per-array Format-List view to the host.

For each flash module the script reports: - Name (e.g. CH0.BAY0) - Type, Protocol, Status, Details - CapacityBytes (raw integer) and Capacity (human-readable) - Model, Serial, Slot, Speed, HardwareStatus (from the hardware record)

  • Name — the chassis/bay identifier, e.g. CH0.BAY0
  • Type, Protocol, Status, Details — drive metadata from the array
  • CapacityBytes and Capacity — raw bytes plus a human-readable form like 18.32 TiB
  • Model, Serial, Slot, Speed, HardwareStatus — hardware-level fields

The interesting part is that no single SDK cmdlet returns all of this. The script gets capacity from Get-Pfa2Drive and chassis/serial/slot detail from Get-Pfa2Hardware, then joins the two on the Name field so each row tells you everything you need to know about that physical module.

It also sorts the output naturally, so BAY10 comes after BAY9 rather than after BAY1.


Prerequisites

Before running the script, you’ll need:

  1. PowerShell 7+ (recommended) or Windows PowerShell 5.1.

  2. The PureStoragePowerShellSDK2 module:

    Install-Module PureStoragePowerShellSDK2 -Scope CurrentUser
    
  3. Credentials with read access to your array(s). The script prompts once with Get-Credential and reuses the same credentials for every array you supply.

  4. Network connectivity to each array’s management endpoint.


Quick start

The simplest invocation points the script at a single array:

.\Get-PfaModuleCapacity.ps1 -FlashArrayEndpoints array1.example.com

You’ll be prompted for credentials, and the script will print a Format-List view to the host:

ArrayName      : array1
Name           : CH0.BAY0
Type           : SSD
Protocol       : NVMe
Status         : healthy
CapacityBytes  : 18316288000000
Capacity       : 18.32 TiB
Model          : DFM-37
Serial         : PSU12345678
Slot           : 1
Speed          : 32 Gb/s
HardwareStatus : ok

Auditing multiple arrays

-FlashArrayEndpoints accepts an array of values, so you can sweep several FlashArrays in one run:

.\Get-PfaModuleCapacity.ps1 -FlashArrayEndpoints array1.example.com,array2.example.com

Each array’s results are preceded by a colored banner in the host so you can scan visually for differences.

CSV output for spreadsheets and reporting

For anything beyond a quick look, switch to CSV mode. The -CsvPath parameter writes a single combined CSV containing rows from every endpoint, each row tagged with an ArrayName column so you can filter or pivot later:

.\Get-PfaModuleCapacity.ps1 `
    -FlashArrayEndpoints array1.example.com,array2.example.com `
    -CsvPath modules.csv

Open modules.csv in Excel or your favorite spreadsheet tool and you can sort by Capacity, group by Model, or count modules per chassis with a pivot table.

If you’d rather stream the CSV through a pipeline — for example, into Where-Object or another tool — use -Csv instead and the CSV will be written to stdout:

.\Get-PfaModuleCapacity.ps1 -FlashArrayEndpoints array1.example.com -Csv |
    ConvertFrom-Csv |
    Where-Object Status -ne 'healthy'

The same script that produced your spreadsheet now drives a quick health check.


How the join works (in plain terms)

If you’ve ever tried to combine results from two cmdlets in PowerShell, the pattern in this script is worth borrowing:

  1. Call both cmdlets and hold onto the results.

  2. Build a hashtable that maps Name to the hardware record:

    $hardwareByName = @{}
    foreach ($h in $hardware) { $hardwareByName[$h.Name] = $h }
    
  3. For each drive, look up the matching hardware record in the hashtable (constant time) and project a combined [pscustomobject].

This is how SQL-style joins look in PowerShell when you don’t want to install a database. It’s fast even on arrays with hundreds of modules.

A note on capacity units

Capacity is reported in IEC-style units (KiB, MiB, GiB, TiB) with a divisor of 1000 at each step. This matches how Purity reports raw module capacity in the UI, where an “18 TB” DFM is shown as 18.32 TiB after binary rounding overhead.

If you’d rather report in base-1024 units, that’s a one-line change to the Convert-ToReadableCapacity function — the script is small and easy to fork.


Getting the script

The script and its documentation live in psustevens/My-FlashArray-scripts on GitHub under the MIT license. Once cloned, run the following code to see every parameter and example documented inline.

Get-Help .\Get-PfaModuleCapacity.ps1 -Full

If you find a bug, want a new output column, or have ideas for related FlashArray scripts, issues and pull requests are welcome.


Summary

Let’s summarize what we covered in this post:

  1. What the script does
  2. Prerequisites for running the script
  3. A quick one-liner to get the basics from a single array
  4. How to obtain capacity info for multiple arrays
  5. How to output the info as a CSV and output it to a file
  6. How the data from two PowerShell SDK2 commandlets are joined together
  7. How to get the script from my Github repository

If there is something you think I’m missing and feel should be added/corrected, please let me know.
Thanks for reading!

Recent posts

See more

Categories

About

This is my personal blog about technical topics including virtualization, storage, networking, backups, and some random IT stuff that strikes my fancy.