Microsoft Virtualization Discussions

How to search snapshots from list of filers :S

RITESHPARAB

Hi PowerUsers,

Aim : To find Volumes (from list of filers) where more then hourly.30 snap exists.

I have found a script in NA communities, which I modified as per my requirement, but I stuck in middle of d script.

The script works perfectly, only thing is pending is how I can exclude some volumes from some filers. 

e.g. : If I have 2 filers where each one have 8 vol. but I want to exclude vol3 and vol4 from 2nd filer.

Attached : Script[draft], Result

Please help.

1 ACCEPTED SOLUTION

vinith

Hi Ritesh,

You need to use powershell filtering to exclude these volumes, please find attached the modified script and let me know how it goes.

Here are the modifications which i made in the script.

Based on your scenario i have appended another controller "192.168.1.23" which is the one from which you need to exclude vol3 and vol4

$NetappList=("192.168.1.22","192.168.1.23")

Next im checking for the IP address present in $global:CurrentNaController, if it matches 192.168.1.23 then $filteredvolumes variable would consist of all volumes from get-navol except vol3,vol4 (which you can modify with your volume names)

else if the IP Adress does not match the criteria it goes about doing the normal get-navol query.

if (($global:CurrentNaController | select -ExpandProperty address).ipaddresstostring -match "192.168.1.23")

{

$filteredvolumes = get-navol | ?{$_.name -notmatch "vol3" -and $_.name -notmatch "vol4"}

}

else

{

$filteredvolumes = get-navol

}

            $filteredvolumes | foreach-object {

                  $ParentName=$_.Name

.......

Continued

Do let me know if it works out and solves your need

View solution in original post

3 REPLIES 3

vinith

Hi Ritesh,

You need to use powershell filtering to exclude these volumes, please find attached the modified script and let me know how it goes.

Here are the modifications which i made in the script.

Based on your scenario i have appended another controller "192.168.1.23" which is the one from which you need to exclude vol3 and vol4

$NetappList=("192.168.1.22","192.168.1.23")

Next im checking for the IP address present in $global:CurrentNaController, if it matches 192.168.1.23 then $filteredvolumes variable would consist of all volumes from get-navol except vol3,vol4 (which you can modify with your volume names)

else if the IP Adress does not match the criteria it goes about doing the normal get-navol query.

if (($global:CurrentNaController | select -ExpandProperty address).ipaddresstostring -match "192.168.1.23")

{

$filteredvolumes = get-navol | ?{$_.name -notmatch "vol3" -and $_.name -notmatch "vol4"}

}

else

{

$filteredvolumes = get-navol

}

            $filteredvolumes | foreach-object {

                  $ParentName=$_.Name

.......

Continued

Do let me know if it works out and solves your need

View solution in original post

RITESHPARAB

Hi Vinit,

I have checked your script and it's worked fine, it's solved my problem.

however, I have also found one more way to accomplish my task using CSV(att.) 

Thanks for your time and help 

vinith

Thats great awesome!!.

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public