JAEN

Virtualization

vim-cmd vmsvc/getallvms

CautionESXi VM list/control

vim-cmd vmsvc/getallvms

Lists ESXi VMs and Vmids; power.on/off can control them.

Examples

  • vim-cmd vmsvc/getallvmsList VMs and Vmids
  • vim-cmd vmsvc/power.getstate 12Power state of Vmid 12
  • vim-cmd vmsvc/power.shutdown 12Clean guest shutdown (needs VMware Tools)
  • vim-cmd vmsvc/power.on 12Power on
  • vim-cmd vmsvc/snapshot.get 12List snapshots

Syntax

vim-cmd vmsvc/getallvms | vim-cmd vmsvc/power.getstate <vmid>

Key points

  • The Vmid column is the number you pass to every other command. The File column is in [datastore] path form.
  • power.off is a hard power-off. Use power.shutdown for a clean stop.
  • Enable SSH or the ESXi Shell first. It also works on hosts managed by vCenter.

When it does not work

  • Skipping invalid VM means a broken .vmx file or a stale registration.
  • power.shutdown fails when VMware Tools is missing or not running.

Before you run it

power.off can force-stop a VM.

Related commands

The same reference, with no signal at all

Every command on this site, held on your device. The app adds 632 more: 1,510 commands and 120 fix flows, searchable with no connection. Free to install, no ads (some content is a one-time purchase).

Get it free on the App Store