VMware ESXi CLI

VMware ESXi CLI Cheatsheet #

VMware ESXi CLI provides a set of commands to manage ESXi hosts directly from the command line. These commands help administrators perform system management, networking, storage, and troubleshooting tasks efficiently.

ESXi System Management #

Command/OptionExampleDescription
esxcli system version getesxcli system version getDisplay the ESXi host version
esxcli system shutdown rebootesxcli system shutdown reboot --reason "Maintenance"Reboot the ESXi host
esxcli system shutdown poweroffesxcli system shutdown poweroff --reason "Maintenance"Power off the ESXi host
esxcli hardware cpu listesxcli hardware cpu listList CPU information
esxcli hardware memory getesxcli hardware memory getDisplay memory information
esxcli system time getesxcli system time getDisplay the current system time
esxcli system settings advanced listesxcli system settings advanced listList advanced system settings
esxcli system settings advanced setesxcli system settings advanced set -o /UserVars/SuppressShellWarning -i 1Set an advanced system setting

Virtual Machine Management #

Command/OptionExampleDescription
esxcli vm process listesxcli vm process listList running virtual machines
esxcli vm process killesxcli vm process kill --type soft --world-id <world_id>Kill a virtual machine process
vim-cmd vmsvc/getallvmsvim-cmd vmsvc/getallvmsList all registered VMs on the host
vim-cmd vmsvc/power.onvim-cmd vmsvc/power.on <vmid>Power on a virtual machine
vim-cmd vmsvc/power.offvim-cmd vmsvc/power.off <vmid>Power off a virtual machine
vim-cmd vmsvc/snapshot.createvim-cmd vmsvc/snapshot.create <vmid> "snapshot_name" "description"Create a snapshot for a virtual machine

Network Management #

Command/OptionExampleDescription
esxcli network nic listesxcli network nic listList all network interfaces
esxcli network nic upesxcli network nic up -n <nic>Bring up a network interface
esxcli network nic downesxcli network nic down -n <nic>Bring down a network interface
esxcli network vswitch standard listesxcli network vswitch standard listList all standard virtual switches
esxcli network vswitch standard addesxcli network vswitch standard add -v <vswitch_name>Add a new standard virtual switch
esxcli network vswitch standard uplink addesxcli network vswitch standard uplink add -u <nic> -v <vswitch_name>Add an uplink to a standard switch
esxcli network ip interface listesxcli network ip interface listList all VMkernel network interfaces
esxcli network ip interface addesxcli network ip interface add -i vmk1 -p "Management Network"Add a VMkernel network interface

Storage Management #

Command/OptionExampleDescription
esxcli storage filesystem listesxcli storage filesystem listList all mounted file systems
esxcli storage vmfs extent listesxcli storage vmfs extent listList all VMFS extents
esxcli storage core adapter listesxcli storage core adapter listList all storage adapters
esxcli storage core device listesxcli storage core device listList all storage devices
esxcli storage core path listesxcli storage core path listList all storage paths
esxcli storage core device vaai status getesxcli storage core device vaai status getGet VAAI status for storage devices

Troubleshooting #

Command/OptionExampleDescription
esxcli hardware pci listesxcli hardware pci listList PCI devices
esxcli system syslog markesxcli system syslog mark --message "Manual log entry"Add a message to the system log
esxcli network diag pingesxcli network diag ping -I vmk0 -H <ip_address>Ping an IP address from a specific VMkernel NIC
esxcli network diag netdumpesxcli network diag netdump --server <ip_address>Configure netdump for network troubleshooting
esxtopesxtopLaunch the ESXi performance monitoring tool

This cheatsheet covers the most commonly used VMware ESXi CLI commands and options, helping you to manage ESXi hosts, virtual machines, networks, storage, and perform troubleshooting effectively.

VMware ESXi CLI

Explore our comprehensive cheatsheets to enhance your knowledge and efficiency. Each cheatsheet provides detailed command options, examples, and descriptions to help you master various tools and technologies.