VMware vRealize Automation – Using the vRealize Orchestrator presentation tab

In one of my previous blog posts, I talked about some of the benefits of using the Advanced Service Designer (ASD). Examples include the possibility to improve the mockup of the request form, to create request form tabs and to create dynamically populated fields.

All ASD service blueprint mockup customization can be performed using the Advanced Services tab in the vRA (vRealize Automation) portal and selecting the Service Blueprint section. But many of the layout configurations and logic of the mockup can also be performed via the presentation tab in vRO (vRealize Orchestrator). An advantage of this is that when a service blueprint form is reloaded (for example when an extra input parameter is added in the original vRO workflow), the configuration of the presentation tab is persistent.

However vRO has its limitations. An example of this is telling vRA to use sliders on a particular input parameter or to force checkboxes on Boolean values instead of the default Yes/No dropdown box. Though if there are any readers who know if this is possible, feel free to let me know via the comment section below.

In this blog post I will demonstrate some of the possibilities offered by the presentation tab by building a simple workflow that makes use of the presentation tab. The purpose of the workflow is to create a simple virtual machine. The user needs to give following input parameters:

  • Number of CPUs
  • Amount of memory
  • Amount of storage
  • DHCP (yes or no)
  • IP address (only if DHCP is not selected)
  • Default gateway (only if DHCP is not selected)
  • Subnet mask (only if DHCP is not selected)

If all parameters are entered, the user will see a short summary of the selected values.
Finally we will use tabs to structure all input parameters in a general VM information tab, a network tab and a summary tab

Building vRO the workflow

The first step is to create a new empty workflow. In this case our new workflow is called “Presentation Demo”.
2 clean begin with rectangle extra cropped
On the empty input tab, we will create our first input parameter to allow the user to select a certain amount of CPU’s. Clicking the yellow arrow marked in red in the image above creates a new input parameter.
A new entry will be listed which we will rename to “CPU” and will change the type to “Number” instead of “String”.

4 first var named extra cropped

Next we will change our view to the presentation tab.

5 cpu in presentation tab extra cropped

This view now contains our newly added input parameter called “CPU”. When clicking the “CPU” parameter, two small tabs appear:

  • General
  • Properties

We will skip the General tab for now and focus on the Properties tab because this is where the magic begins.

7 cpu predefined values with rectangles extra cropped

By clicking the icon marked in red, we get to see a box containing all possible attributes we can set to the input parameter. For the “CPU” input parameter we will start by choosing the “Predefined answers” attribute. The icon marked in green means that we will use static values as predefined answers. Later in this post we will use OGNL statements to create dynamic values populated by a vRO action. In this example we only want users to select one to four CPU’s. We can insert these values by clicking on the “Not set” text.

8 cpu predefined values input

By default we want to have two CPU’s so we add the “Default value” attribute and give it value two.

9 cpu add default value extra cropped

Our first input parameter is added and all necessary presentation configurations have been performed. Next we go back to the input tab and add the “Memory” parameter.

10 memory input added extra cropped

There will now be two entries on the presentation tab. First we will click on the “Memory” entry and select the General tab. Here we can enter a description with value “In GB”. The purpose of the description differs based on the product that runs the workflow. When the workflow is run from vRO itself, the description is used as label of the input parameter, when the workflow is run from within vRA, a little question mark will be visible next to the input parameter. The description (in this case “In GB”) will be visible when hovering over the question mark.

11 add memory description

We will not use a dropdown box for the memory input parameter. Instead we will use a vRA slider. To make the slider configuration easier to configure, we can choose the minimum, maximum and default values for the slider. We will just use statically defined values for the memory as seen below.

13 memory all attributes

The next input parameter is used for storage. The process for adding the input parameter is analogous to the previously illustrated. In the presentation tab we can also add a description like we did for the “Memory” input parameter.

The user will be able to select the amount of storage in GB via a drop-down box. We will populate these predefined answers using an OGNL statement. OGNL can be selected using the yellow array illustrated below.

16 storage add predefined vals extra cropped

To use OGNL, we need to create an action. The action we will use is shown here:

18 get storage capacity actionThe action requires three input parameters:

  • Max storage capacity
  • Min storage capacity
  • Default increment value to be used

The return value is an array of numbers. The action is basically just a loop that pushes numeric values in an array. These values are the different storage sizes a user can select.

Next, we will create new attributes in the workflow in order to have values for the input parameters of the action.

19 add new attributes for action extra cropped

It now is time to use OGNL since we have an action and matching attributes. We can now add the OGNL statement to the “Storage” entry in the presentation tab. We can select an icon by pressing the icon marked in the green. In the filter bar enter the name of the newly created action. If the corresponding action is selected, all input parameters of that action are listed. By pressing the pencil icon it is possible to select the added workflow attributes or input parameters. Press on the apply button after all parameters are set.

20 storage all action variables ognl added rectangle

 

21 storage choose the right action variable extra cropped

 

22 storage full ognl statement extra cropped

For setting the default values, we have again two possibilities. First we can set the default value by using a static value or we can use the OGNL statement.
In this case we will assign the first value of the returned action array as default value by adding [0] at the end of the OGNL statement. Using square brackets and an index is one way of retrieving a value from an array.

23 storage default value option 1 standard extra cropped

24 storage default value option 2 ognl extra cropped

After this we start configuring the network input parameters. All needed input parameters are listed in following screenshot.

We restart configuring the presentation attributes for the “DHCP” parameter. We want to have virtual machines to receive their network configuration via DHCP by default so we set the default value attribute to true.

26 dhcp default value extra cropped

Next step are the “IP”, “Gateway” and “Subnet mask” parameters. Recall that we only want to see the parameters if the value of “DHCP” is set to false. If for example the “IP” parameter is visible, it is also required that it is filled in. This can be forced using the “Mandatory input” attribute. In addition to that we can also use the “Valid internet address” attribute to force the correct formatting of the IP address, subnet mask and gateway. Refer to the image below for the complete configuration.

28 ip add attributes extra cropped

 

Finally we need to add the “Summary” input parameter and configure it. For this parameter we will use the “Data binding” presentation attribute. Its value will be modified based on all other parameters.

32 summary full action

The action we will use to create the “Summary” string is illustrated above. It takes all input parameters and creates and returns a string value.
After the action is created we can use it for the “Data binding” OGNL statement.

33 summary all ognl attributes

The last vRO step that we need to perform is to create different sections (“VM information”, “Network information” and “Summary”) to order the input parameters.
Tabs can be created by selecting the presentation header and clicking the green marked icon in the image below (normally not blanked out). It is then possible to drag and drop parameters into their respective tab.

36 parameters sorted in tabs extra cropped

This step concludes all vRO configurations. Now we need to add the workflow in the vRA so it can be requested via the portal.

Editing and testing the service blueprint

When looking in the “Blueprint form” we can see that the tabs defined in vRO are automatically configured in the service blueprint form.

37 workflow added in vcac

The only thing we need to do in the VM information tab is to add the slider to the “Memory in GB” field. Hovering over the field, pressing the pencil icon and editing the “Type” field can do this. The minimum, maximum and default values are automatically loaded from vRO. This “Type” field can also be used to change to “DHCP” field in the network information tab to a checkbox instead of a drop-down box.

39 edit presentation memory

On the “Summary” tab it is also advised to change the summary field to text area, as shown in the image below, in order to make the summary string more readable:

41 summary presentation

All configuration is finished now and we can request the new service blueprint. The results can be viewed below:

42 request first page extra cropped

Request form: VM information

45 request network tab no dhcp extra cropped

Request form: Network information

43 summary presentation request extra cropped

Request form: Summary

When changing values of input parameters, the Summary string will adapt itself immediately. It is also cool to note that changes in the vRO backend (for example the chosen default values) are adapted instantly when refreshing the request of the service blueprint.

yannickstruyf