Restoring Protection Group Volume Snapshots

FlashRecover protection groups can be defined at all the different object levels the FlashArray supports; volumes, hosts and host groups. Whenever a snapshot is created, the individual objects in the protection group are snapped together to create a point-in-time consistency group called a protection group snapshot. FlashRecover protection groups can be defined and managed from the Pure Storage GUI, CLI and Windows PowerShell. Protection groups are required for scheduling snapshots to occur locally or for snapshot to be replicated.

Microsoft SQL Server is a typical candidate for using a protection group as there may be many databases spread across multiple volumes, hosts or host groups. When defining the protection group and local snapshot policy a schedule can be created that includes how often to create a snapshot and length of retention.

define_snapshot_sched

Protection group snapshots allow you to recover volumes on the local array, for recovering from corruption or user error, or for creating clones for test & development. Protection group snapshots that are replicated to a target array can be used to recover from a disaster or can be cloned for creating dev/test instances on a secondary array.

One challenge when working with protection group snapshots is that each volume in the protection group must be recovered or cloned in order to recover the whole protection group. I’ve implemented a new cmdlet that allows you to easily recover all the volumes in a protection group snapshot in one single operation.

In this example I’ll use a protection group snapshot replicated from source array cs-perf-pure-02 with 6 members which are all volumes.

Members

For discussion purposes lets suppose that the above schedule has been executing and has created 2 snapshots.

snapshots

These 2 snapshots each contain a consistency group of the 6 members (volumes).

pgroup_volume_snapshot_view

Restoring each of the members of the snapshot requires that each individual snapshot be copied to a new volume that can then be attached to a host or host group.

Copy

If we think about this situation and relate it to a disaster recovery scenario every second of downtime is crucial and this process would need further automation to support the business requirements. Thinking back to the example scenario of using Microsoft SQL Server we know that we are dealing with a Windows Server environment. With Windows we can take advantage of Pure Storage PowerShell Toolkit to automate this process and recover all of the volumes from this protection group snapshot in one operation.

Note: An important point to note about the above PowerShell is that the calling cmdlet at the bottom of the example script assumes that there is an established Session created (eg. $FASession).

I implemented by creating the Restore-PfaProtectionGroupVolumeSnapshots function which uses other toolkit cmdlets (Get-PfaProtectionGroup and New-PfaVolume). After running the function with the parameters ProtectionGroup, VolumeSnapshots, Prefix and Session each of the individual volume snapshots have been restored.

recovered_volumes

This new function is now part of the updated release of the Pure Storage PowerShell Toolkit v2.2.1.302. The toolkit can be downloaded from https://github.com/barkz/PureStoragePowerShellToolkit GitHub or through the Pure Storage Community.

May-the-POSH-be-with-you,
barkz

  • Nathan

    I take it that the members in the protection group needs to be volumes & not Hosts or host groups?

    • Hi Nathan –

      That is correct. Is a Host or Host Group an option you are looking to support? The one detail I wanted to avoid was automatically creating a large number of volumes that were connected to the Host or Host Group. I am working on an updated version of the Pure Storage PowerShell Toolkit 3 which leverages the PowerShell SDK for some operations.

      Thanks,
      Barkz