Hi all,
I'm writing a WFA to create a new Volume/LUN and map it to existing igroup. User have an option to specify LunID. I want to be able to verify if the LunID is available on the 'preview' level, to prevent wofklow execution fails if user specify the lunID that is already used.
I copied certified command "Map LUN" to "Map LUN_verify_lunID" to have an option to edit it a little bit.
Everything works fine, if user specify LunID that is already used, WFA returns error, because I have put verification in my command "Map LUN_verify_lunID":
Select
lunmap.lun_id,
lunmap.lun_map_value,
lun.name
from
cm_storage.lunmap,
cm_storage.igroup,
cm_storage.lun,
cm_storage.vserver
where
igroup.id = lunmap.igroup_id
AND igroup.name = '${IgroupName}'
AND lunmap.lun_map_value = '${LunId}'
AND lunmap.lun_id = lun.id
AND lun.vserver_id = vserver.id
AND vserver.name = '${VserverName}'
(By the way, is there any option to modify the 'Planning failed' message to something more specific than 'element existance issue detected during validation of command...') ? 🙂
What I'm trying to achieve is to return host LUN id. I kind of succeeded, by modyfying my powershell code for "Map LUN_verify_lunID" to:
[...]
Get-WFALogger -Info -message $("Mapping LUN : " + $LunName)
if($LunId -ne "")
{
Add-NcLunMap -Path $LunPath -InitiatorGroup $IgroupName -VserverContext $VserverName -Id $LunId
}
else
{
Add-NcLunMap -Path $LunPath -InitiatorGroup $IgroupName -VserverContext $VserverName
$Lundetails = Get-NcLunMap -Path $LunPath -VserverContext $VserverName | where-object InitiatorGroup -eq $IgroupName
$LunId = $lundetails.LunId
}
Get-WFALogger -Info -message $("Lun ID : " + $LunId)
#'------------------------------------------------------------------------------
#' return LunID to WFA
#'------------------------------------------------------------------------------
Add-WfaWorkflowParameter -Name "LunId" -Value $LunId -AddAsReturnParameter $True
I'm assuming the scenario where User does not specify any LunID in the entry parameters.
LunID is successfuly returned after workflow execution. However is it possible to get the LunID during workflow preview ?