Hi,
I have a problem with my workflow for creating a template form a selected VM.
My workflow consists of a "scriptable task"(IN parameter: VM, folder, resourcepool, name, OUT parameter: output). which formats the input objects to string and paste them to an "invoke external script" with a powershell script(IN parameter: host, externalscript, arguments, OUT parameter: output).
After execution the output is given to another "scriptable task" which has no programming yet.
The problem is that the ps script does its job and after the end, it is started another time but also aborted after a few steps and I can't figure out why.
The simplified start of my ps script looks like this:
param(
$vmfo,
$name
)
$log = "\\server_ip\D$\scripts\logs\wf_tpl_log.txt"
date
date >>$log
echo "VM or Folder:$vmfo, Name:$name"
echo "VM or Folder:$vmfo, Name:$name" >>$log
echo "Start Script..."
$zzah = get-random
echo "Import Module..."
echo "Import Module..." >>$log
Import-Module "C:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1"
if ($?){
echo "success!!!"
}
else{
echo "error???"
exit
}
echo "Connect VCenter Server..."
echo "Connect VCenter Server..." >>$log ==>>This is the last message I get in the log when it runs the 2nd time!
Connect-VIServer -server server_ip -User Administrator -Password password -force -WarningAction SilentlyContinue >>$log
if ($?){ echo "success" } else {echo "error"}
Everything is working fine, script ends with "exit 0" so I guess the problem comes from the workflow and not from the script itself.
Any ideas to this issue?
PS: I just tested with a simple workflow consisting only of the "invoke external script" plugin and an added ps script with an echo as content and also this is executed twice.
So it seems to be a general problem/bug within the orchestrator application.
Thanks and Regards
Alu