Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

vSphere API

Direct answer

The vSphere API is the SOAP and REST interface to vCenter and ESXi used by PowerCLI, govc, pyVmomi, Terraform and Ansible, giving access to all inventory and operations.

When to use this

Use this when tools call the vSphere API directly or through SDKs.

First 30 seconds

1. vSphere Automation REST API and SOAP (vim) API.

2. Session tokens.

3. Use SDKs for complex tasks.

4. Verify certificates (add vCenter CA).

5. Rate and session limits.

Operational verification

client → session → REST/SOAP → vCenter

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
VMware vSphere / PowerCLI automation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformVMware vSphere / PowerCLI automation · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when tools call the vSphere API directly or through SDKs.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification path Verify boundary

Record vCenter, managed object IDs, VM UUID/MoRef, datastore/network IDs and task ID; inspect the runtime/control-plane result; then query the selected vSphere managed objects and resulting VM/storage/network state through an independent read path and compare it with the versioned intent. For VMware Automation → vSphere API, the evidence must connect the control-plane result to the selected vSphere managed objects and resulting VM/storage/network state and explain any gap between desired, controller-reported and consumer-visible state.

Step 2 Common mistakes Narrow the fault
  • Using the SOAP API where REST/vAPI is available.
Step 3 Where it fails Narrow the fault

Common failure classes include duplicate names, stale inventory, task still running after client timeout, vCenter/host permission gaps, storage/network dependency failure and assuming task success shows guest service health. Before retrying a mutating operation, read current target state using the stable identity vCenter, managed object IDs, VM UUID/MoRef, datastore/network IDs and task ID; if state is unknown, stop broad retries.

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • The vSphere API has SOAP and REST interfaces.
  • All tools use it.
  • Sessions expire.
Key checks
  • curl -s --cacert vcenter-ca.pem -X POST -u <user> https://<vc>/api/session — session token with verified TLS
  • curl -s --cacert vcenter-ca.pem -H 'vmware-api-session-id: <token>' https://<vc>/api/vcenter/vm — list VMs
  • govc ls /<dc>/vm — govc
ReferenceWhy it matters1 section · depth on demand

In depth

The vSphere API is how all VMware tools talk to vCenter and ESXi. There is the older SOAP-based Web Services API (used by PowerCLI and pyVmomi, most complete) and the newer vSphere Automation REST API (/api/...).

SID=$(curl -sk -X POST -u "$USER:$PASS" https://vcenter/api/session | tr -d '"')
curl -sk -H "vmware-api-session-id: $SID" https://vcenter/api/vcenter/vm | jq '.[].name'
APICoverage
SOAP (pyVmomi, PowerCLI)Full inventory and operations
REST (/api)VMs, content library, tagging, many newer features

Use the Developer Center/API Explorer in vCenter to discover endpoints and the MOB for SOAP object paths.

ReferenceImportant terms & boundaries1 section · depth on demand

Mechanics

VMware Automation → vSphere API is owned at runtime by vCenter/ESXi control plane invoked through vSphere APIs or PowerCLI. Its durable intent is versioned automation plus explicit vCenter scope, object selectors and desired VM/storage/network state; the stable identity contract is vCenter, managed object IDs, VM UUID/MoRef, datastore/network IDs and task ID. The consumer-visible target is the selected vSphere managed objects and resulting VM/storage/network state. The operating invariants are that selectors resolve one intended object set, permissions are scoped, tasks are followed to completion, inventory cache/stale names do not replace MoRef identity and guest/consumer state is checked when needed. Follow the chain of components PowerCLI/API → vCenter inventory/authorization → task → ESXi/storage/network subsystem → managed object state → independent query and record which layer currently owns truth. The linked authority for bounded mechanics is Broadcom Developer Portal — VMware PowerCLI; documentation support is separate from observed lab/production Evidence.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docVMware vSphere / PowerCLI automation current

Authoritative/upstream documentation reviewed for bounded claims in VMware Automation > vSphere API. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://developer.broadcom.com/powercli · confidence 94%
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

Capture at minimum vCenter, object name+MoRef/UUID, task ID/state, host/datastore/network IDs, PowerCLI/API version, errors and final object/guest state.

Confirmation

Confirm action

Continue?