Invoke-NcSSH in WFA

I am trying to build an ndmpcopy based restore job in WFA due to functionality issues within OCUM.  The job works without issue, however as I have to call Invoke-NcSSH the command waits for the restore to finish.  Without the command going into a success status and moving on, the monitoring command I have put together is not called until after the restore command completes.


Does anyone know of a way to have WFA accept that a command has been run, ignore output and drop out to move to the next command?

Re: Invoke-NcSSH in WFA



For your query, I think below logic would help:


Due to WFA limitation, without completion of first command, second command cannot be executed in the workflow.

If you want to achieve, you must split present workflow into 2 workflows.



Make “Restore command” into first workflow.

And Make “monitor command” into second workflow.


Monitor command should include code for execute first workflow using WFA REST API as well as monitor code details.

When you execute the workflow from command that workflow will be running in background. (i.e. “Restore command” will be running in background)

So, monitor code will continue to “Restore command” progress.


I hope this answers your question.

Re: Invoke-NcSSH in WFA

Thank you for the reply, but that isn't the issue.  An ndmpcpoy invoke by nature of the command is a verbose out, there is no background or quiet option available. 


This means when I use "Invoke-NcSSH ndmpcopy -sa -da path path", the command doesn't show completion until the entire restore completes or fails.  This would be the same if it were run on the CLI, what I need is a way to Invoke-NcSSH in non-interactive mode so that I can allow the command to timeout but continue running.  I actually somehow had this work one time and then after a log out and back in the job didn't work the same way...I cannot figure out how to replicate what happened in that single run.


I think this is likely an issue with the ndmp command and Invoke-NcSSH cmdlet as in 7mode we had start-nandmpcopy which would return as soon as the command was submitted.

Re: Invoke-NcSSH in WFA

[ Edited ]

removing reply - Issue is still present, it simply changed format and didn't appear in the same way.

Re: Invoke-NcSSH in WFA



Not sure if invoking cli commands using ssh is the best way for doing ndmp copy. There are Posh cmdlets available for it..



But if you need to use the cli and for your requirement, you can try the below. I'm using a simple qtree show command for my example, you can try yours.



Start-Job -ScriptBlock { 
$cd=New-Object System.Management.Automation.PSCredential (“admin”, (ConvertTo-SecureString “pass1!” -AsPlainText -Force)) ;
Invoke-NcSsh -Name -Command 'qtree show' -Credential $cd; }


If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.