Subscribe
Accepted Solution

ReturnWFAParamaters into attribute

Hello,

 

After running a workflow from VCO in WFA, I require some return Parameters (which have been set up in WFA correctly). After the VCO workflow finishes the parameters are outputted in the logs from the completed workflow in VCO, i need them in something I can reference later on for emailing out completetion email:

 

[2015-02-24 09:30:07.600] [I] Return Parameters:
[2015-02-24 09:30:07.601] [I] --qtree-name=xxxxxx
[2015-02-24 09:30:07.602] [I] --volume-name=xxxxxxx
[2015-02-24 09:30:07.603] [I] --volume-vfiler=xxxxxx
[2015-02-24 09:30:07.604] [I] --export-pathname=xxxxx

 

(I have substituted real values for x's)

 

From the output of the workflow object "NetApp WFA Workflow execution" I have set the Local Parameter "returnWFAParamters" to a Source parameter with the same name (attribute- string) but for some reason this seems to be blank when the workflow has completed. 

 

What am I missing? Has anyone had this working?

 

Thanks

Re: ReturnWFAParamaters into attribute

Hi,

You have to play with

Add-WfaWorkflowParameter -Name namevar -Value $retVal to store value and 
$importedinitiators= Get-WfaWorkflowParameter -Name namevar -ErrorAction Continue

 

variable can even be a [array]

 

François

Re: ReturnWFAParamaters into attribute

Thanks for reply.

 

Even though the variables are making it back to VCO? I need to add this powershell command to where exactly?

Re: ReturnWFAParamaters into attribute

You have to create  new commands or clone exsisting ones.

Modify the code to store the needed values with  Add-WfaWorkflowParameter -Name namevar -Value $retVal.

Retrieve the values in the second command with  Get-WfaWorkflowParameter -Name namevar, namevar is the named reference.

 

François

 

 

Re: ReturnWFAParamaters into attribute

Hi Mdaly,

 

I would clone the send mail certified command, and before sending the email I would add this code ( using the correct returned parameters variables ) :

 

$returned_parameter1 = Get-WfaWorkflowParameter -Name nameofthereturnedparam1 -ErrorAction Continue
$returned_parameter2 = Get-WfaWorkflowParameter -Name nameofthereturnedparam2 -ErrorAction Continue
$returned_parameter3 = Get-WfaWorkflowParameter -Name nameofthereturnedparam3 -ErrorAction Continue
$returned_parameter4 = Get-WfaWorkflowParameter -Name nameofthereturnedparam4 -ErrorAction Continue

$AdditionalText = $AdditionalText + $returned_parameter1 + $returned_parameter2 + $returned_parameter3 + $returned_parameter4

 

In this way you add the variables inside the additional text ( body ) of the email. If you want to separate by line you can add + '\n' + in between the $returned_parameters

 

Hope it helps.

Re: ReturnWFAParamaters into attribute

Guys,

 

Thanks for your replies. I am not sure we are talking about the same things here. I am talking about how to get the return Paramters in VCO (Vcenter Orchestrator). I am able to get them printed out in the workflow log in VCO, but not into a variable which proves they are making it to VCO. I am not sure that anything more needs to be done in WFA... but could be wrong.

 

Thanks

Re: ReturnWFAParamaters into attribute

Hi Mdaly,

 

That actually happens often, because sometimes the returned parameter did not reach the WFA database ( it needs an OCUM or VCO refresh ). I don't know if that is your case.

 

If it was your case, you might need to get that value from VCO ( via powershell ) and then create the return parameters as Francois suggested.

 

For example, to get the LUN serial number after LUN creation and add it as return parameters I use the following code:

Get-WFALogger -Info -message $("Getting LUN Serial Number: " + $LunName)

$hexSerialNumber = $(Get-NcLunSerNbrHex -LunPath $LunPath)

Get-WFALogger -Info -message $("Adding Hex LUN Serial Number as WFA Return Parameter named: lunSerNbrHex")

Add-WfaWorkflowParameter -Name "LUN_SERIAL_NUMBER_HEX" -Value $hexSerialNumber -AddAsReturnParameter $true

 

The vpshere powercli commands cmdlet reference is :

https://www.vmware.com/support/developer/windowstoolkit/wintk40u1/html/

 

Hope it helps.

 

 

 

 

 

Re: ReturnWFAParamaters into attribute

I have tried both these methods today. unfortunately the email is being sent from VCO not from WFA. I am either missing something or it isnt possible to get these as variables into VCO.

 

 

Re: ReturnWFAParamaters into attribute

Hi Mdaly,

 

Please correct me if I am wrong . You are executing a 7mode WFA workflow that involves also interaction with VCO, probably generating NAS storage and mounting the export on the VCO side. You are trying to have some return parameters, but you don't see any return parameter ( I though you did not see only the VCO returned paramaters ).

 

The returned parameters are easily filled out . If you created a volume1 for example with a command, you would start the return paramter input with volume1.  ( after the . it will automatically start giving you the options ), then following for example  volume1.name or volume1.array.ip or volume1..vfiler.root_qtree for example . Did some of the return parameters worked for you ?

 

If you can log what you want in a return parameter, you can clone the command and simply add the Francois code to create the return parameter variable and then adding the logged into to the returned parameter.

 

Hope that helps.

 

 

Re: ReturnWFAParamaters into attribute

[ Edited ]

yes, it is 7m wfa workflow, which simply creates a volume and exports it, and I have set up return parameters for this workflow:

 

wfaEP.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


in VCO I have set an attribute up to "catch" these Parameters from the return of the completed workflow:

 

mapping.JPG

 

when the workflow runs, in the VCO System.log I get this:

 

[2015-02-24 09:30:07.600] [I] Return Parameters:
[2015-02-24 09:30:07.601] [I] --qtree-name=xxxxxx
[2015-02-24 09:30:07.602] [I] --volume-name=xxxxxxx
[2015-02-24 09:30:07.603] [I] --volume-vfiler=xxxxxx
[2015-02-24 09:30:07.604] [I] --export-pathname=xxxxx

 

I have removed the actual values and replaced with x's

 

and the attribute is empty once workflow is complete

empty.JPG

 

Hopefully this makes sense? As is said earlier, I can get the parameters in WFA, just not as I want them in VCO

 

Thanks