VMware Cloud Community
mwpreston
Hot Shot
Hot Shot

ESXi host(VCHostSystem) as input parameter but returning a string containing hostname

Hi All,

I've been creating a few workflows that I'd hoped to integrate into the web client.  Basically, they just call the PowerShell plug-in and execute a script.  Some of the scripts call for an argument, usually vmhost (defined as a string).

In vCO, I set the input parameter as vmhost = VC.HostSystem.  What I'm looking to do is somehow assign vmhost.name to an argument in the Invoke and external script workflow, and trying to do this without popping in another scriptable task and simply saying arguments = vmhost.name.  Does anyone know if there is a way I can do this directly in the gui interface w/out code?

thx

Reply
0 Kudos
5 Replies
cdecanini_
VMware Employee
VMware Employee

Are you trying to populate another field ? Then you need to set a data binding property and set it to #vmhost.name

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Reply
0 Kudos
mwpreston
Hot Shot
Hot Shot

So I've tried that - maybe I have something wrong - Should this works - the arguments parameter still appears to be null when I run this, even when I select a host during the workflow run

Capture.PNG

Reply
0 Kudos
mwpreston
Hot Shot
Hot Shot

Ok, I've got it working, if I use the same code - #vmhost.name and use the 'Default Value' property it works...

Next question, is there any way for me to hide this input from the user - if I use a Hide Parameter Input property on the arguments it doesn't work, remove it, and it does....

Or, is there any way I can set an attributes default value based on an input parameter - like make arguments and attribute and set it to #vmhost.name ?

Thanks,

Mike

Reply
0 Kudos
cdecanini_
VMware Employee
VMware Employee

You should use hide and set it to true or show and set it to false.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Reply
0 Kudos
mwpreston
Hot Shot
Hot Shot

Hi,

The problem is, as soon as I use hide and set to true, or show and set to false, it doesn't apply the default value or data binding anymore - if I leave it visible it does..

Is this normal behavior?

Thanks,

M

Reply
0 Kudos