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
Hey thanks for the script.
Any way to find list down volumes in recycle bin?
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
Barkz,
hope all is well! do you have updated commands for powershell sdk v2? seems like some of these commands cannot convert string name.
Hi JDubb — Check back on my blog tomorrow for some news.
Cheers — Barkz
The SDK 2 does not seem to include a corresponding command for Get-PfaHostVolumeConnections. How can the connected volumes be pulled with SDK 2?
Hi Mr. Jones — Reach out to Mike Nelson, mnelson@purestorage.com. Cheers.