Skip to content

Advanced operations

Until now, almost everything in this book started with a click in the Orchestrator Client. In real operations that’s the exception. Workflows are started by pipelines, by scheduled jobs on other servers, by other products, and by Orchestrator itself when something happens. This chapter is about those starts: driving Orchestrator from outside, and letting it act on its own.

Recipe 7.1 opens the REST API that the client itself is built on, and shows how to authenticate to both kinds of Orchestrator in the lab, the standalone appliance and the one embedded in VCF Automation. Recipe 7.2 uses it to start a workflow from a shell script and from PowerShell, wait for it, and read its result. Recipe 7.3 turns the direction round: a policy that runs a workflow every few minutes without anyone starting it, and the plug-in events a policy can listen to. The last four recipes cover the server-side tools that keep this kind of automation in order. Recipe 7.4 labels content and plug-in objects with tags, so that workflows can find them. Recipe 7.5 uses locks to stop runs that work at the same time from overwriting each other. Recipe 7.6 keeps whole files, such as an HTML report template, on the server as resource elements. Recipe 7.7 puts a workflow on a timetable, and looks at the stored credentials that decide whether a schedule keeps running.

Object Name
Workflow folder VCF Orchestrator Guide/Chapter 7
Workflow started from scripts List VMs by name, from recipe 3.2
Workflow started by a policy Count powered-on VMs
Policy, in VCF Orchestrator Guide/Chapter 7 VCF Guide VM count, with the policy run VM count every 5 minutes
Account for scripts on vco01.vmw.lab svc-vcfguide@vsphere.local, a member of OrchestratorAdmins
Shell helpers vro-env.sh and run-workflow.sh, written in recipes 7.1 and 7.2
Action module com.vcfguide.chapter7, with tagVm, tagVmGlobally, findVmsByTag, listLocks and scheduleReportAt
Workflows for locks and reports Count a run (recipe 7.5) and Build VM report (recipe 7.6)
Configuration element, in VCF Orchestrator Guide/Chapter 7 vcfguide-ch7-state, holding the counter for recipe 7.5
Resource elements, in VCF Orchestrator Guide/Chapter 7 vcfguide-vm-report.html (template) and vcfguide-vm-report-latest.html (result)
Tags vcfguide, read-only, vcenter on workflows; vcfguide-owner (private) and vcfguide-backup (global) on VMs
Schedule VM report every weekday, running Build VM report

The API examples run against vco01.vmw.lab with Basic authentication, and against the Orchestrator embedded in VCF Automation at auto.vmw.lab with a bearer token. They need a Linux or macOS shell with curl and jq, or PowerShell 7. Every workflow in the chapter only reads from vc01.vmw.lab. Recipe 7.4 sets Orchestrator tags on a few VMs, which vCenter never sees. JavaScript samples are plain ES5.1.

The REST API has been the way into Orchestrator for more than ten years, and calls written for vRO 7 still look familiar. What’s new is how you authenticate, and the products that sit in front of Orchestrator.

Back in vRO 5.5–7Call /vco/api with a user name and password, or through the older SOAP web service.
In Orchestrator 9.xA standalone appliance with vSphere authentication still accepts a user name and password. The Orchestrator embedded in VCF Automation takes a bearer token, exchanged from an API token, and VCF Automation adds its own Orchestrator gateway API.
Back in vRO 5.5–7Build policies in the Java client, often from a policy template shipped with a plug-in.
In Orchestrator 9.xBuild policies under Library > Policies in the browser client, and watch them under Activity > Policy Runs. Policies made in 8.x may need to be recreated after the upgrade to 9.x.
Back in vRO 5.5–7Schedule a workflow from the Java client; the run used the stored credentials of whoever scheduled it.
In Orchestrator 9.xClick Schedule on the workflow, choose the Starting user (yourself, the Orchestrator system user, or an API token), and manage schedules under Activity > Scheduled.