VMware Command Alphabet : A to Z

Hi,

I have tested below ESXi command line in my Lab and documented for my VMware friends. Hope you all like it and it would help you.

Important Tips: Before connect or do putty of ESXi, set the logging output to get all command history saved.

# auto-backup.sh [To take ESXi configuration backup, see the KB2043048]

# df [To get filesystem info]

# env [To see ESXi basic connection setings]

# ethtool -i vmnic0 [To see Network Card driver and firmware version]

# ethtool -S vmnic0 [To see Network TX & RX packet stats]

# ethtool -c vmnic0 [To see Network Coalesce parameters]

(Coalesce: Help tune network latency and performance, refer vSphere performance guide)

# esxcfg-info | grep -i xxxx [To see ESXi component detailed information]

# firmwareConfig.sh [To troubleshoot hardware firmware issue]

# fdisk -l [To see device list and partition table.

# hostd -v [To check ESXi Agent info and version]

# hostname [To know ESXi Name]

# hwclock [To get ESXi Date & Time]

# irqinfo [To see shared IRQ]

# kill  [To kill process]

# lspci [To check PCI hardware manufacture vendor info]

# lsof [To see locked file map with process]

# localcli [Similar to ESXCLi but can be used when hostd service not starting or for troubleshooting]

# memstats [To see memory stats because webclient does not show all information, see the KB2043413]

# net-cdp | net-dvs | net-lacp | net-lbt | net-stats [To use for network Troubleshooting and see the stats]

# pktcap-uw [To capture the packet, see the KB2051814]

# partedUtil [To manage, create anfd delete disk partition (VMFS), see the KB1036609]

# passwd [To reset ESXi password]

# ps [To get ESXi process list]

# sched-stats [To see ESXi vmkernel stats for each event]

# services.sh [To troubleshooting issue, start or restarting ESXi service will not impact running VM]

# tcpdump-uw [To capture TCP dump for network issue investigation]

[Thank you @ Viren – http://www.virten.net/2015/10/esxi-network-troubleshooting-with-tcpdump-uw-and-pktcap-uw/]

# uwstats {To see user world stats]

# vdf [To see VMFS space usages in detailed, see the KB1003564]

# vdu [VMware disk utility]

# vdq [VMware vSAN utility]

# vmkping [To ping IP and test MTU packet using -l switch]

# vmware -lv [To see VMware ESXi version and build]

# vmkchdev -l | grep vmnic0 [ VM kernel change device, see the KB1027206]

# vm-support [To generate VMware support bundle log “.tgz” that can shared with VMware support]

# voma -m vmfs -d /vmfs/devices/disks/xxxxx [vSphere On-disk Metadata Analyzer (VOMA), see the KB2036767]

# vmkfstools [To perform VMFS operation, see this http://pubs.vmware.com/esx254/admin/wwhelp/wwhimpl/common/html/wwhelp.htm?context=admin&file=esx25admin_disks.10.13.html]

Thank you

Advertisements

ESXCLi for VMWARE Administration

Hello Friend,

On your demand, I have listed down few useful ESXCli command and hoping it will help you to make your operation easy.

I would like to Thank you and recommend to read 

Automated Report of ESXi HW Driver&Firmware info

vDocumentation : Automate VMware Config documentation

If you face any difficulties to execute above script comment me below with your issue.

####ESXCLi Operation ################################
# Below statement I found very useful for VMware Administration#
######### ESXi Version Info #################################
vmware -vl

#Output: VMware ESXi 6.0.0 build-5224934
#VMware ESXi 6.0.0 Update 3

esxcli system version get

#[root@localhost:~] esxcli system version get
#Product: VMware ESXi
#Version: 6.0.0
#Build: Releasebuild-5224934
#Update: 3
#Patch: 58

####### Network Adapter Info ###############################
esxcli network nic list
ethtool -i vmnic0
esxcli network nic get -n vmnic0
vmkchdev -l | grep vmnic0
vmkchdev -l | grep vmnic5
esxcli network nic get -n vmnic5

####### HBA Adapter Info #################################
esxcfg-scsidevs -a # Choose your driver in my case Qlogic
vmkload_mod -s qlnativefc | grep -i version
vmkchdev -l | grep vmhba1
vmkload_mod -s mpt2sas | grep -i version
vmkchdev -l | grep vmhba0

########## ESXCLi system ############################################
esxcli system # To use for esxi operation and output give all option

#Show ESXi version and build
esxcli system version get

#Enter Maintenance Mode
esxcli system maintenanceMode set –-enable yes

#Exit maintenance Mode
esxcli system maintenanceMode set –enable no

#List only advanced settings that have been changed from the system defaults
esxcli system settings advanced list

#List only kernel settings that have been changed from the system defaults
esxcli system settings kernel list –d

#List / Change / Test SNMP
esxcli system snmp get # Use these switch “| hash | set | test”

############# ESXCLi VM ######################

#List VMs on the ESXi server with the World ID
esxcli vm process list

#Kill a VM
esxcli vm process kill –t soft -w WorldID

##########ESXCLi software####################################

Install updates and drivers on a ESXi host (make sure the ESXI host is MaintenanceMode)
esxcli software vib install -d /vmfs/volumes/VMFS01/patches/nameoftheupdate.zip #Install will replace old file/driver
esxcli software vib update -d /vmfs/volumes/VMFS01/patches/nameoftheupdate.zip #Update will keep and overwrite old file & driver safe to use.

##############ESXCLi network #################################

#List physical NICs and connection state
esxcli network nic list

#List network information for the VM
esxcli network vm list

#############ESXCLi storage ######################################

#List the devices currently controlled by the VMware NMP Multi path Plugin and show the SATP and PSP information associated with that device
esxcli storage nmp device list

#List VAAI properties for devices currently registered with the PSA.
esxcli storage core device vaai status get

#Change the default pathing policy to Round Robin and choose yout Storage Vendor
esxcli storage nmp satp set –default-psp VMW_PSP_RR –satp youre_satp_policy

Thank You

 

 

Lets meet at Delhi VMUG Event 23-Sep-17

Hello Friends,

Do register to your self for Delhi VMUG event, Announced date is Saturday, 23-Sep-2017.  It is first time in Delhi any event organized for local VMware user community.

So don’t missed it, You will have a chance to make new friends to expand your professional networking, you will learn about new technology such as NSX, vROPS & vRA and get free vSphere Tips & Tricks along with Career guidance.

Click here for Register yourself

If anyone failed to register or facing any issue. Please comment below this post.

Thanks to VMware VMUG Team @MyVMUG to design cool logo for Delhi_VMUG.

c678f0ba-bac4-4339-9879-5653d861ad02