Orchestrator in VCF
- 8.1Workflows against vCenter
- 8.2Provisioning a VM from a template
- 8.3An approval process for provisioning
- 8.4NSX automation
- 8.5Extensibility subscriptions in VCF Automation
- 8.6Workflows as catalog items
- 8.7Calling VCF Automation from a workflow
- 8.8Custom resources backed by workflows
- 8.9VM devices, cluster HA and port groups
- 8.10The vAPI plug-in, vSphere tags and content libraries
The first seven chapters built up the tools: the appliance, the canvas, scripting, plug-ins, packages, the API, and the server-side helpers. This chapter uses them for the job most people bring Orchestrator in for, which is automating the private cloud that VCF gives you.
Recipe 8.1 is the base for the rest. It looks at the vSphere plug-in from the inside: the library workflows it ships with, the scripting objects that mirror the vSphere API, how to find one VM quickly in a large inventory, and how to start a vCenter task and wait for it properly. Recipe 8.2 builds on that to clone a VM from a template with a guest customization specification, first with a library workflow and then with a workflow of your own that you can call from anywhere. Recipe 8.3 wraps that workflow in a request that goes to an approver by email, waits for an answer, and builds the VM only when someone says yes.
Recipe 8.4 turns to NSX. Orchestrator 9.x doesn’t install an NSX plug-in, so it uses the NSX Policy API through the HTTP-REST plug-in to create a segment, wait until NSX has built it, tag a VM, and make a group whose members follow the tag. Recipes 8.5 and 8.6 connect Orchestrator to VCF Automation in its two directions. In 8.5, VCF Automation calls Orchestrator in the middle of a deployment, through extensibility subscriptions that name each VM and tag it in NSX. In 8.6, a workflow becomes an item in the VCF Automation catalog, with a custom form, ordered by users like any cloud template. Recipe 8.7 turns it around once more: a workflow calls the VCF Automation API through the plug-in that comes with the embedded Orchestrator, with the rights of the person running it.
Recipe 8.8 turns an Orchestrator object into a VCF Automation resource that users deploy and delete: a custom resource with a create and a destroy workflow. Recipe 8.9 goes back to vCenter for everyday changes: a VM’s CD/DVD drive and network adapter, and a cluster’s vSphere HA settings. Recipe 8.10 adds the vAPI plug-in, for the two things the vSphere plug-in can’t do: vSphere tags and deploying from a content library. Still to come is the Orchestrator plug-in for the vSphere Client.
This chapter is being written. Planned recipes:
- The Orchestrator plug-in for the vSphere Client
The examples
Section titled “The examples”| Object | Name |
|---|---|
| Workflow folder | VCF Orchestrator Guide/Chapter 8 |
| Action module | com.vcfguide.chapter8, with vcfaGet, describeVcenters, findVmByName, waitForTask, snapshotVm, listTemplates, cloneFromTemplate, waitForGuestIp, isAutoApproved, nsxCall, nsxWaitForRealization, nsxCreateSegment, nsxTagVm, nsxEnsureTagGroup, checkVmName, describeVmDevices, removeCdroms, getClusterHaSettings, setVmHaRestartPriority, getVapiEndpoint, ensureVmTag, tagVm, getVmTags, untagVm and deployFromLibrary |
| Workflows | Snapshot a VM (recipe 8.1), Provision a VM from a template (recipe 8.2), Request a VM (recipe 8.3), Create an NSX segment (recipe 8.4), Name a catalog VM and Tag a new VM in NSX (recipe 8.5), Order a VM (recipe 8.6) |
| vCenter | vc01.vmw.lab, registered in recipe 1.9 |
| Test VM, for snapshots | vcfguide-test-01 |
| VMs built in recipes 8.2, 8.3, 8.5 and 8.6 | vcfguide-clone-01, vcfguide-web-01 to vcfguide-web-05, vcfguide-cat-001 and up, vcfguide-cat-web-01 and vcfguide-cat-web-02 |
Template, in vc01.vmw.lab |
tpl-linux-01, a small Linux VM with VMware Tools, converted to a template |
| Guest customization specification | vcfguide-linux, Linux, DHCP on one NIC |
| VM folder | vcfguide in the lab data center, for every VM the chapter builds |
| Configuration elements, in VCF Orchestrator Guide/Chapter 8 | vcfguide-ch8-provisioning, the approval settings for recipe 8.3; vcfguide-ch8-naming, the name counter for recipe 8.5; vcfguide-ch8-catalog, where catalog VMs go, for recipe 8.6 |
| Approvers’ group | OrchestratorApprovers in vSphere SSO |
| NSX Manager | nsx01.vmw.lab, registered as the REST host nsx01-rest with the account svc-vcfguide-nsx@vsphere.local |
| NSX objects | Tier-1 gateway vcfguide-t1, segment vcfguide-seg-01, group vcfguide-web, VM tags with the scope vcfguide-role |
| VCF Automation | VM Apps organization at auto.vmw.lab, project vcfguide, Orchestrator integration vco01, cloud template vcfguide-small-vm, subscriptions vcfguide name VMs and vcfguide tag VMs in NSX, content source VCF Orchestrator Guide, content sharing policy vcfguide catalog |
Recipe 8.1 creates and removes snapshots on one test VM. Recipes 8.2, 8.3 and 8.6 create new VMs in the vcfguide folder, and recipe 8.5 has VCF Automation build them. Recipe 8.4 creates a segment and a group in NSX and tags VMs. Use a cluster and datastore with room for a few small VMs, and delete the VMs when you’re done. JavaScript samples are plain ES5.1.
What changed since vRO 7
Section titled “What changed since vRO 7”The vSphere plug-in is the oldest and most used plug-in Orchestrator has, and the way you script against it has hardly changed. A workflow that clones a VM in vRO 7 reads almost the same in 9.x. What changed is everything around it.
