Backing up and restoring Orchestrator
Everything Orchestrator knows lives inside the appliance: workflows, actions, configuration elements, plug-in settings, credentials, run history, and the PostgreSQL database that holds them. There’s no separate database server to back up any more, so you protect Orchestrator by protecting its VMs. This recipe shows how to do that for a single appliance and for a cluster, how to restore, and why you still want a second, content-only copy.
Getting ready
- A standalone appliance (
vco01.vmw.lab) or the three-node cluster from recipe 2.4. - Permission in the vSphere Client to take and revert snapshots of the appliance VMs, or a backup product that does image-based backups through vSphere Storage APIs – Data Protection (VADP).
- A root shell on each node, for the cluster steps and the health checks: SSH in as
vmware-system-user, thensudo su -(recipe 2.1).
How to do it
The steps below use vSphere snapshots, because every lab has them. A backup product follows the same rules: which VMs, in what order, and without memory.
Back up a single appliance
- In the vSphere Client, right-click the appliance VM (
vco01) and select Snapshots > Take Snapshot. - Name it something you’ll recognise later, such as
before-2.7-heap-change. - Clear Include virtual machine’s memory, then click Create.
vSphere Client, Take Snapshot dialog for the vco01 VM, name before-2.7-heap-change, with Include virtual machine's memory cleared.
Back up a three-node cluster
- Find the primary database node. On any node, list the PostgreSQL replication cluster. The line whose role is
primarynames the pod that holds the primary database:
kubectl -n prelude exec postgres-0 -- chpst -u postgres repmgr cluster show --terse --compact- Map that pod to a node. The
NODEcolumn shows which appliance it runs on:
kubectl -n prelude get pods -o wide | grep postgresSSH session on vco01 showing the repmgr cluster show output from step 4, with one primary and two standby rows, followed by the kubectl get pods -o wide output from step 5.
- Snapshot the replicas first, then the primary. Take a snapshot without memory of each replica node, one after the other, and of the primary node last. In the lab, if
vco02holds the primary, the order isvco01,vco03,vco02.
Restore
- Single appliance: right-click the VM, select Snapshots > Manage Snapshots, pick the snapshot, and click Revert. Power the VM on if it was off.
- Cluster: power off all three nodes. Revert each one to the snapshot from the same backup run. Power on the primary node first, wait until its console shows the login prompt, then power on the two replicas.
- Check the result. When all pods are
Running, check the server’s health:
kubectl -n prelude get podsvracli vro info -d-
Log in to the Orchestrator Client and open Activity > Workflow Runs. Runs that were active at the moment of the backup come back in whatever state they were in. Cancel any you don’t want to resume.
-
Delete the snapshots once you’ve finished the change they were protecting. A snapshot isn’t a backup: it lives on the same datastore as the VM, and it slows the VM down the longer you keep it.
How it works
An Orchestrator appliance is a small Kubernetes cluster. Its PostgreSQL database, its configuration, and the Kubernetes state that ties them together all sit on the VM’s disks. A snapshot or an image-based backup copies those disks at one instant, so a restore puts back every one of them as it was at that instant.
You leave memory out because what’s in memory doesn’t help. The database writes everything it needs to disk, and a VM restored from a memory snapshot resumes with network connections and Kubernetes timers that are already stale. A restored VM boots cleanly instead, and PostgreSQL recovers from its own log, as it would after a power cut.
In a cluster, the database primary keeps writing while you snapshot the replicas. Taking the primary last means the primary is the newest copy. When you power it on first after a restore, it’s still the primary. The replicas then find it, see they’re behind, and catch up from it. Power the replicas on first, and one of them may decide the primary is dead and promote itself, leaving you with two databases that disagree.
repmgr failover works, not stated in the Orchestrator documentation. Check in the lab that after a restore in the documented order, repmgr cluster show reports one primary and two healthy standbys.There's more
Use a real backup product for real backups. Snapshots are for short changes, like the ones in this chapter. For daily backups, use an image-based backup product that supports VADP. Put all three cluster nodes in the same job so they’re copied at nearly the same moment, and restore all three from the same run. VCF’s own guidance for its other appliances is the same: back up every node of a cluster together, keep each backup for at least three days, and run one test backup before you trust the schedule.
Quiescing. The Orchestrator documentation asks only for snapshots without memory, and says nothing about quiescing. VCF’s own backup tables quiesce some appliances and not others. Until you’ve tested it, leave quiescing off for the Orchestrator VMs.
Fleet Management backups. VCF Operations Fleet Management can schedule backups of the VCF management components to an SFTP server. A standalone Orchestrator that you deployed yourself isn’t one of those components, so plan its backups separately.
The embedded Orchestrator is part of VCF Automation, so it’s protected by VCF Automation’s backups. You can’t snapshot it on its own.
Keep a content-only copy as well. A VM backup is all or nothing: to recover one workflow that someone deleted yesterday, you’d have to roll the whole server back. Export your own content regularly as a package, such as com.vcfguide.chapter2, or keep it in Git. Chapter 6 covers both. Then a single deleted workflow is a quick import, not a restore.
Restore to a new VM. If the original VM is gone, a backup product can restore it as a new VM. Keep the same name, IP address, and MAC address if you can. The appliance’s certificates, its Kubernetes cluster, and the authentication setup all expect its old identity.
See also
- 2.4 Building a three-node cluster, which warns against reverting a single cluster node.
- 2.3 Managing the package signing certificate, before you rely on package exports.
- Broadcom TechDocs: Image-Based Backup for VCF Operations, for VCF’s general rules on image-based backups, and VCF Component Backup and Restore.
- VMware Docs (Aria Automation Orchestrator 8.16): Back up and restore Automation Orchestrator.
