Many thanks for this, so I have cloned the certified command for map lun and added the section at the bottom then in the workflow gone to the return parameters tab and added LunId but for some reason it seems to errors with the below, i guess I am doint something wrong?
Failed to evaluate workflow return parameter value 'LunId'
Location: 'LunId' return parameter
param (
[parameter(Mandatory=$true, HelpMessage="Cluster name or IP address")]
[string]$Cluster,
[parameter(Mandatory=$true, HelpMessage="Storage Virtual Machine name")]
[string]$VserverName,
[parameter(Mandatory=$true, HelpMessage="Volume name")]
[string]$VolumeName,
[parameter(Mandatory=$false, HelpMessage="Qtree name")]
[string]$QtreeName,
[parameter(Mandatory=$true, HelpMessage="LUN name")]
[string]$LunName,
[parameter(Mandatory=$true, HelpMessage="Name of the igroup to map the initiator to")]
[string]$IgroupName,
[parameter(Mandatory=$false, HelpMessage="LUN id")]
[string]$LunId
)
Get-WFALogger -Info -message $("Connecting cluster : " + $Cluster)
Connect-WfaCluster -Node $Cluster -Vserver $VserverName
if ($QtreeName)
{
$LunPath = "/vol/" + $VolumeName + "/" + $QtreeName + "/" + $LunName
}
else
{
$LunPath = "/vol/" + $VolumeName + "/" + $LunName
}
Get-WFALogger -Info -message $("Mapping LUN : " + $LunName)
if($LunId)
{
Add-NcLunMap -Path $LunPath -InitiatorGroup $IgroupName -VserverContext $VserverName -Id $LunId
}
else
{
Add-NcLunMap -Path $LunPath -InitiatorGroup $IgroupName -VserverContext $VserverName
}
#'------------------------------------------------------------------------------
#' return LunID to WFA
#'------------------------------------------------------------------------------
Add-WfaWorkflowParameter -Name "LunId" -Value $LunId -AddAsReturnParameter $True