vim-cmd is a vSphere CLI tool available on every ESXi host and can be used to perform various activities in a VMware environment.
Connect to your esxi
$vim-cmd vmsvc``/getallvms` `|``grep` `<vm name>
#example
$vim-cmd vmsvc``/getallvms` `| ``grep` `vcenter
Note: The first column of the output shows the vmid.
$vim-cmd vmsvc``/power``.getstate <vmid>
$vim-cmd vmsvc``/power``.on <vmid>
$vim-cmd vmsvc``/power``.off <vmid>