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

 

 

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s