ESXi Stuff

Published 05-12-2018 18:35:54

Common Commands

Provide console screen to ssh session

dcui

Top

esxtop

VMware interactive shell

vsish

Logs

tail to look at the end of a file

tail /var/log/hostd.log
tail -f /var/log/hostd.log (-f to follow updates on screen)

cat to read logs

cat /var/log/hostd.log

grep to search for terms

tail /var/log/hostd.log | grep -i Power

List vmkernel errors

vmkerrcode -l

Host Management

List information about the host

esxcfg-info

Get NIC options

esxcfg-nics (Add -l to list NICs and their configs)

List information about virtual switching. can also be used for configuration.

esxcfg-vswitch -l

Accomplish the same as esxcfg-nics -l

esxcli network nic list

Show license information

vim-cmd vimsvc/license --show

Provide information about hypervisor networking

vim-cmd hostsvc/net/info

Set a time server to sync with

yast2 ntp-client add server=<your_chosen_time_server>
yast2 ntp-client enable

Request immediate sync with the time server

sntp -P no -r <your_chosen_time_server>

Packages & Services

List installed packages (ESXi 4.1)

ipkg list_installed

List installed packages (ESXi 5.0)

esxcli software vib list

Restart host services

services.sh restart

Show daemons running on hypervisor, can also be used for configuration

chkconfig -l

VM Management

List all running vms and vmid

vim-cmd vmsvc/getallvms

Power off vmid referenced from getallvms command

vim-cmd vmsvc/power.off vmid

Power on vmid referenced from getallvms command

vim-cmd vmsvc/power.on vmid

Reboot vmid referenced from getallvms command

vim-cmd vmsvc/power.reboot vmid

Delete the vmdk and vmx files from disk

vim-cmd vmsvc/destroy vmid

Register vm in hypervisor inventory

vim-cmd solo/registervm /vmfs/vol/datastore/dir/vm.vmx

Unregister vm with hypervisor

vim-cmd vmsvc/unregister vmid

Start vmware tools installation for VM

vim-cmd vmsvc/tools.install vmid

Maintenance Mode

Put into maintenance mode

vim-cmd hostsvc/maintenance_mode_enter

Take out of maintenance mode

vim-cmd hostsvc/maintenance_mode_exit

Check the state of maintenance mode on the host

vim-cmd hostsvc/hostsummary | grep inMaintenanceMode