Wednesday, August 20, 2014

ESXi Shell

tail to look at the end of a file

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

cat to read logs

examples

cat /var/log/hostd.log
cat /var/log/hostd.log | grep -i 2014-08-20 (use grep to locate a specific word or time stamp. the -i ignores case)

services.sh restart to restart host services

chkconfig -l to show daemons running on hypervisor. can also be used for configuration.

esxtop same as linux top for vmware

vmkerrcode -l to list vmkernel errors

dcui to provide console screen to ssh session

vsish vmware interactive shell

ipkg list_installed to list installed packages (ESXi 4.1)

esxcli software vib list to list installed packages (ESXi 5.0)

esxcfg-info to list information about the host

esxcfg-nics to get nic options (-l to list nics and their configs)

esxcfg-vswitch -l to list information about virtual switching. can also be used for configuration.

esxcli network nic list to accomplish the same as esxcfg-nics -l

vim-cmd vimsvc/license --show to show license information

vim-cmd vmsvc/getallvms to list all running vms and vmid

vim-cmd vmsvc/power.off vmid to power off vmid referenced from getallvms command

vim-cmd vmsvc/power.on vmid to power on vmid referenced from getallvms command

vim-cmd vmsvc/power.reboot vmid to reboot vmid referenced from getallvms command

vim-cmd vmsvc/destroy vmid to delete the vmdk and vmx files from disk

vim-cmd hostsvc/maintenance_mode_enter to put hypervisor into maintenance mode

vim-cmd hostsvc/maintenance_mode_exit to take hypervisor out of maintenance mode

vim-cmd hostsvc/hostsummary | grep inMaintenanceMode to check the state of maintenance mode on the host

vim-cmd solo/registervm /vmfs/vol/datastore/dir/vm.vmx to register vm in hypervisor inventory

vim-cmd vmsvc/unregister vmid to unregister vm with hypervisor

vim-cmd vmsvc/tools.install vmid to start vmware tools installation for VM

vim-cmd hostsvc/net/info to provide information about hypervisor networking