A new feature called Preferred Protection groups was shipped with the 5.1.0 release of the storage replication adapter (SRA). This Guide goes over how to use and leverage this new feature.
Historically there has been an existing issue with using the SRA with SRM when a protected volume has been a member of multiple FlashArray protection groups. This issue would be that the SRA could be inconsistent when determining which protection group's snapshots should be used to recover the volumes on the recovery FlashArray. Additionally there could be conditions in which not all volumes that back the datastores protected in the SRM consistency group would be part of the same FlashArray protection group.
Setting a preferred protection group from the target array will allow SRA to use snapshots from a specific FlashArray protection group when running test failover, failover and recovery workflows. Currently the best way to leverage this feature is with the FlashArray PowerShell SDK. In the future there will be feature with the vSphere Plugin to support preferred protection groups for SRM as well. At this moment this guide will cover how to use preferred protection groups with only PowerShell.
Here are the overall steps for using preferred protection groups:
-
Connect to Source and Target FlashArrays
-
Get the Source and Target FlashArray UUID
-
Get the FlashArray Target Protection Group UUID
-
Set the Preferred Protection Group Tag on SRM Protected Volume(s)
After a failover and re-protect have been issued, you will need to run through these steps again in order to ensure that the preferred protection group is being used at the promoted site.
SRA Preferred Protection Groups with PowerShell
These are all of the steps, workflow and an example of using preferred protection groups with PowerShell.
Connect to Source and Target FlashArray with PowerShell
You will need to be using the PowerShell SDK2 in order to get the correct information and to set the tag. Please ensure that the Everpure PowerShell SDK2 is installed prior to running through this guide.
The first step is connecting with both the source and target arrays. Here is an example of setting variables for the source and target FlashArray connections
$SourceFlasharray = Connect-Pfa2Array -Endpoint 'source-fa-ip' -Credential (Get-Credential) -IgnoreCertificateError
$TargetFlasharray = Connect-Pfa2Array -Endpoint 'target-fa-ip' -Credential (Get-Credential) -IgnoreCertificateError
Getting the FlashArray UUID with PowerShell
Next go ahead and get the UUID for the source and target arrays. Make note of the target array UUID in particular as it will be required for tagging the protected volumes.
(Get-Pfa2Array -Array $SourceFlasharray).Id
(Get-Pfa2Array -Array $TargetFlasharray).Id
Getting the FlashArray Protection Group UUID with PowerShell
From the target array you will need to get the array target protection group's UUID. The protection group name will be in the format of "source-array-name:pgroup-name". If the array name is not in front of a ":" then you are not looking at a target protection group.
(Get-Pfa2ProtectionGroup -Array $TargetFlasharray -Name 'source-fa:srm-pg-01').Id
Setting the Preferred Protection Group Volume Tag with PowerShell
The standard format for setting the preferred protection group volume tag will as follows:
| Namespace | puresra |
| Key | preferred-pgroup-"target-array-uuid" |
| Value | "target-pgroup-uuid" |
| Copyable | True |
The tags need to be copyable so the snapshots and volumes copied out from the snapshots retain this tag. The namespace needs to be the puresra namespace. The key and value are fairly straight forward. While this can be done from the purecli, since you are already going to be in PowerShell and connected with the array, may as well tag the volume here.
Set-Pfa2VolumeTagBatch -Array $SourceFlasharray -ResourceNames "sourceVolume-name" -TagKey 'preferred-pgroup-1b3b6626-dd3a-44c8-xxxx-a4434365dad9' -TagValue 'a492f65b-4b62-d5c5-xxxx-941b5ecce9a5' -TagNamespace 'puresra' -TagCopyable $true
While this example is only showing the tag being set on one volume, in practice there will likely be more than one volume needing to have this set.
Best practice here should be to ensure that all volumes that are protected in the SRM protection group be part of the same preferred pgroup. You do not want to have volumes in the same SRM protection group having different preferred pgroups.
PowerShell Example of all the Steps Together
Here is an example of running through all of the steps
## Connecting to the Arrays ##
$SourceFlasharray = Connect-Pfa2Array -Endpoint 'source-fa-ip' -Credential (Get-Credential) -IgnoreCertificateError
$TargetFlasharray = Connect-Pfa2Array -Endpoint 'target-fa-ip' -Credential (Get-Credential) -IgnoreCertificateError
$SourceFlasharray
ArrayName ApiVersion
--------- ----------
source-fa-ip 2.34
$TargetFlasharray
ArrayName ApiVersion
--------- ----------
target-fa-ip 2.34
## Getting Array UUID ##
$SourceArrayId = (Get-Pfa2Array -Array $SourceFlasharray).Id
$SourceArrayId
36c08e57-2d34-4e36-xxxx-42a4bcf520bd
$TargetArrayId = (Get-Pfa2Array -Array $TargetFlasharray).Id
$TargetArrayId
1b3b6626-dd3a-44c8-xxxx-a4434365dad9
## Getting Target Protection Group UUID ##
$TargetPgId = (Get-Pfa2ProtectionGroup -Array $TargetFlasharray -Name 'source-fa:srm-pg-01').Id
$TargetPgId
a492f65b-4b62-d5c5-xxxx-941b5ecce9a5
## Setting Preferred Protection Group Tag on the Protected Volume ##
## First set a variable for the source volume or volumes ##
$sourceVolume = Get-Pfa2Volume -Array $SourceFlasharray -Name 'prod-vcsa-vmfs-ds-01'
##Then set the tag ##
Set-Pfa2VolumeTagBatch -Array $SourceFlasharray -ResourceNames $sourceVolume.Name -TagKey "preferred-pgroup-$($TargetArrayId)" -TagValue $TargetPgId -TagNamespace 'puresra' -TagCopyable $true
Copyable : True
Key : preferred-pgroup-1b3b6626-dd3a-44c8-xxxx-a4434365dad9
Namespace : puresra
Resource : @{Id='e06f8100-792a-f3ab-xxxx-c4558a8bddc5'; Name='prod-vcsa-vmfs-ds-01'}
Value : a492f65b-4b62-d5c5-xxxx-941b5ecce9a5
There are going to be several ways that this can be done in a more automated fashion, but the purpose of this guide is to show the standard process.
In the event that I do run a failover and re-protect, then here is an example of setting the tag for the reversed relationship.
## Getting the new Target Volume ##
$targetVolume = Get-Pfa2Volume -Array $TargetFlasharray -Name 'prod-vcsa-vmfs-ds-01'
## Getting the new Target Pgroup UUID on the old source array ##
$SourcePgId = (Get-Pfa2ProtectionGroup -Array $SourceFlasharray -Name 'target-fa:srm-pg-01').Id
$SourcePgId
d5a43459-e730-9fe6-xxxx-d1d8ad023e06
## Setting the Tag ##
Set-Pfa2VolumeTagBatch -Array $TargetFlasharray -ResourceNames $targetVolume.Name -TagKey "preferred-pgroup-$($SourceArrayId)" -TagValue $SourcePgId -TagNamespace 'puresra' -TagCopyable $true
Copyable : True
Key : preferred-pgroup-36c08e57-2d34-4e36-aab4-42a4bcf520bd
Namespace : puresra
Resource : @{Id='97bd6fe2-7e07-d541-1801-ed1953305878'; Name='sn1-xl130-c12-17-prod-vcsa-vmfs-ds-01'}
Value : d5a43459-e730-9fe6-f3d3-d1d8ad023e06
## I can then check on the tagging to confirm that we are fully re-protected and using preferred pgroups ##
Get-Pfa2VolumeTag -Array $TargetFlasharray -Namespaces 'puresra'
Copyable : True
Key : preferred-pgroup-1b3b6626-dd3a-44c8-xxxx-a4434365dad9
Namespace : puresra
Resource : @{Id='97bd6fe2-7e07-d541-xxxx-ed1953305878'; Name='prod-vcsa-vmfs-ds-01'}
Value : a492f65b-4b62-d5c5-xxxx-941b5ecce9a5
Copyable : True
Key : preferred-pgroup-36c08e57-2d34-4e36-xxxx-42a4bcf520bd
Namespace : puresra
Resource : @{Id='97bd6fe2-7e07-d541-xxxx-ed1953305878'; Name='prod-vcsa-vmfs-ds-01'}
Value : d5a43459-e730-9fe6-xxxx-d1d8ad023e06