You don’t need to manage VM guests using just the vSphere fat client or vSphere Web Client, you can manage VM’s from the host command line (CLI).

This is a short brief list of some of the more common commands to use, there are however a lot more that I am not going to spend hours documenting…

Before you do, you need to know the vmid of the VM guest which can be done below.

Physical Host Management

Power Off Physical Host


Reboot Physical Host


Virtual Machine Management


vim-cmd vmsvc/getallvms

Displays the following information for all VM’s on physical host:

  • Vmid
  • Name
  • File
  • Guest OS
  • Version

Power Control Options

vim-cmd vmsvc/<power.type> vmid<em></em>

Power Types:

  • power.on = power on
  • power.off = hard power off
  • power.reboot = hard reboot
  • power.suspend = graceful suspend (vmtools needs to be installed)
  • power.shutdown = graceful shutdown (vmtools needs to be installed)
  • power.reset = graceful restart (vmtools needs to be installed)
  • power.getstate = query power state

Disk Management

vim-cmd vmsvc/device.<type>
  • device.add vmid size controller_number unit_number datastore = add disk
  • disk.remove vmid controller_number unit_number delete file = remove disk
  • get.datastores vmid = get list of datastores for vm

Snapshot Options

vim-cmd vmsvc/<snapshot.type> vmid snapshotid
  • snapshot.get = get snapshot information
  • snapshot.create = create snapshot
  • snapshot.remove  = remove snapshot
  • snapshot.removeall = remove all snapshots


vim-cmd vmsvc/<convert.<type> vmid
  • convert.toTemplate = convert VM to template
  • convert.toVm = convert template to VM

Should you have any questions, comments or suggestions, please don’t hesitate to comment below. If you like what you have read, please share it on your favourite social media medium.

2 Responses to “VMWare ESX 5.x Host Commands”

  1. Peter

    May I suggest this command, when your VM is stucked and you can’t shut it down thought the vsphere client
    – #esxcli vm process kill –type=hard –world-id=vmID

    Get your VM ID with :
    – #esxcli vm process list


Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.