Summary
Learn how to create volumes from Pure Storage Protection Group snapshots, now updated with the latest PowerShell SDK 2.16, enhanced cmdlets, and per-protection group SafeMode for improved data protection and ransomware resilience.
Below is an example using the PowerShell SDK . The below has also been added to the new Microsoft Platform GuidePowerShell section.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
# Connect to FA $f = New–PfaArray –EndPoint 10.0.0.1 –Credentials (Get–Credential) –IgnoreCertificateError # Get all the snapshotted volumes, this will include PGroups. Get–PfaAllVolumeSnapshots –Array $f | ft –a # Get a specific pgroup snapshot. Name of snapshot is FLASHARRAYNAME:PGROUPNAME_SNAPSHOT_NAME $PgroupSnapSource = Get–PfaVolumeSnapshots –Array $f –volumename ‘solutions-lab-bfs-405-c09-20:z-nightly-replica-to-PureTEC.157.arvnd-Boot-Lun-05’ # Create a new volume from the source. New–PfaVolume –Array $f –Source $PgroupSnapSource.name –VolumeName ‘barkz-test’ # Validate the volume has been created. Get–PfaVolume –Array $f –Name ‘barkz-test’ |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
source serial created name size ——— ——— ———– —— —— Mark–sql–dev–SQL–Data–Log 73E940225A2A52BB0002CA81 2016–08–03T00:50:56Z Mark–sql–dev–SQL–Data–Log.Mark–sql–dev–SQL–Data–Log 1099511627776 Mark–sql–dev–SQL–System 73E940225A2A52BB0002CA82 2016–08–03T00:51:15Z Mark–sql–dev–SQL–System.Mark–sql–dev–SQL–System 214748364800 Mark–sql–dev–SQL–Temp 73E940225A2A52BB0002CA83 2016–08–03T00:51:34Z Mark–sql–dev–SQL–Temp.Mark–sql–dev–SQL–Temp 536870912000 old–Mark–Bootlun–03–2016TP5 73E940225A2A52BB0002CEEF 2016–08–04T23:47:25Z old–Mark–Bootlun–03–2016TP5.Mark–Bootlun–Rep 161061273600 old–Mark–Bootlun–04–2016tp5 73E940225A2A52BB0002CEF0 2016–08–04T23:47:25Z old–Mark–Bootlun–04–2016tp5.Mark–Bootlun–Rep 161061273600 .......LOTS OF SNAPSHOTS...... Barkz–Bootlun–03–WS2016–DC–GUI–3 73E940225A2A52BB0003D19D 2017–10–19T17:39:00Z z–nightly–replica–to–PureTEC.157.Barkz–Bootlun–03–WS2016–DC–GUI–3 161061273600 Barkz–Bootlun–04–WS2016–DC–GUI–4 73E940225A2A52BB0003D19E 2017–10–19T17:39:00Z z–nightly–replica–to–PureTEC.157.Barkz–Bootlun–04–WS2016–DC–GUI–4 161061273600 Barkz–Bootlun–02–WS2016–DC–GUI–2 73E940225A2A52BB0003D19F 2017–10–19T17:39:00Z z–nightly–replica–to–PureTEC.157.Barkz–Bootlun–02–WS2016–DC–GUI–2 161061273600 Barkz–Bootlun–05–WS2016–DC–GUI–5 73E940225A2A52BB0003D1A0 2017–10–19T17:39:00Z z–nightly–replica–to–PureTEC.157.Barkz–Bootlun–05–WS2016–DC–GUI–5 161061273600 TBL–CH6–Somu–SVR05–BootLun–OEL 73E940225A2A52BB0003D19A 2017–10–19T17:39:00Z z–nightly–replica–to–PureTEC.157.TBL–CH6–Somu–SVR05–BootLun–OEL 107374182400 TBL–CH6–Somu–SRV02–BootLun–RHEL 73E940225A2A52BB0003D19B 2017–10–19T17:39:00Z z–nightly–replica–to–PureTEC.157.TBL–CH6–Somu–SRV02–BootLun–RHEL 107374182400 arvnd–Boot–Lun–05 73E940225A2A52BB0003D19C 2017–10–19T17:39:00Z z–nightly–replica–to–PureTEC.157.arvnd–Boot–Lun–05 75161927680 TBL–BootLun–CH6–SRV06–OEL 73E940225A2A52BB0003D1A4 2017–10–19T17:39:00Z z–nightly–replica–to–PureTEC.157.TBL–BootLun–CH6–SRV06–OEL 107374182400 CH3–Mark–Linux–Svr6–Bootlun 73E940225A2A52BB0003D1A5 2017–10–19T23:38:19Z CH3–Mark–Linux–Svr6–Bootlun.CH3–Mark–Linux–Svr6–Bootlun–Snap–Base 322122547200 source : arvnd–Boot–Lun–05 serial : 73E940225A2A52BB0003D1A7 created : 2017–10–19T17:39:00Z name : barkz–test2 size : 75161927680 name : barkz–test2 created : 2017–10–19T17:39:00Z source : arvnd–Boot–Lun–05 time_remaining : serial : 73E940225A2A52BB0003D1A7 size : 75161927680 |
The below PowerShell script example removes the manual task of picking a specific PGroup snapshot like in Part 1.
12345678910 | # Connect to FlashArray.$f = New-PfaArray -EndPoint 10.0.0.1 -Credentials (Get-Credential) -IgnoreCertificateError# Get latest PGroup Snapshots.$psoPGroup = Get-PfaAllVolumeSnapshots -Array $f | where {$_.Source -like “*Barkz-Bootlun-06-WS2016-DC-GUI-6*” -and $_.Name -like “*z-nightly-replica-to-PureTEC*”}ForEach ($PGroupSnapshot in $psoPGroup) { If ([DateTime]($PGroupSnapshot.created) -gt (get-date).addHours(-8)) { Write-Host $PGroupSnapshot.name ” — “ $PGroupSnapshot.created }} |
Note: You will notice that the Get-PfaAllVolumeSnapshots does not return a PSObject and the “created” field is returned as a string. Using [DateTime] I convert the string to a datetime and then compare that to get snapshots >8hrs.
Output:
12 | z–nightly–replica–to–PureTEC.158.Barkz–Bootlun–06–WS2016–DC–GUI–6 — 2017–10–20T15:49:00Zz–nightly–replica–to–PureTEC.159.Barkz–Bootlun–06–WS2016–DC–GUI–6 — 2017–10–20T17:39:00Z |
Updated Information:
To align with the latest advancements, consider the following updates:
1. Utilizing the Latest PowerShell SDK:
- Installation: Ensure you have the latest version of the Pure Storage PowerShell SDK installed:powershellCopyEdit
Install-Module -Name PureStorage.FlashArray -Force -AllowClobber
- Connecting to the FlashArray:powershellCopyEdit
$FlashArray = Connect-PfaArray -EndPoint "your_flasharray_ip" -UserName "your_username" -Password "your_password"
2. Creating Volumes from Protection Group Snapshots:
- Listing Protection Group Snapshots:powershellCopyEdit
# Retrieve all protection group snapshots $PgroupSnapshots = Get-PfaProtectionGroupSnapshot -Array $FlashArray
- Creating a New Volume from a Snapshot:powershellCopyEdit
# Specify the source snapshot and new volume name $SourceSnapshot = "pgroup_name.snapshot_name" $NewVolumeName = "new_volume_name" # Create the new volume New-PfaVolume -Array $FlashArray -Source $SourceSnapshot -VolumeName $NewVolumeName
3. Implementing Per-Protection Group SafeMode:
- Enabling SafeMode on a Protection Group: With the introduction of per-protection group SafeMode, you can now enable SafeMode on specific protection groups to enhance data protection:powershellCopyEdit
# Enable SafeMode on a protection group Enable-PfaProtectionGroupSafeMode -Array $FlashArray -ProtectionGroupName "pgroup_name"
- Benefits:
- Prevents deletion or modification of snapshots within the protection group.
- Provides granular control over data protection settings.
Conclusion:
By updating to the latest PowerShell SDK and leveraging new features like per-protection group SafeMode, administrators can enhance their data protection strategies and streamline the process of creating volumes from protection group snapshots.
