Pcornel
Automation

VMware Automation

Cheat sheet · https://pcornel.dk/topic.php?topic=5732

Back to the Topic

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 — PowerCLI
  • govc 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

LayerAutomation → VMware Automation operational reference
Runtime/ownershipVMware vSphere automation / Broadcom PowerCLI · identify controller/parser, durable intent, identity and target ownership before mutation
Persistent intentVersioned definition/configuration with explicit dependencies, scope and credential boundary
Expected interpretationThe 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 boundaryPreserve 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

Confirmation

Confirm action

Continue?