NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

Microsoft Virtualization Discussions

Can't set a snapshot policy to a volume

AllenChang
1,698 Views

I create a snapshot policy name mypolicy1

 

PS C:\File> Get-NcSnapshotPolicymypolicy1

Policy Enabled SnapshotPolicySchedules
------ ------- -----------------------
mypolicy1True {1min (5)}

 

and I have volume name vol1

PS C:\File> get-ncvol -Vserver svm1 -name vol1

Name State TotalSize Used Available Dedupe Aggregate Vserver
---- ----- --------- ---- --------- ------ --------- -------
vol1 online 1.0 GB 972.3 MB aggr1 svm1

 

the vol1's snapshot policy is default now

PS C:\File> (Get-Ncvol -Vserver svm1 -Name vol1).SnapshotPolicy

Name Uuid
---- ----
default ba1e9fa1-e597-11ed-bc7b-00a098e1d252

 

 

when I want to change the vol1's snapshot policy to mypolicy1

I use the powershell command

 

PS C:\File> Get-Ncvol -Vserver svm1 -Name vol1 |Set-NcSnapshotPolicy -Name mypolicy1

Policy Enabled SnapshotPolicySchedules
------ ------- -----------------------
mypolicy1 True {1min (5)}

 

but it still use the default snapshot policy

PS C:\File> (Get-Ncvol -Vserver svm1 -Name vol1).SnapshotPolicy

Name Uuid
---- ----
default ba1e9fa1-e597-11ed-bc7b-00a098e1d252

 

AllenChang_0-1683462968445.png

I try to change the snapshot policy in GUI,

and it's work

Can anyone help me,

how to change snapshot policy by powershell?

1 REPLY 1

Ashun
787 Views

hi

You can do this with a simple Invoke-Ncssh

 

Public