This post is also available in: Italian

Reading Time: < 1 minute

As you know, several commands from local CLI (via the ESXi shell or TSM technical support mode) are changed in latest version of ESXi (in the new ESXi 5 most are replaced by the new esxcli command). One command that was alredy replaced in ESXi 4.1 was the vmware-cmd command. A new vim-cmd must be used instead (as as described by William Lam in VMware vimsh and vim-cmd). The typical use of vmware-cmd command was get/change the state of a VM and register a VM.

About the state of a VM, the VMware KB1014165 (Powering off a virtual machine on an ESXi host) explain the new command syntax and usage.

To get the list of the VMs and they unique indentifier (VMID):

  • Previous command: vmware-cmd -l
  • New command: vim-cmd vmsvc/getallvms

To get the state of a VM:

  • Previous command: vmware-cmd VMX_Path getstate
  • New command: vim-cmd vmsvc/power.getstate VMID

To shutdown a VM (trying with a guest shutdown):

  • Previous command: vmware-cmd VMX_Path stop trysoft
  • New command: vim-cmd vmsvc/power.off VMID trysoft

To register a VM:

  • Previous command: vmware-cmd -s VMX_File
  • New command: vim-cmd solo/registervm VMX_File

Note that you can use VMID or also the entire name of your VMX file.

Share

Virtualization, Cloud and Storage Architect. Tech Field delegate. VMUG IT Co-Founder and board member. VMware VMTN Moderator and vExpert 2010-24. Dell TechCenter Rockstar 2014-15. Microsoft MVP 2014-16. Veeam Vanguard 2015-23. Nutanix NTC 2014-20. Several certifications including: VCDX-DCV, VCP-DCV/DT/Cloud, VCAP-DCA/DCD/CIA/CID/DTA/DTD, MCSA, MCSE, MCITP, CCA, NPP.