Mastering ESXi CLI: Essential to Advanced Commands in VMware ESXi 7.0 & 8.0



VMware ESXi is a bare-metal type 2 hypervisor that runs directly on server hardware to host virtual machines. Managing ESXi hosts often requires using the ESXi Shell or SSH to execute commands for configuration, troubleshooting, and monitoring porpoises. SSH and the CLI are the fastest and sometimes the only way to get things done, especially during troubleshooting, automation, or upgrades.

This article covers essential ESXi 7.0 and 8.0 commands, moving from basic administrative tasks to advanced troubleshooting and configuration.

Let’s dive in the some useful ESXi host commands.

ESXi CLI Commands Cheat Sheet

Basic ESXi Host Commands

CommandDescriptionExample / Notes
esxcli system version get Show ESXi version, build, and patch information Useful to verify exact build details
esxcli system hostname get Show the current host name (and domain) Can verify FQDN settings
esxcli system uptime get Show how long the host has been running Helps determine if host was recently rebooted
esxcli system stats installtime get Show the ESXi installation date/time Confirms when host was first installed
esxcli system maintenanceMode set --enable yes Enter maintenance mode Required before patching or shutdown
esxcli system maintenanceMode set --enable no Exit maintenance mode Use after maintenance tasks complete
esxcli system shutdown poweroff -d 60 -r "Updating ESXi" Shutdown host after delay e.g., schedule shutdown with reason
esxcli system shutdown reboot -d 60 -r "Rebooting host" Reboot host after delay Delay and reason optional (see above)
dcui Open the Direct Console User Interface Useful for local console access to host console menu
esxtop Launch ESX TOP (real-time performance monitor) Shows CPU, memory, network, and disk stats:contentReference[oaicite:6]{index=6}

Networking Commands

CommandDescriptionExample / Notes
esxcli network ip connection list List active TCP/UDP connections Shows network connections and status
esxcli network nic list List physical NICs on the host Shows link status, speed, driver, and MAC
esxcli network ip interface list List VMkernel network interfaces Shows VMkernel vNICs and their IP info
esxcli network ip interface ipv4 get Get IPv4 settings for VMkernel interfaces Useful to confirm IP and subnet
esxcli network vm list List VMkernel network details per VM Shows which vNIC is connected to which vSwitch/portgroup
esxcli network vswitch standard list List standard vSwitches and portgroups Shows vSwitch names, MTU, and portgroup names
esxcli network nic stats get -n vmnic0 Show statistics for vmnic0 Replace vmnic0 as needed for other NICs
esxcli network firewall get Get firewall status Shows if firewall is enabled/disabled
esxcli network firewall ruleset list List all firewall rulesets Use --enabled flag to see which are active
esxcli network firewall set --enabled false Disable the host firewall Useful for troubleshooting (re-enable after)
esxcli network firewall set --enabled true Enable the host firewall Recommended for security

Storage Commands

CommandDescriptionExample / Notes
esxcli storage filesystem list List mounted file systems and VMFS datastores Shows datastore names, UUIDs, and mount points
esxcli storage vmfs extent list List VMFS extent information Useful for detailed VMFS volume layout
esxcli storage core path list List all storage paths Shows paths to storage devices (used for multipathing)
esxcli storage nfs list List mounted NFS volumes Shows NFS server, share, and mount status
esxcli iscsi adapter list List iSCSI adapters (software and hardware) Shows iSCSI HBA names
esxcli storage core adapter rescan --all Rescan all storage adapters Use to detect new storage devices or LUNs
esxcli storage core device list List all storage devices (NAA IDs) Find the device ID for SMART checks or RDMs
esxcli storage core device smart get -d naa.XXX Get S.M.A.R.T. info for a disk Replace naa.XXX with device from above
vmkfstools -D /vmfs/volumes/datastore/vm.vmdk Check disk type (thin/thick) Output shows if disk is thin (CID=0) or thick

VM Management Commands

CommandDescriptionExample / Notes
vim-cmd vmsvc/getallvms List all registered VMs on the host Shows VMID, name, file path, guest OS
vim-cmd vmsvc/power.on <vmid> Power on the VM with ID vmid Replace vmid with the actual VM ID from above
vim-cmd vmsvc/power.off <vmid> Power off the VM with ID vmid Equivalent to ACPI shutdown/power off
vim-cmd vmsvc/unregister <vmid> Unregister (remove) VM from inventory Does not delete files, just removes from host
esxcli vm process list List running VMs and World IDs Shows state of VM processes (use with next command)
esxcli vm process kill --type=soft --world-id=<id> Forcefully kill a VM process Use --type=hard or force if soft fails
vim-cmd vmsvc/snapshot.create <vmid> <snapshot_name> Create a snapshot for VM Provide the VM ID and a snapshot name
vim-cmd vmsvc/snapshot.removeall <vmid> Remove all snapshots for VM Clean up space by consolidating

Cluster & HA Commands

CommandDescriptionExample / Notes
esxcli vsan cluster get Show vSAN cluster membership Displays cluster UUID and nodes
esxcli vsan cluster join -u <cluster-uuid> Join this host to a vSAN cluster Supply the target cluster's UUID
esxcli vsan cluster leave Remove this host from its vSAN cluster Leaves vSAN cluster (for maintenance or decommission)
esxcli vsan cluster new Create a new vSAN cluster with this host Generates a new cluster UUID
esxcli vsan cluster preferredfaultdomain get Show preferred fault domain (stretched cluster) Displays current preferred site
esxcli vsan cluster preferredfaultdomain set --preferred-fault-domain-name <name> Set the preferred fault domain Useful for stretched vSAN configurations

Performance & Troubleshooting Commands

CommandDescriptionExample / Notes
esxtop Real-time performance monitor (CPU, memory, network, etc.) Press h inside esxtop for help:contentReference[oaicite:7]{index=7}
vsish Interactive VMkernel shell (low-level debug) Use with caution; for advanced troubleshooting
esxcli system process list List processes on the host Shows running processes and resource usage
esxcli hardware cpu list Show CPU configuration and features Useful to verify CPU model and features
esxcli hardware memory get Show memory size and module details Displays total memory installed
esxcli hardware environment get Retrieve hardware sensor (temperature, fan) status Shows overall health status
vmkload_mod --list List loaded VMkernel modules (drivers) Verify if specific driver modules are loaded
esxcli system syslog config get Show syslog configuration See log output location and rotation settings

Advanced Configuration & Debugging Commands

CommandDescriptionExample / Notes
esxcli system settings advanced list List current advanced settings (and defaults with -d) Many tunable parameters are hidden here
esxcli system settings advanced set -o /Net/FollowHardwareMac -i 1 Example: Force following MAC address on network failover Use the -o path for the setting and -i new value
esxcli system syslog config get Show current syslog destination and settings Useful to verify where logs are written
esxcli system syslog reload Reload syslog configuration after changes Must run to apply new log settings
esxcli software vib list List all installed VIB packages Shows driver/hardware package versions
esxcli hardware pci list List PCI devices (HBAs, GPUs, NICs, etc.) Helps identify hardware IDs and drivers

Post a Comment

Previous Post Next Post