Ok, back at a real computer...
There's a few things that we want to accomodate when checking for volumes which do not have snapshot protection:
- Not a root volume...this is probably what was causing the errors to show up before
- Not a data protection volume, which will exclude SnapMirror and SnapVault volumes
- "nosnap" enabled, indicating snapshot policy has been disabled
- or a Snap Policy of "none", indicating snaps are enabled, but no schedule is set
With all that in mind, we can use PowerShell to check for these things, filtering the things we want and don't want:
Get-NcVol | ?{
# get non-root volumes
$_.VolumeStateAttributes.IsNodeRoot -eq $false `
-and
# which are rw (this will exclude SnapMirror, etc.)
$_.VolumeIdAttributes.Type -eq "rw" `
-and
(
# with "nosnap" turned on
(($_ | Get-NcVolOption -Hashtable).value.nosnap -eq "on") `
-or
# or with snapshot policy set to none
($_.VolumeSnapshotAttributes.SnapshotPolicy -eq "none")
)
}
Hope that helps.
Andrew
If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.