There are two steps in completely removing a snapshot from an array, Destroy and Eradicate. When a snapshot is removed, it is tagged as Destroyed=$true (visible with the
Get-Pfa2VolumeSnapshot cmdlet) and is maintained in that state for a set period of time. A snapshot is recoverable while in this state. When eradicated, the snapshot is completely removed from the array and the snapshot can no longer be recovered. Depending on the type of snapshot that is being removed, the cmdlets used share the common parameters needed to remove the snapshots.
To perform this two-step process, a snapshot must be Updated to set the "Destroyed" property to
$true by using the
Update-* cmdlets, and then eradicated with the
Remove-* cmdlets as shown in the examples below.
A snapshot must be destroyed before it can be eradicated.
Volume Snapshots
To Destroy a snapshot, use the
Update-Pfa2VolumeSnapshot cmdlet. The
-Id and
-Name parameters must be specified.
PS >Update-Pfa2VolumeSnapshot -Array $FlashArray -Id <ID_of_snapshot> -Name <Name_of_snapshot>
To make it easier to obtain the snapshot information, you can also use it with the
Get-Pfa2VolumeSnapshot cmdlet and pipeline the results to the
Update-Pfa2VolumeSnapshot cmdlet. You can also perform the action against multiple snapshots in a single command.
# For a single snapshot named DEMO-VOL1.TEST
PS >Get-Pfa2VolumeSnapshot -Array $FlashArray -Name 'DEMO-VOL1.TEST' | Update-Pfa2VolumeSnapshot
# For multiple snapshots that have similiar names
PS >Get-Pfa2VolumeSnapshot -Array $FlashArray | Where-Object { $_.name -like 'DEMO*' } | Update-Pfa2VolumeSnapshot
To revert a snapshot that has been set as "Destroyed", change the
-Destroyed parameter to
$false.
To Eradicate the snapshot, add the
-Eradicate and optional
-Confirm parameter.
# For a single snapshot amed DEMO-VOL1.TEST
PS >Get-Pfa2VolumeSnapshot -Array $FlashArray -Name 'DEMO-VOL1.TEST' | Remove-Pfa2VolumeSnapshot -Eradicate -Confirm
# For multiple snapshots that have similiar names
PS >Get-Pfa2VolumeSnapshot -Array $FlashArray | Where-Object { $_.name -like 'DEMO*' } | Remove-Pfa2VolumeSnapshot -Eradicate -Confirm
Protection Group Snapshots
To Destroy a Protection Group snapshot using a cmdlet pipeline, the
Update-Pfa2ProtectionGroupSnapshot cmdlet is added to the
Get-Pfa2ProtectionGroupSnapshot cmdlet with the
-Destroyed parameter to set the "Destroyed" property to
$true.
PS >Get-Pfa2ProtectionGroupSnapshot -Array $FlashArray -Name 'DEMO-PGGROUP.TEST' | Update-Pfa2ProtectiongroupSnapshot -Destroyed $true
Name : demo-pggroup.TEST
Created : 8/1/2020 3:13:39 PM
Destroyed : True
Pod : class FixedReference {
Id:
Name:
}
Source : class FixedReference {
Id:
Name: demo-pggroup
}
Space :
Suffix : TEST
TimeRemaining : 86399000
To revert a snapshot that has been set as "Destroyed", change the
-Destroyed parameter to
$false.
To Eradicate the snapshot, use the
Remove-Pfa2ProtectionGroupSnapshot cmdlet.
PS >Get-Pfa2ProtectionGroupSnapshot -Array $FlashArray -Name 'DEMO-PGGROUP.TEST' | Remove-Pfa2ProtectionGroupSnapshot