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,


Re: FSID via PS-Toolkit?

Hi Mark,

The FSID value is returned in Get-NaAggr:

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

Name                                                                                                               Fsid

----                                                                                                               ----

aggr0                                                                                                        2071468128

aggr1                                                                                                        1845942832


Re: FSID via PS-Toolkit?

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



Re: FSID via PS-Toolkit?

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.

Re: FSID via PS-Toolkit?

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


Re: FSID via PS-Toolkit?

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...

Re: FSID via PS-Toolkit?

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.