- 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.
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
- Open the Orchestrator Client and switch to the workflows.
- If you haven't made a new folder yet, right-click on the root of the tree and select Add Folder.
- Give the folder a name and click on OK.
- Right-click on the new folder and select New workflow.
- Give the workflow a name. The workflow will open in the edit mode.
Adding an attribute
- Click on General and then scroll down to Attributes.
- Click on . A new variable will be put under Attributes and named att0.
- Click on att0 and give the variable a new name, such as text.
- Click on String under the Type column to change the variable type, but for this example, we leave it as String.
- 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
- Click on Inputs and then on .
- 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
- Click on Outputs and then on .
- 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
- Click on Schema.
- Drag Scriptable task between the start and end symbols.
- Hover the mouse on the scriptable task and then select the edit icon (the pencil icon).
- Click on In and then the bind icon (see the following screenshot).
- All in-parameters and attributes are displayed. Select the input variable as well as the text attribute you have created earlier.
- Click on OK and then OUT.
- Follow the same method as the previous one to bind the output parameter output to the script element.
- Click on Scripting. You will now see all the variables you have assigned to the scriptable task.
- By clicking on a variable, you can insert it into the script. Make the following script:
- Click on Close to close the scriptable task.
- Click on Save and Close.
- 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.
- Run the workflow by clicking on the RUN icon (the play button).
- Enter a text for the input variable and click on Submit.
- 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.
- In a workflow, hover the mouse over an element and then click on Edit (the pencil icon).
- Select IN and click on not set for any one of the variables.
- You now can either select an already-existing variable, or create a new one by clicking on Create parameter/attribute in workflow.
- 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.