I am writing a "decommission" workflow i.e. to remove volumes.
One of the requirements is to ensure that the volume only contains a single qtree and that there is no non-qtree data.
I've tried a couple of ways to do this but with no success for various reasons...
Firstly I tried using PowerShell by calling the Invoke-NaSSh cmdlet to perform an "ls" of the volume. I tried passing "priv set advanced;ls /vol/vol0" as parameters. This works if it is run on the command line as a standard powershell script but it fails when ran within WFA. For some reason the ls command produces no output - no error messages logged just no output.
I then moved on to try Perl using the "file-list-directory-iter-*" ZAPI calls. I successfully scripted this from the command line but again struggled to get this to execute from within WFA. This time I unserstand the reason though. ZAPI requires a user name and password to be passed to it. It uses "getCredentials()" within WFAUtil.pm to pass the credentials that are stored in WFA when establishing the connection to the filer. The problem is that we are not using the WFA credential cache, we are running the WFA service using a Windows Domain account which is in the administrators group on the filers. There are over 800 filers in the estate which is the reason why we are running in this mode. If I populate the WFA credentials cache the workflow succeeds, but this isnt really a scalable option....
If anyone has any suggestions as to how I meet this requirement, or if they know why the PowerShell cmdlet might be failing I would really appreciate it:-)
You are correct, ls has been built in for several years.
The problem is I need to call it from WFA so PowerShell is the best bet. But for some reason the Invoke-NaSsh powershell cmdlet called from WFA (whilst in priv set advanced mode) returns nothing. All other non-priveleged commands run fine,
I wasnt aware of the hidden java shell. I tried calling this from PoSH as below but no luck: