VMware plug-in specific properties

There are some special properties of the VMware Server plug-in (the plug-in that starts with VC: ) We will have a quick look at them now.

Specify a root object to be shown in the chooser

This setting lets you define a certain start point for your searches. For example, if you choose an ESXi cluster as the root element, then a user can only select objects under this cluster. To use the root element, you need to link an action or a variable to this property. The following is an example:

Specify a root object to be shown in the chooser

Select value as

The select value as property has three choices—Tree, List, and Dropdown. This property makes it easier to manage what the input of an object looks like. The Select value as behaves differently, depending on the object type and client implementation. In the following screenshot, the dropdown for the VC:VirtualMachine selection is shown as a list:

Select value as

Show in inventory

The show in inventory property is a powerful property. When you start a workflow from vSphere Web Client, the object you started the workflow on will be passed to the workflow as an IN-parameter. If this property is assigned to more than one IN-parameter, only one parameter is used at a time. For example, if you have an IN-parameter for a VM and a cluster, both have the Show in Inventory property assigned to them. When starting the workflow from a VM, the VM ID will be used, and the cluster ID will not be transferred to the workflow. When starting the workflow from a cluster, the cluster ID will be used, and the VM ID will be ignored.

Example

In order to get this showcased, we will use the InstallFreshVM deploy workflow. We will alter it a bit and then use it in the Web Client, as follows:

  1. Make a copy or increase the version of the InstallFreshVM workflow, just to be on the safe side.
  2. Edit the workflow and go to Attributes.
  3. Move the parameter vmResourcePool and vmFolder to be an input parameter.
  4. Reassign both the parameters to the Create simple virtual machine workflow (use the validation).
  5. Create a new attribute called rootVmFolder of the VC:VmFolder type and assign it the VM root folder in your chooser.
  6. Go to Presentation and select the vmFolder input parameter.
  7. Add the Specify root object to be shown in the chooser property, click on Help editing OGNL, Example, and assign it to the rootVmFolder attribute.
  8. Now, add the Show in Inventory property to the vmResourcePool input parameter. Just add it. No extra configuration is needed.
  9. Open the vSphere Web Client in a browser and add the InstallFreshVM workflow. Make sure that you select the Host, Cluster, and Folder types with it. We did this in Chapter 4, Working with Workflows. You can have a look at it if you need to refresh your memory.
  10. Now, right-click on a VM folder and select the new workflow. Check how the properties are working.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset