A common question I get about the Pure Storage Volume Shadow Copy Service (VSS) provider is; “How can I replicate VSS snapshots?” 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:
- Create VSS snapshots using the PowerShell Toolkit.
- Retrieve the application-consistent snapshots (Eg. ‘*VSS*’) from the target volume.
- Create a new volume from the VSS snapshot.
- Create a new Protection Group and set the members and target FlashArray for replication.
- Grant the Protection Group on the target array to Allow replication.
- 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:
- Install the latest VSS Provider (1.1) on the host(s). Download the installer from https://github.com/PureStorage-Connect/VSS-Provider.
- Configure the VSS Provider using PureProviderConfig.
- Example: C:Program FilesPure StorageVSSProviderPureProviderConfig add –url https://myarray –username pureuser –password <password> MyArray
- Install the PowerShell SDK (1.7.4.0) on the host(s). See instructions.
- Install the PowerShell Toolkit (3.3.224.0) on the host(s). See for instructions.
Sample PowerShell script:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
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 |