esxcli is a command-line interface (CLI) tool (which is a python script) used to manage VMware ESXi hosts. Using esxcli, administrators can perform various tasks related to ESXi host management, including network configuration, storage management, and VM operations.
Provides a CSV output of running Virtual Machines with its corresponding WorldID and DisplayName.
esxcli --formatter=csv --format-param=fields=="WorldID,DisplayName" vm process list
esxcli --formatter=csv vm process list
/bin/sh -c esxcli vm process list > list
Terminates a Virtual Machine using its World ID.
esxcli vm process kill --type=force --world-id=796791
esxcli vm process kill –type=hard –world-id=<ID>
esxcli vm process kill -w <WID> -t soft
esxcli --formatter=csv --format-param=fields=="WorldID,DisplayName" vm process list | awk -F "\"*,\"*" '{system("esxcli vm process kill --type=force --world-id=" $1)}'
Display the product name, version and build information.
esxcli system version get
Shows FQDN of the ESXi host.
esxcli system hostname get
Displays a list of local accounts in the ESXi host.
esxcli system account list
esxcli --formatter=csv system account list
Shows all the volumes available on the ESXi host.
esxcli storage filesystem list
esxcli storage filesystem list | grep "/vmfs/volumes/" | awk -F' ' '{print $2}'
List the status of VMDKs in vSAN.
esxcli vsan debug vmdk list
List the UUID of the vSAN objects.
esxcli --format-param=fields=="Type,ObjectUUID,Configuration” vsan debug object list
List the Devfs Path of the devices currently registered with the storage.
esxcli --formatter=csv --format-param=fields=="Device,DevfsPath” storage core device list
Changes the ESXi Welcome Message on the Direct Console User Interface (DCUI).
/bin/sh -c "esxcli system welcomemsg set -m=""
Disables the ESXi firewall.
esxcli network firewall set --enabled false
Displays network interface details.
esxcli --formatter=csv network ip interface ipv4 get
esxcli --formatter=csv network ip interface ipv4 get
Install a VIB without checking the signature.
esxcli software vib install -f --no-sig-check
Changes the VIB acceptance level to CommunitySupported.
esxcli software acceptance set --level CommunitySupported