This section lists common commands that can be used to configure VMware ESXi hosts. You can run the commands via an SSH session.
NTP settings
Stop the ntpd service | esxcli system ntp set -e=no |
Specify the NTP reference server by FQDN | esxcli system ntp set -s=ntp.osevcf.local |
Specify the NTP servers by IP address | esxcli system ntp set -s=100.71.100.2 -s=100.71.100.3 |
Start the ntpd service | esxcli system ntp set -e=yes |
Note: Setting the NTP reference server by either IP address or FQDN is a destructive process. The last command (NTP configuration command) executed replaces all previous commands.
DNS settings
Add a DNS search domain | esxcli network ip dns search add -d rainpool.com |
Remove a DNS search domain | esxcli network ip dns search remove -d rainpool.com |
Add a DNS server IP address | esxcli network ip dns server add -s 100.171.204.4 |
Remove a DNS server IP address | esxcli network ip dns server remove -s 100.171.204.4 |
Note: DNS settings are cumulative. The last command executed adds or removes an entry from the list. Any other previous settings persist.
MTU settings
Configure the MTU on a vSwitch | esxcli network vswitch standard set -v=vSwitch0 -m 9000 |
Configure the MTU on a VM kernel | esxcli network ip interface set -m 9190 -i vmk0 |
Configure VLAN ID on a portgroup
Set the portgroup "VM Network" to a VLAN ID of 1711 | esxcli network vswitch standard portgroup set --portgroup-name="VM Network" -v 1711 |
Review the configuration of existing portgroups | esxcli network vswitch standard portgroup list |
Enable the CEIP (Customer Experience Improvement Program)
Enable the CEIP (Customer Experience Improvement Program) | esxcli system settings advanced set -o /UserVars/HostClientCEIPOptIn -i 2 |
Install depot files
Depot files are installed from the command line. Depot files must first be copied on to the server. There are many utilities that can be used to copy the depot file to the ESXi host. After the file has been copied, the following command will apply the updates contained in the depot file. The installation of the depot file update will not be complete until the host is rebooted.
esxcli software profile update -p VMware-ESXi-7.0U2c-18426014-standard -d /vmfs/volumes/datastore1/depot/VMware-ESXi-7.0U2c-18426014-depot.zip
Maintenance mode
Enter maintenance mode | esxcli system maintenanceMode set --enable=true |
Exit maintenance mode | esxcli system maintenanceMode set --enable=false |