Remove-NimSnapshot

The Remove-NimSnapshot cmdlet deletes snapshots of volumes, SQL databases, and snapshot collections of volume collections. It does not return any values.

Refer to General Best Practices for Using Cmdlets for general tips for working with cmdlets and their options.

The Remove-NimSnapshot cmdlet has the following limitations:
  • The cmdlet can work only with volumes that belong to the same group.
  • Your credentials must allow you to access the groups affected by the cmdlet. Use the Set-Configuration cmdlet to configure your credentials.

If you experience a problem using the Remove-NimSnapshot cmdlet, check the information in Troubleshooting Cmdlet Issues.

Options

The Remove-NimSnapshot cmdlet supports several command line options.

-HPEVolumeName <String[]> option. The name of the volume on the group where you want to delete the snapshot. Always use this option with the SnapshotName option.

-SnapshotName <String[]> option. The name of the snapshot that will be deleted. Always use this option with the HPEVolumeName option.

-GroupMgmtIP <IPAddress> option. The IP address for the management group. It is set by running Set-Configuration. Only the Windows user who ran Set-Configuration can use the information. Always use this option when you use any of the following options: -HPESnapshot, HPESnapshotCollection, or DatabaseSnapshot.

-PoolName <String> option. The name of the pool where the volumes reside. If this parameter is not specified and there are multiple volumes with same name within the group, the cmdlet fails.

-Force [<SwitchParameter>] option. Force suppresses the confirmation warning and deletes the snapshot or snapshot collection.

-InformationAction <ActionPreference> option. This is a default PowerShell option and has no effect on the cmdlet execution.

-InformationVariable <String> option. This is a default PowerShell option and has no effect on the cmdlet execution.

-WhatIf [<SwitchParameter>] option. This option validates the parameter, but does not modify data. When used with the -Verbose option, it displays messages on the console.

-Confirm [<SwitchParameter>] option. This option is used to ensure that a confirmation message is displayed. It has no effect on the cmdlet execution.

-HPEVolumeAccessPath <String[]> option. The name of the Windows mount point on the volume that is exposed to the host.

-SnapshotCollectionName <String> option. The name of the snapshot collection that you want to delete. Always use this option with the VolumeCollectionName option.

-VolumeCollectionName <String> option. The name of the volume collection that you want to delete. Always use this option with the SnapshotCollectionName option.

-SnapshotCollection <HPESnapshotCollection> option. This is a pipeline option that deletes the SnapshotCollection objects that are returned by the Get-NimSnapshotCollection> cmdlet.

-Snapshot <HPESnapshot[]> option. This is a pipeline option that deletes the Snapshot objects that are returned by the Get-NimSnapshot> cmdlet.

-DatabaseSnapshot <NimDatabaseSnapshot[]> option. This is a pipeline option that deletes the DatabaseSnapshot objects that are returned by the Get-NimDatabaseSnapshot> cmdlet.

<CommonParameters>. This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

Syntax variants

The command line options you use with the Remove-NimSnapshot cmdlet vary depending on the type of object you want to remove.

NOTE: For more details about working with the cmdlet, view the cmdlet help by entering Get-Help <cmdlet_name>.

This cmdlet has the following basic formats:

Remove-NimSnapshot -HPEVolumeName <String[]> -SnapshotName <String[]> [-GroupMgmtIP <IPAddress>] [-PoolName <String>] [-Force <SwitchParameter>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-WhatIf <SwitchParameter>] [-Confirm <SwitchParameter>] [<CommonParameters>]

Remove-NimSnapshot -HPEVolumeAccessPath <String[]> -SnapshotName <String[]> [-GroupMgmtIP <IPAddress>] [-Force <SwitchParameter>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-WhatIf <SwitchParameter>] [-Confirm <SwitchParameter>] [<CommonParameters>]

Remove-NimSnapshot -SnapshotCollectionName <String> -VolumeCollectionName <String> [-GroupMgmtIP <IPAddress>] [-Force <SwitchParameter>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-WhatIf <SwitchParameter>] [-Confirm <SwitchParameter>] [<CommonParameters>]

Remove-NimSnapshot -SnapshotCollection <HPESnapshotCollection> [-Force <SwitchParameter>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-WhatIf <SwitchParameter>] [-Confirm <SwitchParameter>] [<CommonParameters>]

Remove-NimSnapshot -Snapshot <HPESnapshot[]> [-Force <SwitchParameter>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-WhatIf <SwitchParameter>] [-Confirm <SwitchParameter>] [<CommonParameters>]

Remove-NimSnapshot -DatabaseSnapshot <NimDatabaseSnapshot[]> [-Force <SwitchParameter>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-WhatIf <SwitchParameter>] [-Confirm <SwitchParameter>] [<CommonParameters>]

Single volume snapshot deletion using a volume name example:

Remove-NimSnapshot -GroupMgmtIP 10.00.000.00 -HPEVolumeName test-2 -SnapshotName 1562747984

Delete snapshot on multiple volumes:

Remove-NimSnapshot -GroupMgmtIP 10.00.000.00 -HPEVolumeName test-1, test-2 -SnapshotName 1562747988, 1562747988

Multiple volume snapshot deletion example:

Remove-NimSnapshot -GroupMgmtIP 10.00.000.00 -HPEVolumeName test-1, test-2 -SnapshotName 1562747988, 1562747988

Snapshot deletion using a volume drive letter example:

Remove-NimSnapshot -GroupMgmtIP 10.00.000.00 -HPEVolumeAccessPath h:\ -SnapshotName 1562747994

Snapshot deletion using multiple volume mount paths example:

Remove-NimSnapshot -GroupMgmtIP 10.00.000.00 -HPEVolumeAccessPath C:\temp\mountpoint\test1 C:\temp\mountpoint\test11 -SnapshotName 1562747998, 1562747998

Snapshot deletion by passing a single volume object on a pipeline example:

Get-NimVolume | Remove-NimSnapshot -GroupMgmtIP 10.00.000.00 -PoolName default -SnapshotName 1562748010

Snapshot deletion by passing multiple snapshot objects ona pipeline example:

Get-NimSnapshot -HPEVolumeName test1 -MaxObjects 2 | Remove-NimSnapshot

Snapshot collection deletion using a single volume collection name example:

Remove-NimSnapshot -VolumeCollectionName test-snap -SnapshotCollectionName 1562750331 -GroupMgmtIP 10.00.000.00

Single database snapshot deletion by passing a database snapshot name using a pipeline example:

Get-NimDatabaseSnapshot -DBName db2 | Remove-NimSnapshot