|
|
Data ONTAP® PowerShell Toolkit
|
Cmdlet: Restore-NcSnapshotFile
NAME
Restore-NcSnapshotFile
SYNOPSIS
Reverts a single file to a revision from a specified snapshot.
SYNTAX
Restore-NcSnapshotFile [-Path] <String> [-SnapName] <String> [[-RestorePath]
<String>] [-Uuid <String>] [-Volume <String>] [-SpaceEfficientSplitDisabled
] [-VserverContext <String>] [-Controller <NcController[]>] [-WhatIf] [-Conf
irm] [<CommonParameters>]
DESCRIPTION
Reverts a single file to a revision from a specified snapshot. The volume u
sed for restoring the file must be online and must not be a mirror. Files o
ther than normal files and LUNs are not restored. This includes directories
(and their contents), and files with NT streams. Compressed files will not
be restored, though compression may be enabled on the volume.
If there is not enough space in the volume, the single file snap restore wil
l not start. If the file already exists (in the active filesystem), it will
be overwritten with the version in the snapshot. It could take up to sever
al minutes for before the API invocation returns. During this time client e
xclusive oplocks are revoked and hard exclusive locks like the DOS compatibi
lity lock are invalidated. Once the invocation returns, the file restore wi
ll proceed in the background.
For normal files while the restore is proceeding, any operation which tries
to change the file will be suspended until the restore is done. The restore
may take a long time to complete depending on the size of the file being re
stored. The file is unavailable for use during this time.
For LUNs that are restored over top of their existing LUN, a LUN clone can b
e created that is backed by the snapshot being restored from and then the cl
one is split. Snapshots are disabled during restore due to space efficient
LUN clone split. In order to disable space efficient split during restore se
t the optional parameter space-efficient-split-disabled. While the restore
is proceeding the LUN is available and I/O (both reads and writes) is permit
ted. Data that is modified in the LUN while the restore is proceeding will
not be overwritten by the restore process. The restore may take a long time
to complete depending on the size of the LUN being restored.
Other single file snap restores can be executed concurrently. Also it is po
ssible for the single file snap restore to be aborted if we run out of disk
space during the operation. When this happens the timestamp of the file bei
ng restored will be updated. Thus it will not be the same as the timestamp
of the file in the snapshot.
For normal files, an in-progress restore can be aborted by removing the file
. For NFS users, the last link to the file must be removed.
For all restored files, the snapshot used for the restore cannot be deleted.
New snapshots cannot be created while a single-file snaprestore is in prog
ress. Scheduled snapshots on the volume will be suspended for the duration o
f the restore. Tree, user and group quota limits are not enforced for the o
wner, group and tree in which the file is being restored. Thus if the user,
group or tree quotas are exceeded, /etc/quotas will need to be altered afte
r the single file snap restore operation has completed. Then quota resize w
ill need to be run. When the restore completes, the file's attributes (size
, permissions, ownership, etc.) should be identical as those in the snapshot
.
If the system is halted or crashes while a single file snap restore is in pr
ogress then the operation will be restarted on reboot. A volume cannot have
both a volume snaprestore and a single-file snaprestore executing simultane
ously. Multiple single-file snaprestores can be in progress simultaneously.
PARAMETERS
-Path <String>
Path of the file to restore. Path syntax has two forms: /vol/<volumenam
e>/<rest of path> -or- /<rest of path>. In the latter case (relative pa
th), if volume was not specified, the root volume will be used.
Required? true
Position? 1
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-SnapName <String>
Name of snapshot to restore from. Snapshot must be from same volume as
the file to restore.
Required? true
Position? 2
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-RestorePath <String>
Path to restore to. The path must be a full path to a filename, and mus
t be in the same volume as the volume used for the restore. If not spec
ified, RestorePath is defaulted to the original path.
Required? false
Position? 3
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-Uuid <String>
The 128 bit unique snapshot identifier expressed in the form of UUID. T
his field is optional and can uniquely identify a snapshot to restore.
An example of an actual UUID is: 84a010ec-3d28-11df-84e8-123478653412
Required? false
Position? named
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-Volume <String>
Volume to restore to/from. If this is specified, the path argument shou
ld be relative to the volume.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-SpaceEfficientSplitDisabled
By default, space-efficient LUN clone split is allowed during restore.
This parameter, if specified, disables space-efficient splitting for thi
s specific operation.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-VserverContext <String>
Vserver to which to direct this command. If the currently connected con
troller (as embodied by an NcController object) represents a cluster, th
ere are multiple means to address commands to one of its vservers. Eith
er set the Vserver field on the NcController object to direct all subseq
uent commands to that vserver, or supply the VserverContext parameter to
an individual cmdlet. Only cmdlets which may be invoked on vservers of
fer the VserverContext parameter.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Controller <NcController[]>
A clustered Data ONTAP controller to receive this cmdlet, as embodied by
an NcController object. This parameter is returned by the Connect-NcCo
ntroller cmdlet. If not specified, the value in the global variable Cur
rentNcController is used. In the latter case, if CurrentNcController co
ntains a collection of NcController objects, this cmdlet is invoked on e
ach controller in succession.
Required? false
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-WhatIf
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Confirm
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".
INPUTS
OUTPUTS
NOTES
Category: snapshot
API: snapshot-restore-file
Family: vserver
-------------- Example 1 --------------
C:\PS>Restore-NcSnapshotFile /vol/vol1/testfile.txt snap1
Restore a single file from snapshot 'snap1'
RELATED LINKS
Restore-NcSnapshotVolume
| Copyright © 2012 NetApp. All rights reserved. Use is subject to license terms. |
|
Data ONTAP® PowerShell Toolkit
|