#Logs
https://gbsmcvesx1/host
vm-support -w /vmfs/volumes/<datastorename>
cd /var/log/
less /var/log/vmkwarning.log
tail -5 hostd.log
cat vpxa.log | grep STATUS
cat hostd.log | grep failed | more
/var/log/vmware/esxcfg-firewall.log
tail -f /var/log/messages
#Services
services.sh restart
service mgmt-vmware restart .restarts 'hostd' [ESX only]
service vmware-vpxa restart .restarts 'vpxa' [ESX only]
ps .lists running processes
ps | grep vpxa
ps -g |grep vukdr2-029
kill -9 15962848
#Files
ls | grep hosts .displays files that contain the name 'hosts'
ls | more
ls *vicfg*
find ./ -print | grep esxcfg-firewall .find command location
#Network
esxcfg-nics -l
esxcfg-vswitch -l
esxcli network nic list
vicfg-nics --server 192.168.0.2 -l
esxcli network nic down -n vmnic0
esxcli network nic up -n vmnic0
esxcli network nic up -n vmnic0
esxcli network nic get -n vmnic0
esxcfg-vswitch -U vmnic0 vSwitch0 .removes the vmnic
esxcfg-vswitch -L vmnic0 vSwitch0 .adds the vmnic
esxcfg-vswitch -Q vmnic1 -V 253 dvSwitch0 .remove from dvSwitch
esxcfg-vswitch -P vmnic1 -V 253 dvSwitch0 .adds to dvSwitch
#Information
esxcfg-info -h
esxcfg-info -n > networking.txt .dumps to the file
nano networking.txt
esxcli system version get
vicfg-hostops -o info
vim-cmd hostsvc/hostsummary
/etc/vmware/esx.conf .information overload!
#Modules/Drivers
esxcfg-module -l
esxcfg-module -i xsvhba .retrive info about xsvhba
cat /proc/driver/xscore/info
cat /proc/driver/xscore/xcpm/ports/23... .more details
#Storage
esxcfg-nas
esxcfg-mpath -l
esxcfg-rescan
esxcfg-scsidevs -a
esxcfg-scsidevs -m .friendly volume names
esxcfg-swiscsi
esxcfg-volume
vmkiscsi-tool
esxcli nmp psp list
esxcli nmp satp list
esxcli nmp path list | more
esxcli nmp device list
#Datastores
esxcli storage filesystem list .lists sizes/free space
vicfg-scsidevs -m .lists datastores
vicfg-scsidevs -l .detailed datastore info
#List VMs
vim-cmd vmsvc/getallvms | grep vukdr2-029
esxcli vm process list .lists running VMs
vmware-cmd -l
vm-support -V
esxcli vm process list | grep vuk51-004
esxcli vm process kill --type=soft --world-id=16444663 .kill vm
#Get VM state
vim-cmd vmsvc/power.getstate 34
vmware-cmd /vmfs/volumes/5045.../CENTOS-01/CENTOS-01.vmx getstate
#Kill VMs
vim-cmd vmsvc/power.<shutdown|off> 34 .vmid=34
esxcli vm process kill -t soft|hard|force -w 3581 .worldID=3581
vmware-cmd /vmfs/volumes/../../testvm.vmx stop <soft|hard>
#Start VMs
vim-cmd vmsvc/power.on 34
vmware-cmd /vmfs/volumes/../../testvm.vmx start
#VM Operations
vmware-cmd /vmfs/volumes/storage1/../myvm.vmx hassnapshot
vmware-cmd /vmfs/volumes/storage1/../myvm.vmx createsnapshot SNAP1 'Test description' 0 0
vmware-cmd /vmfs/volumes/storage1/../myvm.vmx revertsnapshot
vmware-cmd /vmfs/volumes/storage1/../myvm.vmx removesnapshots
vmware-cmd /vmfs/volumes/storage1/../myvm.vmx gettoolslastactive
vmware-cmd /vmfs/volumes/storage1/../myvm.vmx connectdevice "CD/DVD drive 1"
vmware-cmd -s unregister /vmfs/volumes/storage1/./myvm.vmx
vmware-cmd -s register /vmfs/volumes/storage1/./myvm.vmx
vim-cmd solo /registervm /vmfs/volumes/../gbmacvct.vmx
#Host Power
esxcli system shutdown poweroff -r <reason>
vicfg-hostops -o shutdown -f
vicfg-hostops -o reboot
#Host Maintenance Mode
esxcli system maintenanceMode get
vicfg-hostops -o enter .sets maintenance mode
esxcli system maintenanceMode set -e 1
vim-cmd hostsvc/maintenance_mode_enter
vim-cmd hostsvc/maintenance_mode_exit
vicfg-hostops -o exit
#Host Backups
vicfg-cfgbackups -s /tmp/gbmacesx01_63863.txt .saves host config
vicfg-cfgbackups -l /tmp/gbmacesx01_63863.txt .loads host config
vicfg-cfgbackup -r .resets host to default
#Host AD
vicfg-authconfig --authscheme AD -j abc.com .join host to domain
vicfg-authconfig --authscheme AD -L .remove from domain
vicfg-authconfig --authscheme AD --currentdomain .lists domain
#NTP
vicfg-ntp -l
vicfg-ntp -a 192.168.0.55 .add an NTP server
vicfg-ntp -r .start NTP service
vicfg-ntp -s .stop NTP service
vicfg-ntp -d 192.168.0.55 .deletes NTP server
#VMA
sudo domainjoin-cli join zialabs.net <username>
#Troubleshooting
grep -i MONITOR vmware.log
find ./ -print | grep <searchstring>