SasseasaService
4 months agoPuritan
Configure Fusion with Powershell!
Here's a little Powershell script to get a new FlashArray Fusion Fleet up and running and verify you can deploy a 1GB test volume on array 2 even though you're connected to array 1!
You'll need PureStoragePowershellSDK2 v2.4.30 or newer, Purity 6.8.1 or newer, and both arrays configured to use the same LDAP or Active Directory infrastructure for management to run it.
The script will prompt you for two FlashArrays to connect to, what you'd like to name the new fleet, and LDAP/Active Directory credentials with array admin rights on both arrays.
If you haven't tried Fusion yet and like automating with Powershell, give it a try!
####################################################################################
# Script to create a new Fusion fleet, add a second array to the fleet, and
# create a new 1GB test volume on array 2 via a command sent to array 1.
#
# Mike Sasse - 8/15/2025 - v1.0
####################################################################################
#Stop the script if any command throws an error
$ErrorActionPreference = "Stop"
#Display script function and requirements
Write-Host "This script will create a new Fusion fleet, add a second array to the fleet, and"
Write-Host "create a new test volume on array 2 via a command sent to array 1."
Write-Host "`nPure Storage SDK2 2.43.30+ must be installed and both arrays must be running Purity 6.8.1+."
#Import Pure Storage PowerShell SDK2
Import-Module PureStoragePowerShellSDK2
#Prompt user for the two FlashArrays
$FlashArray1Name = Read-Host "Enter the first FlashArray FQDN or IP"
$FlashArray2Name = Read-Host "Enter the second FlashArray FQDN or IP"
#Prompt user for new fleet name
$Fleet = Read-Host "Enter the new fleet name"
#Get credentials to connect to the two FlashArrays
Write-Host "Enter LDAP/Active Directory credentials with array admin rights to be used to connect to both FlashArrays:"
$Creds = Get-Credential
#Connect to both FlashArrays
Write-Host "`nConnecting to $FlashArray1Name..."
$FlashArray1 = Connect-Pfa2Array -Endpoint $Flasharray1Name -Credential $Creds -IgnoreCertificateError
Write-Host "`nConnecting to $FlashArray2Name..."
$FlashArray2 = Connect-Pfa2Array -Endpoint $Flasharray2Name -Credential $Creds -IgnoreCertificateError
#Store the new test volume name as a variable
$volumeName = "FusionTestVolume"
#Store the new test volume size as a variable
$Size = "1GB"
#Create the new fleet via FlashArray 1 and pipe the output to null
Write-Host "`nCreating new fleet named $Fleet on $FlashArray1Name..."
New-Pfa2Fleet -Array $FlashArray1 -Name $Fleet | Out-Null
#Create a new fleet key and store as a variable
Write-Host "`nFetching new fleet key..."
$FleetKey = New-Pfa2FleetKey -Array $FlashArray1
#Grab FlashArray 2 and store as a variable
$FA2 = Get-Pfa2Array -Array $FlashArray2
#Join FlashArray 2 to the fleet and pipe the output to null
Write-Host "`nJoining $Flasharray2Name to $Fleet..."
New-Pfa2FleetMember -Array $FlashArray2 -FleetName $Fleet -MembersKey $FleetKey._FleetKey -MemberName $FA2.Name -MemberResourceType remote-arrays | Out-Null
#Create a new test volume on FlashArray 2 via FlashArray 1 and pipe the output to null
Write-Host "`nCreating new volume $volumeName on $Flasharray2Name through $Flasharray1Name..."
New-Pfa2Volume -Array $FlashArray1 -Name $volumeName -Provisioned $Size -ContextNames $FA2.Name | Out-Null
Write-Host "`nComplete!"