Microsoft Virtualization Discussions

FSID via PS-Toolkit?


Hi all,

is there a way to get FSID values for aggregates and volumes via API / PS-Toolkit?

During some 7-mode controller migrations I need to get / set fsid's for a hughe number of objects. Since the data is not found in ASUP contents, is it possible via Powershell?

Thanks for any hints,




you can use Invoke-NaSsh to pull it for each volume. i happened to be working on a function with a similar structure so i just changed the lines to pull the volume FSIDs and it worked against the 8.1.3 controller i tested it against.

YMMV - this structure makes several assumptions like RPC access from the account your are running the function under and that you have keyless SSH setup - plus a complete lack of error handling but it is a starting point.

save as Get-NaVolFSID.ps1, edit $keyfile and dot source it (. .\Get-NaVolFSID.ps1) then you can run $FSID = Get-NaVolFSID <controller> or pipe a list of controllers to it like: $FSID = gc .\filerlist.txt | Get-NaVolFSID

Function Get-NaVolFSID{









        [String]$keyfile = "<filename>.ppk"



        $Results = @()



        foreach($C in $Controller){

            connect-nacontroller $C > $null

            $vols = get-navol

            foreach ($vol in $vols){

                $result = (Invoke-NaSsh -name root@$C -command "priv set advanced;vol read_fsid $vol" -PrivateKeyFile $keyfile -WarningAction SilentlyContinue) -split '\s+'

                $FSID = $result[($result.count - 2)].replace('.','')


                        'Controller' = $C

                        'Volume' = $

                        'FSID' = $FSID


                $Obj=New-Object -TypeName PSObject -Property $Prop

                $Results += $Obj





        #globally add aliasproperty

        $results | add-member -MemberType AliasProperty -name VolumeName -value Volume

        $results | add-member -MemberType AliasProperty -name Filer -value Controller

        $results | add-member -MemberType AliasProperty -name Node -value Controller

        Write-Output $Results




Thanks, this helps a lot to read out the data. And I think invoke-nassh should also do make it possible to "rewrite" FSID's.

But can an aggregate's FSID be changed while volumes are living on that aggr? Does it need to be offline to change it?

The idea is to get an exact 1:1 copy of and "old" filer aggregate / volume structure to a "new" filer using snapmirror - keeping all FSID's so that OnCommand UM is happy afterwards (does not notice the change) and all datasets/relationships stay intact after a filer migration...


unfortunately, this isn't something i have any experience doing.

given that you are doing a migration, i would probably attack the problem from the other end and script the changes in OnCommand instead of changing the aggregrates/volumes - but i don't use OnCommand for managing Snapmirror/Snapvault relationships, so that is a naive statement on my part.


mark -

Just some things i noticed.  Please take this as constructive critisicm. In powershell, we shouldn't use > $Null.  The proper way to do this is | Out-null

Also, you can do this $connection = connect-nacntroller $c

Also, i see you are connecting RPC.  You are better to connect via https or run invoke-nassh natively.


Hi Josh - I'm happy to have any feedback!

Why do you say out-null is the proper way? There are many ways to do almost anything in powershell, so what makes out-null better?

I prefer RPC over https because in my testing (and maybe it is just my environment) it is many times faster than https. It also allows me to schedule my scripts using our scripting account and not have to deal with the credential cache.

As for the script above, it is using RPC to get the volume list but invoke-nassh is run using -privatekeyfile since invoke-nassh doesn't support RPC.

thanks again for the feedback



Hi Mark,

The FSID value is returned in Get-NaAggr:

PS C:\> Get-NaAggr | select Name, FSID

Name                                                                                                               Fsid

----                                                                                                               ----

aggr0                                                                                                        2071468128

aggr1                                                                                                        1845942832


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.