Vsphere
VMware vSphere/vCenter — hosts, VMs, datastores, snapshots
weave vsphere
Env: VSPHERE_SERVER
Setup
Configure credentials via environment variables. We recommend sourcing them through 1Password or your secrets manager rather than committing them to the shell rc.
Official API reference
weave commands for this module are checked against the vendor's published API.
| Variable | Description | Status |
|---|---|---|
| VSPHERE_SERVER | Required for authentication. | required |
| VSPHERE_USER | Required for authentication. | required |
| VSPHERE_PASSWORD | Required for authentication. | required |
Sanity-check the wiring:
weave secrets check weave vsphere --help weave doctor # reports VSPHERE_SERVER status
Capabilities
What this module can do, by entity and verb. ✓
means a working CLI surface; · means
not (yet) wired.
| Entity | find | list | show | do | snapshot | diff | apply |
|---|---|---|---|---|---|---|---|
| datastore | · | ✓ | · | · | · | · | · |
| host | · | ✓ | · | · | · | · | · |
| resources | · | · | · | · | ✓ | ✓ | ✓ |
| vm | ✓ | ✓ | · | ✓ | · | · | · |
Commands
Every registered CLI command, grouped by verb. Each example uses placeholder arguments — substitute real values for your environment.
find (1)
find vm
readFind a VM by name or UUID.
weave vsphere find vm <identifier>
list (3)
list datastores
readList datastores.
weave vsphere list datastores <arg>
list hosts
readList ESXi hosts.
weave vsphere list hosts <arg>
list vms
readList virtual machines.
weave vsphere list vms <arg>
do (3)
do power-off
writePower off a VM.
weave vsphere do power-off <vm-id>
do power-on
writePower on a VM.
weave vsphere do power-on <vm-id>
do snapshot
writeTake a snapshot of a VM.
weave vsphere do snapshot <vm-id>
snapshot → edit YAML →
diff → apply --yes (or confirm
interactively; apply --dry-run previews the same diff).
State kinds
Resources this module can snapshot and
diff; apply where the kind supports
live writes (see Round-trip per kind). Always run
diff before apply; use
--yes in automation after review. Files live under
.weave-state/vsphere/.
This module is on the thinner integration path — use snapshot / diff for audit; confirm apply per kind below before relying on writes.
resources
vsphere resources — field-level apply via REST.
State file skeleton
module: vsphere kind: resources items: - # <fields specific to this kind — see snapshot output>
Workflows
End-to-end recipes from operators who already run this module in production. Copy, adapt, and put under change-control.
Resources audit
Snapshot and diff resources.
weave vsphere snapshot resources $EDITOR .weave-state/vsphere/resources.yaml weave vsphere diff resources weave vsphere apply resources
Terraform parity
For each Terraform resource in the canonical provider, here's the equivalent live-API verb in weave. Use this as a migration cheat-sheet, not a 1:1 contract — weave deliberately stays in the live-state lane, not the desired-state lane.
| Terraform resource | weave equivalent |
|---|---|
| vsphere_resources | weave vsphere snapshot/diff/apply resources Snapshot/diff for audit; confirm apply on the module page. |
Troubleshooting & source
Run weave doctor — it reports which env
vars (including VSPHERE_SERVER) are set
and which are blank.
Re-run weave vsphere diff <kind>
to confirm the controller's current state, then re-snapshot
before the next apply. The driver always re-snapshots
before diffing.
The module lives at https://github.com/andy-broyles/weavewhatever/tree/main/src/weave/modules/vsphere. File a bug or feature request at https://github.com/andy-broyles/weavewhatever/issues.