What Volume is Connected to What Host?

There was a Pure1 Community forum question asking how to identify what volume is connected to what host?

Here are some simple scripts to display with no need to go to the Pure Storage FlashArray web management GUI.

Hosts to Volumes

$FA New-PfaArray -EndPoint 10.21.8.17 -Credentials(Get-Credential) -IgnoreCertificateError
$PureHosts Get-PfaHosts -Array $FA
ForEach ($PureHost in $PureHosts) {
  Get-PfaHostVolumeConnections -Array $FA -Name $PureHost.Name
}

Host Groups to Volumes

$FA New-PfaArray -EndPoint 10.21.8.17 -Credentials(Get-Credential) -IgnoreCertificateError
$PureHostGroups Get-PfaHostGroups -Array $FA
ForEach ($PureHostGroup in $PureHostGroups) {
  Get-PfaHostGroupVolumeConnections -Array $FA -HostGroupName $PureHostGroup.Name
}

Download Get-PfaConnections.ps1 script from GitHub (barkz/PurePowerShellGuy).

Cheers,
Barkz

  • Lazada991 Tiku

    Hey thanks for the script.
    Any way to find list down volumes in recycle bin?

    • purepowershellguy

      Glad you found the script useful. Items in the “recycle bin” are referred to as Pending Deletes. There are two ways of achieve what you are asking:
      (1) There is a parameter on the Get-PfaVolumes cmdlet -IncludePendingDeletes
      (2) Use cmdlet Get-PfaPendingDeleteVolumes

      Use Get-Help -examples to see how to use them.

      Cheers,
      Barkz