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.

Active IQ Unified Manager Discussions

how can we change snapshot policy on an existing volume

stephen2
4,825 Views

Anyone know how to do this? I don't see a -snapshotpolicy field in update-ncvol

I tried using a template, but the object returned does not have an volumesnapshotattributes object.

I also tried $cmd2 = "volume modify -vserver $svm -volume $volname -snapshot-policy none -confirm $false"
 invoke-ncssh $cmd2

 

I need to change snapshot policies on a volume, but I can't figure this one out

2 REPLIES 2

Mr_Flibble
4,790 Views

Hello Stephen,

 

I'm pretty sure I saw something written by Steven Beam somewhere which I used, but can't remember where.

Anyway, this is an extract of one of my WFA commands which should indicate how it works:

 

$VOLquery = Get-NcVol -Template
Initialize-NcObjectProperty -Object $VOLquery -Name VolumeIdAttributes

$VOLquery.VolumeIdAttributes.OwningVserverName = $VserverName

 

$VOLattrs = Get-NcVol -Template
Initialize-NcObjectProperty -Object $VOLattrs -Name VolumeSnapshotAttributes

 

$VOLquery.VolumeIdAttributes.Name = $VolName
$VOLattrs.VolumeSnapshotAttributes.SnapshotPolicy = $SnapshotPolicy


Update-NcVol -Query $VOLquery -Attributes $VOLattrs

 

Hope it helps.

 

Cheers!

stephen2
4,770 Views

Thanks - just what I needed

Public