Vim-cmd

Description

vim-cmd is a vSphere CLI tool available on every ESXi host and can be used to perform various activities in a VMware environment.

Usage

Connect to your esxi

List the inventory ID of the virtual machine with the command:

$vim-cmd vmsvc``/getallvms` `|``grep` `<vm name>
#example
$vim-cmd vmsvc``/getallvms` `| ``grep` `vcenter

Note: The first column of the output shows the vmid.

Check the power state of the virtual machine with the command:

$vim-cmd vmsvc``/power``.getstate <vmid>

Power-on the virtual machine with the command:

$vim-cmd vmsvc``/power``.on <vmid>

Power-off the virtual machine with the command :

$vim-cmd vmsvc``/power``.off <vmid>

Source :

Date : 2020.10.13