Active IQ Unified Manager Discussions
Active IQ Unified Manager Discussions
I was looking for command to disable snapshot on a volume but not able to find an option in netapp PS toolkit.
is there a command or options in cmdlet i can set to disable the snapshots on a particular vol?
Solved! See The Solution
Hello @CAPATEL_NET1984,
There are two ways you can disable snapshots:
To change the policy, you can use this PowerShell:
Update-NcVol -Query @{ Name = $volName } -Attributes @{ VolumeSnapshotAttributes = @{ SnapshotPolicy = "none" } }
To disable the volume option:
Get-NcVol $volName | Set-NcVolOption -Key nosnap -Value on
You can read more about PSTK + snapshots here and volumes here.
Hope that helps!
Andrew
Hello @CAPATEL_NET1984,
There are two ways you can disable snapshots:
To change the policy, you can use this PowerShell:
Update-NcVol -Query @{ Name = $volName } -Attributes @{ VolumeSnapshotAttributes = @{ SnapshotPolicy = "none" } }
To disable the volume option:
Get-NcVol $volName | Set-NcVolOption -Key nosnap -Value on
You can read more about PSTK + snapshots here and volumes here.
Hope that helps!
Andrew
Tried in WFA
erro is below
09:58:18.167 ERROR [LM Disable snapshot for backup volume] Failed executing command. Exception: Modification of the following fields: auto-snapshots-enabled not allowed for volumes of the type "Flexible Volume - Read-Write volume".
param (
[parameter(Mandatory=$true, HelpMessage="Cluster IP address")]
[string]$Cluster,
[parameter(Mandatory=$true, HelpMessage="Volume name")]
[string]$VolumeName,
[parameter(Mandatory=$true, HelpMessage="Storage Virtual Machine name")]
[string]$VserverName
)
# connect to controller
Connect-WfaCluster $Cluster
#testing volume existence. this command somehow doesn't throw exception if
# ErrorAction is 'Stop' and the volume isn't found. adding if block
$vol = Get-NcVol -Name $VolumeName -Vserver $VserverName
if(!$vol)
{
throw "Volume '$VolumeName' not found on Storage Virtual Machine '$VserverName'"
}
Get-WFALogger -Info -message $("Modifying volume: " + $VolumeName + " on Storage Virtual Machine " + $VserverName)
$status = Get-NcVol $VolumeName | Set-NcVolOption -Key nosnap -Value on
#$status = Update-NcVol -Query $queryTemplate -Attributes $attributeTemplate -FlexGroupVolume
if($status.FailureCount -eq 1)
{
throw $status.FailureList[0].ErrorMessage
}
taht query of setting it to none worked, but when i chnage the snapshot policy directly to none in create volume command's inputs in wfa it does not work
so I can use another powershell command to set none as SS policy on a volume but i can not use the wfa create volume certified command's in put name snapshot policy and can not set as nonw
also I ahve differnt code version in lab and prod and i noticed that on older code version 9.1p1 i need to do below, added -FlexGroupVolume:$false and it worekd fine
i did not added this on 9.2 version and it still worked
Update-NcVol -Query @{ Name = $VolumeName } -Attributes @{ VolumeSnapshotAttributes = @{ SnapshotPolicy = "none" } } -FlexGroupVolume:$false
Take a look at get-ncvol and update-ncvol. I think the volume attribute you want to update is .NoSnap. This could also be the option to enable user access to teh snapshot directory, so you will want to test this. Look at the Example at the end of
get-Help Update-NcVol -full for an example of how to do this.