Skip to content

Learning path

The recipes in this book are grouped by topic. If you’re starting from nothing, that’s not the order you learn in. This page puts them in learning order, one small step at a time. Each step says what you build and which recipe covers it in depth. Do the steps in order: each one uses what the previous step made.

Never opened Orchestrator? Do Hello World first: it shows where everything is, click by click.

You only need two things before step 1: an Orchestrator you can log in to with a role that can create content (chapter 1), and a vCenter registered with it (recipe 1.9).

Everything in Orchestrator is made from four kinds of objects: actions, resource elements, configuration elements, and workflows. Learn these first.

An action is a small, reusable piece of script with typed inputs and one return value.

  1. Go to Library > Actions and click New Action.
  2. Name it sayHello, and type the module com.vcfguide.start. Click Create.
  3. On the Script tab, add an input name of type string, and set the Return type to string.
  4. Enter this script and click Save:
com.vcfguide.start/sayHello
// Returns a greeting and writes it to the log.
if (!name) {
throw "name is required";
}
var greeting = "Hello, " + name + "!";
System.log(greeting);
return greeting;
  1. Click Run, enter World, and run it. The Last Run Details panel shows the result Hello, World! on Result / Inputs, and the same line on Logs.

The script is plain JavaScript as of 2011 (ES5): var, function, and string concatenation. Recipe 4.1 explains why.

Go deeper: 4.2 Writing and reusing actions.

A resource element is a file stored inside Orchestrator: a text template, a script, an image, a JSON document. Workflows read it at run time, so you can change the file without touching code.

Create a text file hello-template.txt with the line Hello, {{name}}! Today is {{day}}., import it under Assets > Resources, then read it from a script with getContentAsMimeAttachment().content and replace the placeholders.

Go deeper: 7.6 Resource elements.

A configuration element is a named set of typed values, such as a default greeting, a host name, or a password, kept outside the code. Each environment (lab, test, production) gets its own values, and the code stays the same.

Create an element vcfguide-start-settings under Assets > Configurations with one variable defaultName (string) = World. Then read it from a script with getAttributeWithKey("defaultName").value.

Go deeper: 4.7 Working with configuration elements in code.

Step 4: finding your way around the scripting API

Section titled “Step 4: finding your way around the scripting API”

You’ve already used three objects of the scripting API: System, ResourceElement, and ConfigurationElement. Every plug-in adds more. The API Explorer (in the client, and in the script editor) lists every type, method, and attribute, with its parameters and return type. Learn to look a method up before you guess.

Go deeper: 4.1 JavaScript in Orchestrator and 4.8 Scripts that read well.

Step 5: a workflow, with inputs, outputs, and variables

Section titled “Step 5: a workflow, with inputs, outputs, and variables”

Now put the pieces into a workflow. Make Hello from settings: an optional input name, an output greeting, and a variable settings (type ConfigurationElement) bound to vcfguide-start-settings. One scriptable task falls back to defaultName when no name is given, then calls sayHello.

This is where the three kinds of slots matter: inputs come from whoever starts the run, outputs go back to them, and variables carry values between the steps inside. A variable can also be bound to a configuration element, so the value comes from there.

Go deeper: 3.1 Workflow basics and 3.2 Scriptable tasks and the schema canvas.

Plug-ins connect Orchestrator to other systems. Each one adds scripting types, an inventory tree of live objects, and a library of ready-made workflows. You add a system to the inventory by running one of those library workflows: Add a vCenter Server instance, Add an Active Directory server, Add a PowerShell host, Add a REST host. Each takes the connection details and stores them in the plug-in.

Go deeper: 5.1 How plug-ins work, 1.9 Registering your first vCenter, 5.2 REST hosts, and 5.8 Active Directory.

When JavaScript isn’t enough, write the action in Python, Node.js, or PowerShell. An action environment adds the packages that code needs, such as a PyPI package or an npm module.

Go deeper: 4.3 Python actions and environments and 4.4 Node.js actions.

VCF Automation decides what gets deployed and who may ask for it. Orchestrator does the work around it that no template can: naming, registering, approving, and telling other systems. In a VM Apps organization, these are the places where a workflow or action plugs in:

Use case What Orchestrator does Where you set it up in VCF Automation
Custom day-2 action on a resource A workflow runs against one machine, for example to change its CPU and memory or add a disk. Its input is the resource, such as a VC:VirtualMachine. Resource Actions, bound to a resource type
Custom day-2 action on a deployment The same, but for a whole deployment, for example to register every machine in it with a monitoring tool. Resource Actions, on the deployment type
Extensibility subscriptions A workflow runs at a lifecycle event, such as before a machine is provisioned or after it’s removed. It gets the event payload in one input, inputProperties of type Properties, and can hand values back. Extensibility > Subscriptions
Dynamic values in a request form An action returns the list of choices a drop-down shows, such as the VM folders a project may use. In a template you call it with $dynamicEnum. Template inputs, or the custom form of a catalog item
Form extensibility Actions fill in, check, or hide request form fields from live data, as external sources in the form designer. Custom Form of a catalog item
Custom and dynamic types A custom resource type wraps a workflow so something that isn’t a machine, such as an AD user, becomes a deployable resource. The Dynamic Types plug-in models objects from any REST API as Orchestrator types. Custom Resources, and the Dynamic Types plug-in in Orchestrator
Workflows as catalog items (XaaS) Any workflow can be requested from the catalog, with its input form, by people who never see Orchestrator. Content Sources (type Automation Orchestrator), then Content Sharing

Older guides list an eighth use: workflows as tasks in Automation Pipelines (Code Stream). Pipelines aren’t part of VCF Automation 9: the last release that has them is Aria Automation 8.18.1 (Broadcom KB 378424).

These use cases come from the cloudblogger.co.in post Importance of Orchestrator in Aria Automation, updated here for VCF Automation 9.

For more worked examples at every level, the blog keeps an index of all its posts by topic and level: Every CloudBlogger post, organised by topic and level. Each recipe’s See also list links the posts that cover the same task.

Go deeper: the introduction to chapter 8.

Tie it all together: an extensibility subscription in VCF Automation calls a workflow at the right moment in a deployment, the workflow reads the event payload, uses an action, a configuration element, and a plug-in, and hands values back to the deployment.

Go deeper: 8.5 Extensibility subscriptions and 8.6 Workflows as catalog items.

Before your workflows multiply, learn to design them: answer five questions, build small actions you can test on their own, put one library workflow over them, and start it from thin entry workflows. Give everything a name that says what it does and who owns it.

Go deeper: chapter 9, starting with 9.1 Designing a solution from the bottom up.

When you’re comfortable with the steps above, the schema element reference walks through every element you can drop on the canvas, one at a time, with a small working example. It starts with the overview.