Now that we have installed, configured, and integrated Orchestrator in our VMware vSphere infrastructure, we can finally have a look at how to use the product. We will learn how to use pre-created workflows that exist in the Orchestrator library. This includes running and stopping them, checking their outcome, and dealing with errors.
We will use the Orchestrator Client as well as the vSphere Web Client.
For this chapter, we need to have Orchestrator configured to use the vSphere vCenter. If you need help with this, have a look at Chapter 3, Integrating Orchestrator with vSphere. We will cover the following topics here:
Before we actually start working with the Orchestrator workflows, we should first have a look at how the Orchestrator Client works.
To open the Orchestrator Client, perform the following steps:
vcoadmin
as the username and vcoadmin
as the password. This is a preconfigured user that allows you to login and use Orchestrator directly.When you open the Orchestrator Client, it will be in the Run mode. There are three modes in total—Run, Design, and Administer.
Each of these modes is used for different phases of the workflow lifecycle. In the following image, you will see a collage of all the Orchestrator icons, which is followed by a table with a short description about what each icon is used for:
Icon |
What it does | |
---|---|---|
My Orchestrator |
This gives an overview of all the active tasks and configures non-admin access. | |
Scheduler |
This manages the scheduled workflows. We will schedule workflows later in this chapter. | |
Policies |
A policy is a trigger that can be configured to trigger when certain events occur. | |
Workflows |
This manages everything that has to do with workflows. | |
Inventory |
This shows all the objects that each plugin has access to. | |
Actions |
This manages everything that has to do with actions. Actions are like mini workflows. We will discuss Actions in detail in Chapter 6, Advanced vRO Scripting with JavaScript. | |
Resources |
A resource is a file that can be used from workflows. | |
Configurations |
Configurations are centrally defined attributes that are available to all workflows. | |
Packages |
A package contains workflows, actions, as well as all the other elements that export and import the Orchestrator solutions. We will work with packages in Chapter 9, Packing It All Up. | |
Policy templates |
These are the templates for policies. | |
Authorizations |
This is deprecated and not used anymore. | |
Web Views |
Web Views are HTTP-based web pages that interact with Orchestrator (deprecated and removed from Version 6). |
We do not have the page count to discuss all the other items in this list. Please refer to the vRealize Orchestrator Cookbook for an extended discussion on resources, non-admin access to the Orchestrator, configurations, and policies.
Let's get started with some very basic things about workflows. We will see what a workflow consists of as well as how we can handle it.
A workflow is made up of different elements. We will now look into each of these elements one after another. But first, we have to navigate to a workflow and have a look at it:
We will now go through all the properties of a workflow, as this is the central part of Orchestrator.
The General tab consists of two main areas. The upper area shows all the properties of the workflow such as its name, ID, and so on. The lower area is where its attributes are shown (see the following figure). We will first have a closer look at the upper area:
The lower section contains all the attributes of this workflow. An attribute is like a global variable that is defined for all elements of this workflow. We will have a closer look at them in Chapter 5, Combining and Modifying Workflows.
The Inputs tab shows all the input parameters that exist for this workflow. An input parameter is a variable that needs to be filled with a value when the workflow is started. Have a look at the first input parameter. It will ask for the name of the new VM. We will have a closer look at these parameters in Chapter 5, Combining and Modifying Workflows.
The Outputs tab shows all the output parameters of the workflow. These values are filled when the workflow is finished. The values can then be used by another workflow as the input parameters. The only output parameter of this workflow is the internal vSphere ID of the newly created VM. We will have a closer look at these parameters in Chapter 5, Combining and Modifying Workflows.
The Schema tab shows how the workflow is constructed. It shows all the separate elements that the workflow is made up of. Every workflow will consist of one Start element (the green arrow icon) and at one or more End elements (the grey shield icon). Between these two elements, you can see two other elements—a scripting element (the scroll icon) and an action element (the gear icon). On the upper right-hand side, you have an option to zoom in and out. We will have a closer look at this in Chapter 5, Combining and Modifying Workflows.
The Presentation tab is where you define how the input parameters are presented and formatted for the user. You can create pages and sections and sort the input parameters. You can also define a set of rules for each input parameter. We will work with the Presentation tab more in Chapter 7, Improving Workflows with Presentation. Have a look at the highlighted vmFolder input parameter in the following figure.
You will see that it has two properties, the first one being Mandatory input, which means that this input parameter must have a value, or else the workflow will not start:
The Parameters References view shows all the parameters of the workflow and its properties in an alphabetical order. For example, you can see that the vmDiskSize input parameter is of type number (it expects a number to be entered) and has multiple properties, such as Minimum number value of 0.004. This is an information page; you cannot change anything here.
We will work with presentation properties in Chapter 7, Improving Workflows with Presentation.
A workflow token is created when a workflow is started. As a workflow can be started multiple times at the same time, each execution of the workflow creates a unique workflow token. This is an information page that shows all the workflow tokens and their status. Each workflow token contains its status as well as its start and end time. Sometimes, it is more important to know which user actually started a workflow.
Now that we have discussed what the different elements of a workflow are, let's run a workflow.
There are multiple methods that can be used to start a workflow. You can use the play button (the green arrow) that is located at the top of the workflow (Marker A), or you can right-click on the workflow in the library and then select Start workflow (Marker B). If you would like to start the workflow as a different user and not the one that you are currently logged on as, right-click on the workflow and select Start workflow as (Marker C).
After starting the workflow, a window will appear, displaying the input parameters that have to be provided in order to execute it. We will now perform the following steps to execute this workflow:
VM
. This is the top VM folder when no other VM folder exists.64
, to filter for specific options. This kind of window is pretty common in Orchestrator.true
and false
.By clicking on Submit, you have started the workflow. Orchestrator now switches to the workflow token (execution). You will see how it runs through each step and the variables fill up.
After the workflow completes its run, it can be in three states—successful (a green tick), failed (a red bullet with a white cross), or it will ask for more information (the person icon). The following figure shows all the executions with their respective start time next to them. Each of these executions is a workflow token, as shown in the Workflow Tokens section of the workflow's properties.
When you click on a workflow execution, you get additional information about the workflow's run. There are three sections—the General, the Variables, and the Logs tab.
The General tab shows the name of the workflow and its token ID, which is a unique ID inside Orchestrator. Also, the status and execution time are shown:
The Variables tab shows all the parameters (the in- and out-parameters and attributes), each with its type and the value it has when the workflow is finished. Some of the values have a grey i icon before it. If you hover the mouse on it, you will be shown additional information.
Underneath the parameters is a window titled Exception. If an error occurred during the workflow run, the error will be displayed here in red text.
The Logs tab shows the logs that the workflow created while it was running in the Orchestrator Client. We will have a look at creating logs in Chapter 8, Errors, Logs, and Debug Mode.
When an error occurs in the workflow run, most of the time you can fix the underlying problem and then you can rerun the workflow. Entering all the information again is a bit annoying.
There are two ways to do this, but basically, all result in the same thing. Right-click either on the workflow and select Start last workflow run or on the workflow execution (workflow token) and select Run again.
When you choose to rerun a workflow, the workflow input window will open and all the values, except for the passwords, will already be filled with the values that you had selected the last time you ran it.
The difference between the two methods is that the first method, by using the workflow, will result in rerunning the last execution of the workflow, whereas in the second, you can select the execution of the workflow that you are rerunning.