Active IQ Unified Manager Discussions

Invoke-NcSSH in WFA

cscott
4,188 Views

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?

6 REPLIES 6

sivakumar_sekar
4,112 Views

@cscott,

 

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.

cscott
4,100 Views

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.

cscott
4,095 Views

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

sinhaa
4,057 Views

@cscott

 

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 1.2.3.4 -Command 'qtree show' -Credential $cd; }

sinhaa

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

cscott
3,952 Views

Unfortunately there are not in cDOT, they have been removed.... I am stuck right now with the fact that OCUM does not do what the customer needs of it and scripting it has turned out to be nearly impossible because things were laid out with the idea that OCUM would be managing these backups and the complexity of the layout would be irrelevant.

 

That leaves me with the only option of re-designing the snapvault implementations to remove vaults from DR desitnations and pull them from the sources thus increasing the bandwith required of snapvaults between datacenters.  Doing this will at least allow me to control the restore process somewhat and provide a viable solution to the customer.

sinhaa
3,945 Views

@cscott

 

Did you try the code which I suggested? Did it not work for you? I've used Start-Job and I was almost ceratin this has to work for your original requirement.

 

 

sinhaa

 

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