VMware ESXi host operations via pyATS — VM inventory, snapshot management, hypervisor inspection across ESXi hosts in the testbed. Use when listing VMs on ESXi, checking snapshot age, auditing VMware inventory, or verifying pre-change snapshots exist.
VMware ESXi host operations via pyATS — VM inventory, snapshot management, hypervisor inspection across ESXi hosts in the testbed. Use when listing VMs on ESXi, checking snapshot age, auditing VMware inventory, or verifying pre-change snapshots exist.
The parameter is the Vmid from vim-cmd vmsvc/getallvms. Returns the snapshot tree for that VM:
Snapshot name and description
Snapshot ID
Creation timestamp
Whether it's the current snapshot (the "you are here" marker)
Parent/child snapshot hierarchy
What to check:
Stale snapshots — snapshots older than 72 hours degrade performance (growing delta disks)
Snapshot chains — deep chains (>3 levels) cause I/O performance degradation
Pre-change snapshots — verify a snapshot was taken before maintenance windows
Disk space — snapshot delta files consume datastore space proportional to guest write activity
Workflows
1. VMware Inventory Audit
pyats_list_devices → identify ESXi hosts in testbed
→ vim-cmd vmsvc/getallvms per host → collect all VMs
→ Cross-reference with NetBox/Nautobot → flag undocumented VMs
→ Check virtual hardware versions → flag outdated versions
→ GAIT
2. Snapshot Health Check
pyats_list_devices → identify ESXi hosts
→ vim-cmd vmsvc/getallvms per host → get VM IDs
→ vim-cmd vmsvc/snapshot.get per VM → collect snapshot trees
→ Flag: snapshots > 72 hours old, chains > 3 deep, orphaned snapshots
→ Severity-sort (stale snapshots = WARNING, deep chains = CRITICAL)
→ GAIT
3. Pre-Change VM Verification
ServiceNow CR must be in Implement state
→ vim-cmd vmsvc/getallvms → identify target VM by name → get Vmid
→ vim-cmd vmsvc/snapshot.get {vmid} → verify pre-change snapshot exists
→ If no snapshot: STOP — snapshot must be taken before changes
→ Record baseline state in GAIT
4. Multi-Host VM Inventory
pyats_list_devices → identify all ESXi hosts
→ vim-cmd vmsvc/getallvms per host (parallel) → collect fleet-wide VM inventory
→ Aggregate: total VMs, VMs per host, hardware version distribution
→ Cross-reference with vCenter inventory (if available)
→ GAIT
Parallel Operations
Run VM inventory across multiple ESXi hosts concurrently: