Automation
VMware Automation
Cheat sheet · https://pcornel.dk/topic.php?topic=5732
Answer
VMware automation manages vSphere with PowerCLI, govc, the vSphere API, Terraform and Ansible's vmware collections — deploying VMs from templates, changing hardware, managing snapshots and reporting.
Remember
- Connect-VIServer per session.
- Tasks are asynchronous; wait for completion.
- Object names can be ambiguous; use IDs.
First checks
Get-Module VMware.PowerCLI -ListAvailable— PowerCLIgovc about— govc CLI- vSphere Automation API / pyvmomi usage — SDKs
Verify in this order
tool → vCenter API → ESXi/VMs
Where it usually breaks
Automation/controller success is not target-state proof; target config/state is not effective-runtime proof; effective state is not workload proof.
Automation → VMware Automation · operational reference
| Layer | Automation → VMware Automation operational reference |
|---|---|
| Runtime/ownership | VMware vSphere automation / Broadcom PowerCLI · identify controller/parser, durable intent, identity and target ownership before mutation |
| Persistent intent | Versioned definition/configuration with explicit dependencies, scope and credential boundary |
| Expected interpretation | The automation connects to the intended vCenter with the intended identity, resolves stable managed-object identities, applies only the bounded change, and independently reads back vCenter state. |
| Recovery boundary | Preserve correlation IDs + pre-state, repair first failing boundary, then verify the target independently |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5732