Hi,
i have a workflow that has input of VC:VirtualMchine. On the presentation tab I configure this input with the properties below.
Specify a root object to be shown in the chooser. Root Object is provided from a parameter or attribute - I create an attribute with VC:ResourcePool type and select the resourcepool I want. Than I link the attribute to this property.
Select Value as - Tree (this works when I try to select an input for workflow it opens up a window with only the resource pool I defined in the first property.
If a change the Select value as property to List and search a VM, it searches in whole vCenter not just in the resource pool.
How can I restrict the VM search for just in that Resourcepool or just in specify cluster?
Thanks,
Haluk
There are scripting actions coming out of the box with vCenter plug-in, that return list of VMs in a resource pool or in a cluster.
Check the actions getAllVMsOfResourcePool (under module com.vmware.library.vc.resourcePool) and getAllVMsOfComputeResource (under module com.vmware.library.vc.cluster), respectively for retrieving VMs in a resource pool or in a cluster.
So you only need to bind the value of Predefined list of elements presentation property of your input parameter to the corresponding action. The value should look something like the following:
GetAction("com.vmware.library.vc.resourcePool","getAllVMsOfResourcePool").call( #att0 )
to filter the machines in a resource pool, or something like the following:
GetAction("com.vmware.library.vc.cluster","getAllVMsOfComputeResource").call( #att0 )
to filter the machines in a cluster
Hi,
Root Object property is taken into account only for tree choosers, and is ignored for list/dropdown choosers.
For these choosers You can use another presentation property, Predefined list of elements, and bind it to a vRO scripting action that will take as an input argument #att0 (the attribute you used in the root object property), and will enumerate and return an array with virtual machines part of this resource pool/cluster.
Do you have any example how to archive that?
Nevermind I found an action called getAllVMsOfresource
So that I found how to create this predefined array, the next question is, how can I populate and present this list before I submit the request?
There are scripting actions coming out of the box with vCenter plug-in, that return list of VMs in a resource pool or in a cluster.
Check the actions getAllVMsOfResourcePool (under module com.vmware.library.vc.resourcePool) and getAllVMsOfComputeResource (under module com.vmware.library.vc.cluster), respectively for retrieving VMs in a resource pool or in a cluster.
So you only need to bind the value of Predefined list of elements presentation property of your input parameter to the corresponding action. The value should look something like the following:
GetAction("com.vmware.library.vc.resourcePool","getAllVMsOfResourcePool").call( #att0 )
to filter the machines in a resource pool, or something like the following:
GetAction("com.vmware.library.vc.cluster","getAllVMsOfComputeResource").call( #att0 )
to filter the machines in a cluster
You don't need to manually populate this list; you need only to bind this action to the input parameter using presentation property Predefined list of elements, and the action will be invoked automatically when you start the workflow presentation and open object chooser for the workflow input parameter.
So this worked great on the vRO. How can do this in vRA? when I select Entity type of VC:VirtualMachine and field type search for the form field, it automatically defaults to all VMs. When I select the List instead of search it gives the correct list but there is no search available.