ESXi Commands
VMware ESXi CLI and esxcli commands for hypervisor management.
Host Startup Procedure
Step 1: Power on ESXi hostBoot the physical server
Step 2: Wait for host bootWait 3-5 minutes for ESXi to fully load
Step 3: Verify host statusCheck host services are running
esxcli system version getVerify ESXi version and build
/etc/init.d/hostd statusCheck hostd service status
Step 4: VMs auto-startVMs with auto-start enabled will boot automatically
vim-cmd vmsvc/getallvmsList all VMs and their states
Step 5: Verify vCenter connectionEnsure host reconnects to vCenter (if applicable)
Host Shutdown Procedure
Step 1: Put host in maintenance modeMigrate or shutdown VMs via vCenter (if applicable)
vim-cmd hostsvc/maintenance_mode_enterEnter maintenance mode
Step 2: Shutdown guest VMsGracefully shutdown all running VMs
vim-cmd vmsvc/getallvms | grep -v VmidList all VMs to get VMIDs
vim-cmd vmsvc/power.shutdown <vmid>Graceful shutdown specific VM
for vm in $(vim-cmd vmsvc/getallvms | awk '{print $1}' | grep -v Vmid); do vim-cmd vmsvc/power.shutdown $vm; doneShutdown all VMs
Step 3: Wait for VM shutdownAllow VMs 2-5 minutes to shutdown gracefully
vim-cmd vmsvc/power.getstate <vmid>Check VM power state
Step 4: Shutdown ESXi hostPower off the hypervisor
esxcli system shutdown poweroff -r "Scheduled maintenance"Shutdown ESXi host
esxcli system shutdown reboot -r "Reboot for updates"Reboot ESXi host
/sbin/shutdown.sh && /sbin/poweroffAlternative shutdown command
System Information
esxcli system version getDisplay ESXi version
esxcli hardware platform getDisplay hardware platform info
esxcli system hostname getDisplay hostname
esxcli system stats installtime getDisplay installation time
esxcli system time getDisplay current time
esxcli system uuid getDisplay system UUID
vmware -vDisplay VMware version (short)
uptimeDisplay system uptime
Virtual Machine Management
vim-cmd vmsvc/getallvmsList all VMs with VMIDs
vim-cmd vmsvc/power.getstate <vmid>Get VM power state
vim-cmd vmsvc/power.on <vmid>Power on VM
vim-cmd vmsvc/power.off <vmid>Power off VM (hard)
vim-cmd vmsvc/power.shutdown <vmid>Graceful shutdown VM
vim-cmd vmsvc/power.reboot <vmid>Reboot VM
vim-cmd vmsvc/power.suspend <vmid>Suspend VM
vim-cmd vmsvc/power.reset <vmid>Reset VM (hard reboot)
vim-cmd vmsvc/get.summary <vmid>Display VM summary
vim-cmd vmsvc/get.config <vmid>Display VM configuration
vim-cmd vmsvc/snapshot.get <vmid>List VM snapshots
vim-cmd vmsvc/snapshot.create <vmid> <name> <desc>Create VM snapshot
vim-cmd vmsvc/snapshot.remove <vmid> <snapshot_id>Delete VM snapshot
esxcli vm process listList running VMs with world IDs
esxcli vm process kill -t soft -w <world_id>Soft kill VM process
esxcli vm process kill -t hard -w <world_id>Hard kill VM process
Network Configuration
esxcli network nic listList physical NICs
esxcli network vswitch standard listList virtual switches
esxcli network vswitch standard portgroup listList port groups
esxcli network vswitch standard add -v <vswitch_name>Create virtual switch
esxcli network vswitch standard uplink add -u <vmnic> -v <vswitch>Add uplink to vSwitch
esxcli network vswitch standard portgroup add -p <name> -v <vswitch>Add port group
esxcli network vswitch standard portgroup set -p <name> -v <vlan_id>Set VLAN on port group
esxcli network ip interface listList vmkernel interfaces
esxcli network ip interface ipv4 getDisplay IPv4 configuration
esxcli network ip interface add -i <vmk#> -p <portgroup>Add vmkernel interface
esxcli network ip interface ipv4 set -i <vmk#> -I <ip> -N <netmask>Set vmkernel IP address
esxcli network ip route ipv4 listDisplay routing table
esxcli network ip route ipv4 add -g <gateway> -n defaultAdd default gateway
esxcli network ip dns server listDisplay DNS servers
esxcli network ip dns server add -s <dns_ip>Add DNS server
esxcli network firewall getDisplay firewall status
esxcli network firewall set --enabled trueEnable firewall
esxcli network firewall ruleset listList firewall rulesets
esxcli network firewall ruleset set -r <ruleset> -e trueEnable firewall ruleset
Storage Management
esxcli storage core adapter listList storage adapters
esxcli storage core device listList storage devices
esxcli storage vmfs extent listList VMFS extents
esxcli storage filesystem listList datastores
esxcli storage nfs listList NFS datastores
esxcli storage nfs add -H <nfs_server> -s <share> -v <datastore_name>Mount NFS datastore
esxcli storage nfs remove -v <datastore_name>Unmount NFS datastore
esxcli storage core device smart get -d <device>Get SMART data for device
esxcli storage core path listList storage paths
ls /vmfs/volumes/List datastore mount points
vmkfstools -i <source.vmdk> <destination.vmdk>Clone virtual disk
vmkfstools -c <size> <diskname.vmdk>Create virtual disk
vmkfstools -X <newsize> <diskname.vmdk>Expand virtual disk
Host Configuration
esxcli system hostname set --host <hostname> --fqdn <fqdn>Set hostname
esxcli system ntp set --server <ntp_server>Set NTP server
esxcli system ntp set --enabled trueEnable NTP
esxcli system ntp getDisplay NTP configuration
esxcli system module listList loaded kernel modules
esxcli system module set -m <module> -e trueEnable kernel module
esxcli system settings advanced listList advanced settings
esxcli system settings advanced set -o <option> -i <value>Set advanced setting
esxcli system syslog config getGet syslog configuration
esxcli system syslog config set --loghost <syslog_server>Set syslog server
esxcli system coredump partition getDisplay coredump partition
esxcli system coredump network getDisplay network coredump configuration
Service Management
/etc/init.d/hostd restartRestart hostd service
/etc/init.d/vpxa restartRestart vCenter agent
/etc/init.d/ntpd restartRestart NTP service
esxcli system maintenanceMode getCheck maintenance mode status
esxcli system maintenanceMode set --enable trueEnter maintenance mode
esxcli system maintenanceMode set --enable falseExit maintenance mode
esxcli system shutdown poweroff -d <delay> -r <reason>Shutdown host
esxcli system shutdown reboot -d <delay> -r <reason>Reboot host
User & Security
esxcli system account listList local user accounts
esxcli system account add -i <username> -p <password> -c <password>Add user account
esxcli system account set -i <username> -p <newpassword> -c <newpassword>Change user password
esxcli system account remove -i <username>Remove user account
esxcli system permission listList permissions
vim-cmd hostsvc/advopt/view UserVars.ESXiShellTimeOutView ESXi Shell timeout
vim-cmd hostsvc/advopt/update UserVars.ESXiShellTimeOut long <seconds>Set ESXi Shell timeout
esxcli system security certificatestore listList SSL certificates
Patches & Updates
esxcli software sources profile list -d /vmfs/volumes/<datastore>/<update.zip>List profiles in update bundle
esxcli software sources profile list -d https://<url>/depot.zipList profiles from online depot
esxcli software vib listList installed VIBs
esxcli software vib install -v <vib_path>Install VIB from file
esxcli software vib install -d <depot_url> -n <vib_name>Install VIB from depot
esxcli software vib remove -n <vib_name>Remove VIB
esxcli software vib update -d <bundle_path>Update from offline bundle
esxcli software profile update -d <bundle> -p <profile>Update to specific profile
esxcli software profile update -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p <profile>Update from VMware online depot
esxcli software profile install -d <depot> -p <profile>Install complete profile (clean install)
esxcli software acceptance getGet acceptance level
esxcli software acceptance set --level CommunitySupportedSet acceptance level to community
esxcli software acceptance set --level PartnerSupportedSet acceptance level to partner
esxcli software acceptance set --level VMwareCertifiedSet acceptance level to certified
esxcli software profile getDisplay current installed profile
esxcli software vib list | grep -i <search>Search installed VIBs
Firmware Updates
esxcli hardware platform getDisplay hardware platform information
esxcli system baseline getDisplay firmware baseline
esxcli hardware pci listList PCI devices with firmware versions
esxcli network nic get -n <vmnic>Display NIC firmware version
esxcli storage core adapter listList storage adapters with firmware
sched-swap -s /vmfs/volumes/<datastore>/<firmware.zip>Schedule firmware update (HPE)
esxcli software vib install -d /vmfs/volumes/<datastore>/<offline-bundle.zip>Install driver/firmware bundle
esxcli hardware ipmi sel listDisplay IPMI system event log
esxcli hardware ipmi fru listDisplay field replaceable unit info
Monitoring & Logs
esxcli hardware cpu listDisplay CPU information
esxcli hardware memory getDisplay memory information
esxcli hardware pci listList PCI devices
esxcli system stats installtime getDisplay uptime statistics
esxtopInteractive performance monitor
vsishVMware system information shell
tail -f /var/log/vmkernel.logMonitor vmkernel log
tail -f /var/log/hostd.logMonitor hostd log
tail -f /var/log/vpxa.logMonitor vCenter agent log
cat /var/log/messagesView system messages
vm-supportGenerate support bundle
Advanced & Troubleshooting
esxcli system process listList running processes
kill -9 <pid>Kill process by PID
esxcli system visorfs getDisplay visorfs ramdisk usage
vdf -hDisplay datastore usage
esxcli system visorfs ramdisk listList ramdisks
ping -c 4 <ip>Ping network host
vmkping -I <vmk#> <ip>Ping from specific vmkernel interface
esxcli network diag ping -H <host>Network diagnostic ping
esxcli network ip connection listDisplay network connections
esxcli rdma device listList RDMA devices
localcliLocal CLI (works when hostd is down)