Using Protection Groups with VSS Snapshots

A common question I get about the Pure Storage Volume Shadow Copy Service (VSS) provider is; “How can I replicate a VSS snapshot?” Our VSS provider takes FlashProtect snapshots of individual volumes but those volumes cannot be part of a Protection Group. The VSS provider does know about Protection Group and does not natively provide the ability to take an application-consistent snapshot and replicate to one or more other FlashArrays.

To address this limitation in the current implementation of our VSS provider (version 1.1) I have created the below sample script to perform the following:

  1. Create a VSS snapshot using the PowerShell Toolkit.
  2. Retrieve the application-consistent snapshots (Eg. ‘*VSS*’) from the target volume.
  3. Create a new volume from the VSS snapshot.
  4. Create a new Protection Group and set the members and target FlashArray for replication.
  5. Grant the Protection Group on the target array to Allow replication.
  6. Replicate now on the source array.

This basic workflow provides the ability to replication application-consistent snapshots as soon as they are taken. I will be adding this to the PowerShell Toolkit as a wrapper to several PowerShell SDK cmdlets. In the below example there isn’t any clean-up of the work because I leave that up to the implementer using the sample script. I will add a clean-up on the cmdlet which will reverse the work and treat this as a dynamic operation.

Requirements:

  1. Install the latest VSS Provider (1.1) on the host(s). Download the installer from https://github.com/purestorage-connect/vss.
  2. Configure the VSS Provider using PureProviderConfig.
    • Example: C:\Program Files\Pure Storage\VSS\Provider\PureProviderConfig add –url https://myarray –username pureuser –password <password> MyArray
  3. Install the PowerShell SDK (1.7.4.0) on the host(s). See instructions.
  4. Install the PowerShell Toolkit (3.3.224.0) on the host(s). See for instructions.

Sample PowerShell script:

New-VolumeShadowCopy -Volume D: -ScriptName VssReplication -MetadataFile VssReplcation -VerboseMode On

$FlashArray = New-PfaArray -EndPoint 10.0.0.1-Credentials (Get-Credential) -IgnoreCertificateError

Get-PfaVolume -Array $FlashArray -Name 'boneyard3'
$VSSSnapshot = Get-PfaVolumeSnapshots -Array $FlashArray -VolumeName 'boneyard3' | ?{ $_.name -like '*VSS*' }

New-PfaVolume -Array $FlashArray -Source $VSSSnapshot.name -VolumeName 'VssReplSnapshotVol'

$Target = Get-PfaArrayConnections -Array $FlashArray
New-PfaProtectionGroup -Array $FlashArray -Name 'VssRepl-PGroup' -Volumes 'VssReplSnapshotVol' -Targets $Target.array_name

$source = 'solutions-lab-m20-c09-29:VssRepl-PGroup'
$FlashArrayRepl = New-PfaArray -EndPoint 10.0.0.2 -Credentials (Get-Credential) -IgnoreCertificateError
Grant-PfaReplicationToTargetProtectionGroup -Array $FlashArrayRepl -Name $source 

New-PfaProtectionGroupSnapshot -Array $FlashArray -Protectiongroupname 'VssRepl-PGroup' -ReplicateNow