govc aboutTest connection and show vCenter/ESXi version
govc ls /List vCenter inventory root
β‘ VM Operations
govc ls /DC/vmList all VMs in a datacenter
govc vm.info /DC/vm/MyVMVM power state, IP, CPU, memory
govc vm.power -on /DC/vm/MyVMPower on VM
govc vm.power -off -force /DC/vm/MyVMHard power off VM
govc snapshot.create -vm /DC/vm/MyVM -m Pre-PatchCreate snapshot with memory
govc snapshot.tree -vm /DC/vm/MyVMList snapshots for a VM
govc vm.clone -vm /DC/vm/Template -on=false NewVMClone from template (powered off)
π Find & Report
govc find / -type m -runtime.powerState poweredOffFind all powered-off VMs
govc host.info /DC/host/Cluster/esxi01Host details: CPU, memory, version
govc datastore.info /DC/datastore/DS1Datastore capacity and free space
govc vm.info -json /DC/vm/MyVM | python3 -m json.toolVM info as formatted JSON (great for scripting)
esxcli vs vim-cmd vs PowerCLI vs govc
esxcli and vim-cmd run directly on the ESXi shell and require SSH access to the host. They're useful for direct host troubleshooting and automation without a vCenter. PowerCLI is the official VMware PowerShell module, best for scripting bulk operations against vCenter. govc is an open-source Go CLI for the vSphere API, ideal for Linux/bash environments and CI/CD pipelines where installing PowerShell is inconvenient.
Snapshots are not backups
This is the single most important VMware admin warning. A snapshot captures the delta from the base VMDK. As the VM runs, the delta grows. Large or old snapshots degrade I/O performance and can fill datastores. Always consolidate snapshots (delete them) after completing the work they were created for. Use Veeam, Commvault or VMware Live Recovery for actual backup protection.
Getting govc
Install govc on Linux: curl -L -o - "https://github.com/vmware/govmomi/releases/latest/download/govc_Linux_x86_64.tar.gz" | tar -C /usr/local/bin -xvzf - govc. Set GOVC_URL, GOVC_INSECURE=1 and optionally GOVC_USERNAME / GOVC_PASSWORD environment variables.