VMware vRealize Orchestrator Cookbook

More Information
  • Install, configure, and optimize Orchestrator installations (Windows, Appliance as well as vRA integrated)
  • Explore all the visual programming elements without the need for additional infrastructure
  • Work with plugins such as SSH, mail, SQL, PowerShell, AD, SOAP, SNMP, AMQP, and REST
  • Discover how to create VMware automation
  • Get to grips with user management, synchronization, and packaging applications
  • Understand policies and resources
  • Work more efficiently with distributed Orchestrator environments

Through this practical guide, you will gain an understanding of VMware vRealize Orchestrator and its role in the vSphere architecture and automation. You will learn about Orchestrator clusters as well as vRealize Automation integration. A full introduction to using the visual programming tools without needing any additional infrastructure is aimed at beginners with limited resources. This is followed by an extensive look at how to integrate the base plugins into your workflows, such as e-mail, AMQP, SNMP, and so on. We will also look at how to use the Orchestrator API to trigger workflows from other programs.

Through this book you will be able to get the most out of your Orchestrator installation, and develop complex workflows and create your own highly integrated automations of vCenter, vCloud, and vRealize environments.



Read an Extract from the book

Creating a Vcenter workflow

In this recipe, we will work through the process of creating a workflow. We will see how to add and use variables as well as run a workflow.

Getting ready

We just need a working Orchestrator, and you will need the rights to create new workflows and run them. We will work with the Orchestrator Client.

How to do it...

We will break up the recipe into several sections.

Creating a new workflow

  1. Open the Orchestrator Client and switch to the workflows.
  2. If you haven't made a new folder yet, right-click on the root of the tree and select Add Folder.
  3. Give the folder a name and click on OK.
  4. Right-click on the new folder and select New workflow.
  5. Give the workflow a name. The workflow will open in the edit mode.

Adding an attribute

  1. Click on General and then scroll down to Attributes.
  2. Click on . A new variable will be put under Attributes and named att0.
  3. Click on att0 and give the variable a new name, such as text.
  4. Click on String under the Type column to change the variable type, but for this example, we leave it as String.
  5. In the Value column, fill in some text, such as Test. Give it a description. A description isn't needed, but it's a best practice to document what this variable is used for.

Adding an input parameter

  1. Click on Inputs and then on .
  2. Add an input parameter named input by following the same procedure as in Adding an attribute.

Note that you cannot define a value here, as it is defined during runtime.

Add an output parameter

  1. Click on Outputs and then on .
  2. Add an output parameter named output by following the same procedure as in Adding an attribute.

Note that you cannot define a value here, as it is defined during the workflow execution.

Adding a scripting element

A scripting element allows us to use JavaScript in it and manipulate the variables we have defined earlier.

  1. Click on Schema.
  2. Drag Scriptable task between the start and end symbols.
  3. Hover the mouse on the scriptable task and then select the edit icon (the pencil icon).
  4. Click on In and then the bind icon (see the following screenshot).
  5. All in-parameters and attributes are displayed. Select the input variable as well as the text attribute you have created earlier.
  6. Click on OK and then OUT.
  7. Follow the same method as the previous one to bind the output parameter output to the script element.
  8. Click on Scripting. You will now see all the variables you have assigned to the scriptable task.
  9. By clicking on a variable, you can insert it into the script. Make the following script:output=input+text;
  10. Click on Close to close the scriptable task.
  11. Click on Save and Close.
  12. You are asked whether you would like to increase the version history. Click on Increase version. See the Version control recipe in this chapter for more information.
  13. Run the workflow by clicking on the RUN icon (the play button).
  14. Enter a text for the input variable and click on Submit.
  15. Check the result of the workflow by clicking on the workflow execution and then on Variables, as seen in the following screenshot:

How it works...

In this recipe, we have introduced some very basic working methods. Let's just discuss some more details we have glossed over.

Exiting a workflow

There are four buttons on the bottom of the edit workflow screen:




Before exiting the edit mode, Orchestrator will display the Save and Close or Close anyway options. Close anyway will exit the workflow without saving any changes.


This reverts the workflow to the state when it was opened for edit.

Be careful that it doesn't ask you whether you are sure.


This saves changes to the workflow without exiting.

Save and Close

This will save all changes to the workflow and exit the edit mode.


When you are exiting the edit mode, Orchestrator will validate the workflow. This means that Orchestrator checks whether all the variables are assigned, they are not used, and a script contains errors. It also checks whether elements, such as other workflows, actions, configuration items, and so on exist. You can run the validation at any stage by just clicking on Validate in the schema.

In the validation window, you will see each error or warning message (Title) and next to it, the element (Owner) that is the source of the problem; the Quick fix action link can be used to access the element and remedy the problem. You should always check the warning/error before using a quick fix action. For example, the quick fix action for an attribute that is not used in a workflow is Delete parameter, but maybe you have just forgotten to bind it as an input or output of one of the workflow elements, so first check before using the quick fix action. A typical example here is an attribute that is used for presentation purposes only.

Warnings can be ignored, whereas errors will result in workflows not being able to start. However, it's always best to resolve all issues.

Assigning a workflow variable

When you add an existing workflow, action, or workflow element to your schema, you will need to bind its input and output variables to your variables.

  1. In a workflow, hover the mouse over an element and then click on Edit (the pencil icon).
  2. Select IN and click on not set for any one of the variables.
  3. You now can either select an already-existing variable, or create a new one by clicking on Create parameter/attribute in workflow.
  4. You can choose whether you want to create an input (or output) parameter or an attribute. If you define an attribute, you can also assign it a value directly.

Re-run a workflow

You can rerun a workflow by either:

  • Right-clicking on the workflow and selecting Start last workflow run
  • Right-clicking on a workflow execution and selecting Run again

Also, you can run a workflow with other credentials by choosing Start workflow as.

  • Program with Orchestrator to automate and synchronize your infrastructure
  • Integrate the base plug-ins into your workflows
  • Packed with over 100 example workflows, packaged for download and reuse

Page Count 382
Course Length 11 hours 27 minutes
ISBN 9781784392246
Date Of Publication 27 Feb 2015


Daniel Langenhan

Daniel Langenhan is a Virtualisation expert with formidable skills in Architecture, Design and Implementation for large multi-tier systems. His experience and knowledge of process management, enterprise-level storage, Linux and Windows operation systems has made him and his business a highly sought after international consultancy in the Asia-Pacific and European regions for multinational clientele in the areas of Finance, Communication, Education and Government. Daniel has been working with VMware products since 2002 and is directly associated with VMWare since 2008. His proven track record of successful integrations of Virtualisation into different business areas while minimizing cost and maximizing reliability and effectiveness of the solution for his clients.

Currently, Daniel is operating in the Europe and Asia-Pacific region with his company vLeet GmbH and Melbourne Business Boosters Pty Ltd.

Daniel's expertise and practical approach to VMWare has resulted in the publication of the following books:

  • Instant VMware vCloud Starter, Packt Publishing
  • VMware View Security Essentials, Packt Publishing
  • VMware vCloud Director Cookbook, Packt Publishing
  • VMware vRealize Orchestrator Cookbook, Packt Publishing
  • VMware vRealize Orchestrator Essentials, Packt Publishing

He has also lent his expertise to many other publishing projects as a Technical Editor.