6/17/2023 0 Comments Accessing snapshots crystalmaker![]() Third party names may be trademarks of their respective owners. © 2015-2023 Pure Storage® (“Pure”), Portworx® and associated its trademarks can be found here as and its virtual patent marking program can be found here. PS >Restore-PfaAllVolumeOffloadSnapshot -Array $Array -Sources "array2:snap2.vol1" OffloadTargetName "offloadTarget" # Restores snapshots from "offloadTarget" on to Array $Array for the specified snapshots "array2:snap2.vol1" Restore-PfaAllVolumeOffloadSnapshot will restore snapshots from an offload target. PS >Get-PfaProtectionGroupOffloadSnapshot -Array $Array -OffloadTargetName "offTarget" -Name "protectionGroup1" ![]() Get-PfaProtectionGroupOffloadSnapshot lists snapshots for the specified Protection Group for the specified offload target. PS >Get-PfaOffloadSnapshot -Array $Array -VolumeName "vol1" -OffloadTargetName "offTarget" Get-PfaOffloadSnapshot lists snapshots for the specified volume for the specified offload target. PS >Get-PfaAllVolumeOfflaodSnapshot -Array "ArrayName" -OffloadTargetName "nfsTarget" # Lists all offloaded snapshots for all Volumes that are on "nfsTarget". Get-PfaAllVolumeOffloadSnapshot lists all of the offloaded snapshots for the specified offload target. PS >Get-PfaAllProtectionGroupOffloadSnapshot -OffloadTargetName "nfsTarget" -Array "ArrayName" # Lists all offloaded snapshots on "nfsTarget" for all protection groups. Get-PfaAllProtectionGroupOffloadSnapshot lists all of the Protection Group offloaded snapshots for the specified offload target. There are specific cmdlets that work with Offload Targets, both Volume and Protection Group targets, in the SDK version 1.x. PS >Move-PfaVolumeOrSnapshot -Array FlashArray -Name DEMO_TEST_SNAPSHOT -Container VolGroup1 To move a snapshot, use the Move-PfaVolumeOrSnapshot cmdlet. Moving a snapshot allows you to place the snapshot inside of a existing container (a Volume or Pod) on an array. PS >Restore-PfaDestroyedVolumeSnapshot -Array $FlashArray -Name DEMO_TEST_SNAPSHOT This cmdlet would work the same for a Protection Group snapshot. To recover a destroyed, but not Eradicated, volume snapshot. PS >Remove-PfaVolumeOrSnapshot -Array $FlashArray -Name DEMO_TEST_SNAPSHOT -Eradicate -Confirm PS >Get-PfaPendingDeleteVolumeSnapshots -Array $FlashArray # View the snapshots that are pending eradication use the Get-PfaPendingDeleteVolumeSnapshots cmdlet to view the volumes that are able to be eradicated. To Eradicate the snapshot, add the -Eradicate and optional -Confirm parameter. Remove-PfaVolumeOrSnapshot -array $pfa30 -name $_.name $ListAllSnap = Get-PfaVolumeSnapshots -VolumeName $purevolume -Array $pfa30 $retention = (Get-Date).adddays(-10) #$retention = (get-date).adddays(-10) To make it easier to delete volume snapshots older than a set amount of days of retention, you can use this script with the Get-PfaVolumeSnapshots cmdlet as show below: PS >Remove-PfaVolumeOrSnapshot -Array $FlashArray -Name The -array and -Name parameters must be specified. To Destroy a snapshot, use the Remove-PfaVolumeOrSnapshot cmdlet. Get-PfaVolume -Array $f -Name 'barkz-test' New-PfaVolume -Array $f -Source $PgroupSnapSource.name -VolumeName 'barkz-test' # Create a volume from the Pgroup source. $PgroupSnapSource = Get-PfaVolumeSnapshots -Array $f -volumename 'solutions-lab-bfs-405-c09-20:-Boot-Lun-05' Name of snapshot is FLASHARRAYNAME:PGROUPNAME.SNAPSHOT_NAME Get-PfaAllVolumeSnapshots -Array $f | ft -a # Get all the volume snapshots, this will include PGroups. # OPTIONAL - Used to illustrate all of the volume snapshots. ![]() ![]() $f = New-PfaArray -EndPoint 10.0.0.1 -Credentials (Get-Credential) -IgnoreCertificateError Below is an example using the Pure Storage PowerShell SDK. By not using the correct name of the Protection Group snapshot source, The creation of the volume will fail. When creating new volumes (Copy Volume) from a Protection Group snapshot, the naming convention is the devil in the details. Creating a Volume from a Protection Group Snapshot
0 Comments
Leave a Reply. |