From the CLI 'console' I can log onto the physical filer and use
vfiler context vfiler_name
to change the console so that commands run directly against the vfiler as required. In powershell I am able to use the command
connect-nacontroller 'pfiler_name' -vfiler 'vfiler_name' -Cred
to achieve the same thing. However the context is not the same in powershell. For example if I use the Invoke-NaSsh command and access the filer help menu, I get the full filer listing. Rather than the reduced version typical of a vfiler. The issue I would like to solve is being able to connect pfiler and run an ndmpcopy from within the vfiler, back to another system.
vfiler run vfiler_name ndmpcopy -sa user1:password –da user2:password IP:/vol/vvol1/qtree2/.snapshot/backup2 IP2:/vol/restore
is very useful because it means I can restore files to systems which my administration does not have direct IP access to. When I try a simular command in powershell it fails, because the powershell host does not have IP access to the vfiler.
PS C:\Users\Administrator> Invoke-NaNdmpCopy IP /vol/vvol1/qtree2/.snapshot/backup2 IP2/vol/restore -SrcCredential ncopy -SrcAuthType md5 -DstCredential ncopy -DstAuthType md5
Invoke-NaNdmpCopy : A socket operation was attempted to an unreachable host 10.101.102.60:10000
At line:1 char:1
+ Invoke-NaNdmpCopy 10.101.102.60 /vol/vvol1/qtree2/.snapshot/backup2 10.101.102.9 ...
+ CategoryInfo : InvalidOperation: (:) [Invoke-NaNdmpCopy], SocketException
+ FullyQualifiedErrorId : Ndmp connection error,DataONTAP.PowerShell.SDK.Cmdlets.Ndmp.InvokeNaNdmpCopy
I have shown that ping-nahost is operating from the vfiler context as required. ie It can ping it's self and the remote restore target but not the powershell admin station. Also the issue is solved if the powershell console has IP access to both vfiler0 (pfiler) and the vfiler but this breaks the network security model. It also renders using the vfiler context pointless, as I might as well run the command directly against the vfiler.
Can anyone help me out please? I already have Invoke-NaSsh vfiler run vfiler_name ndmpcopy... on standby but my solution will be much improved, if I could base it on the start-NaNdmpCopy cmdlet.