Pure PowerShell SDK: Find All Disconnected Volumes

There are many ways to determine what volumes are connected to a host or host group, but there is no way to easily see disconnected volumes via the PowerShell SDK.

disconnected volumes

Summary

Explore how to identify disconnected volumes on Pure Storage FlashArray, now updated with the latest PowerShell SDK enhancements, Purity//FA 6.x features, and REST API capabilities for improved automation and monitoring.

image_pdfimage_print

There are many ways to determine what volumes are connected to a host or host group, but there is no way to easily see via the PowerShell SDK what volumes are disconnected/unused.

PowerShell:

Output example:

Download the script Get-DisconnectedVolumes.ps1 from https://github.com/PureStorage-OpenConnect/powershell-scripts.

Updated Methods for Finding Disconnected Volumes

Pure Storage’s PowerShell SDK and Purity Operating Environment have evolved significantly, introducing newer, more efficient ways to identify disconnected volumes. Below are the latest updates and best practices to improve this process.

1. Latest PowerShell SDK Enhancements

  • The Pure Storage PowerShell SDK has been updated multiple times since 2017, introducing new cmdlets and improved functionality for FlashArray management.
  • The original script may not be fully compatible with the latest PowerShell SDK 2.x and beyond.
  • Instead of relying on older methods, users should leverage newer, built-in cmdlets for volume status checks.

Updated PowerShell Approach:

powershell
# Connect to the FlashArray $FlashArray = Connect-PfaArray -EndPoint "flasharray.example.com" -UserName "admin" -Password "YourPassword" # Retrieve all volumes and filter disconnected ones $DisconnectedVolumes = Get-PfaVolume -Array $FlashArray | Where-Object { $_.HostConnections -eq $null } # Display disconnected volumes $DisconnectedVolumes | Select-Object Name, Size, Created, Serial

What’s New?

Improved filtering: Uses Get-PfaVolume with the HostConnections property to find disconnected volumes efficiently.
Compatibility: Works with the latest PowerShell SDK without relying on deprecated cmdlets.
Better readability and automation: Can be used in scheduled automation scripts or integrated into monitoring workflows.


2. Purity//FA 6.x+ Enhancements for Volume Management

  • Purity Operating Environment 6.x and newer includes improved volume lifecycle management, reducing the need for manual scripting.
  • New built-in logging and alerting now notify administrators of unused or disconnected volumes directly within Pure1® and FlashArray GUI.
  • Snapshot-based tracking allows better identification of inactive volumes before they become an issue.

Steps to Check Disconnected Volumes via GUI:

  1. Log into Pure1® or FlashArray GUI.
  2. Navigate to Storage > Volumes and filter by Host Connection Status = None.
  3. Review the list of disconnected volumes and take appropriate action (delete, reassign, or reclaim storage).

3. Alternative Methods for Identifying Unused Volumes

For admins who prefer API-based monitoring, the FlashArray REST API provides another way to programmatically check disconnected volumes.

Example API Call Using cURL:

bash
curl -X GET "https://flasharray.example.com/api/1.19/volume?host_connections=null" \ -H "Authorization: Bearer YOUR_API_TOKEN"
  • This method allows integration with monitoring tools like Splunk, Prometheus, or Grafana to keep track of unused storage resources.

Why These Updates Matter

By leveraging the latest PowerShell SDK, Purity//FA updates, and REST API capabilities, organizations can:

  • Automate disconnected volume detection more efficiently.
  • Reduce manual intervention by using Pure1® alerts and built-in GUI filtering.
  • Improve storage utilization by identifying and reclaiming unused volumes proactively.
enterprise strategy