Microsoft Virtualization Discussions

How to create a Snapshot Policy

AllenChang
1,888 Views

I use new-ncsnapshopolicy command to create a snapshot policy,

it appear a error,and told me need svm parameter

 

PS C:\File> New-NcSnapshotPolicy -Name mysspolicy1 -Schedule sm1min -Count 60 -SnapmirrorLabel 1min
New-NcSnapshotPolicy : Svm parameter neither specified nor set
位於 線路:1 字元:1
+ New-NcSnapshotPolicy -Name mysspolicy1 -Schedule sm1min -Count 60 -Sn ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-NcSnapshotPolicy], ArgumentException
+ FullyQualifiedErrorId : Svm is empty,DataONTAP.C.PowerShell.SDK.Cmdlets.Snapshot.NewNcSnapshotPolicy

 

But when I add -Svm parameter,
It still error

 

PS C:\File> New-NcSnapshotPolicy -Name mysspolicy1 -Schedule sm1min -Count 60 -SnapmirrorLabel 1min -Svm svm1
New-NcSnapshotPolicy : 無法繫結 'Svm' 參數。無法將類型 "System.String" 的 "svm1" 值轉換為類型 "DataONTAP.C.Types.Snapshot.Svm"。
位於 線路:1 字元:94
+ ... ysspolicy1 -Schedule sm1min -Count 60 -SnapmirrorLabel 1min -Svm svm1
+ ~~~~
+ CategoryInfo : InvalidArgument: (:) [New-NcSnapshotPolicy],ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,DataONTAP.C.PowerShell.SDK.Cmdlets.Snapshot.NewNcSnapshotPolicy

 

How can I fix this problem ?

Can anyone help me?

 

 

 

4 REPLIES 4

Ontapforrum
1,849 Views

I haven't used these 'new-nc*' commands, so don't knw how it works.  Can you check - Which context are you connected to : Cluster?

 

Try connecting to SVM context and then run those commands.

PS C:\> Connect-NcController -Name <SVM_Mgmt_IP>

 

Note: make sure 'vsadmin' account is unlocked for the given SVM.

AllenChang
1,840 Views

Hi Ontapforrum

I connect to Cluster

Ontapforrum
1,835 Views

ok. 

 

Try connecting to SVM context and then run those commands.

PS C:\> Connect-NcController -Name <SVM_Mgmt_IP>

 

Let us know if it works, or  you get different error?

AllenChang
1,813 Views

Hi Ontapforrum

I try to use your way to login the svm first,

but it still ask me provide -svm parameter

PS C:\File> Connect-NcController 192.168.0.86

Name                 Address           Vserver              Version
----                 -------           -------              -------
192.168.0.86         192.168.0.86      svm1                 Data ONTAP Release 9.11.1P1: Tue Aug 09 13:13:19 UTC 2022


PS C:\File> New-NcSnapshotPolicy -Name mysspolicy1 -Schedule sm1min -Count 60 -SnapmirrorLabel 1min
New-NcSnapshotPolicy : Svm parameter neither specified nor set
位於 線路:1 字元:1
+ New-NcSnapshotPolicy -Name mysspolicy1 -Schedule sm1min -Count 60 -Sn ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-NcSnapshotPolicy], ArgumentException
    + FullyQualifiedErrorId : Svm is empty,DataONTAP.C.PowerShell.SDK.Cmdlets.Snapshot.NewNcSnapshotPolicy

Public