OpenStack Discussions

Netapp powershell | Restore file using snapshot


Hello Team,


I have Netapp powershell tool kit and trying to automate file restore operation using snapshot. I have found below 





However, I am not bale to successfully restore the file.  For example :


PS C:> Restore-NcSnapshotFile

cmdlet Restore-NcSnapshotFile at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
Path: /volume/text.txt
SnapName: weekly.2020-06-21_0015

Restore file from snapshot
Are you sure you want to restore file /volume/test.txt from snapshot weekly.2020-06-21_0015?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y
Restore-NcSnapshotFile : Failed to restore file from Snapshot copy weekly.2020-06-21_0015 for volume
"volc1svm1_root" on Vserver "vserverc1svm1". Reason: Inappropriate file type or format.
At line:1 char:1
+ Restore-NcSnapshotFile
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ( [Restore-NcSnapshotFile], EONTAPI_
+ FullyQualifiedErrorId : ApiException,DataONTAP.C.PowerShell.SDK.Cmdlets.Snapshot.RestoreNcSnapshotFile


Re: Netapp powershell | Restore file using snapshot


If you've already connected to the vserver using connect-nccontroller, try using the restore-ncsnapshotfile command like this:


restore-ncsnapshotfile /vol/{volume_name}/test.txt weekly.2020-06-21_0015


let me know if it works out.



View solution in original post

Earn Rewards for Your Review!
GPI Review Banner
All Community Forums