Advertisement
seiburii

ESXCLI Commands

May 14th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.58 KB | None | 0 0
  1. #########
  2. esxcli storage core adapter list | awk '{print $2}' | awk 'NR>2' | uniq | xargs -t -n 1 esxcli system module get -m | grep VIB: | sed 's;.*: ;;g' | uniq | xargs -t -n 1 esxcli software vib get -n
  3.  
  4. esxcli storage core adapter list | \
  5. awk '{print $2}' | \
  6. awk 'NR>2' | \
  7. xargs -t -n 1 esxcli system module get -m | \
  8. grep VIB: | \
  9. sed 's;.*: ;;g' | \
  10. xargs -t -n 1 esxcli software vib get -n
  11. ---------
  12. esxcli storage core adapter list | tee /tmp/trial.txt | awk '{print $2}' | awk 'NR>2' | xargs -t -n 1 esxcli system module get -m | grep VIB: | uniq | sed 's;.*: ;;g' | xargs -t -n 1 esxcli software vib get -n | tee -a /tmp/trial.txt
  13.  
  14. esxcli storage core adapter list | \
  15. tee /tmp/trial.txt | \
  16. awk '{print $2}' | \
  17. awk 'NR>2' | \
  18. xargs -t -n 1 esxcli system module get -m | \
  19. grep VIB: | \
  20. uniq | sed 's;.*: ;;g' | \
  21. xargs -t -n 1 esxcli software vib get -n | \
  22. tee -a /tmp/trial.txt
  23.  
  24.  
  25. ######### Networking drivers and devices
  26. esxcli network nic list | tee /tmp/trial.txt | awk '{print $1}' | awk 'NR>2' | xargs -t -n 1 esxcli network nic get -n | grep 'Driver:' | uniq | sed 's;.*: ;;g' | xargs -t -n 1 esxcli software vib get -n | tee -a /tmp/trial.txt
  27.  
  28. esxcli network nic list | \
  29. tee /tmp/trial.txt | \
  30. awk '{print $1}' | awk 'NR>2' | \
  31. xargs -t -n 1 esxcli network nic get -n | \
  32. grep 'Driver:' | \
  33. uniq | sed 's;.*: ;;g' | \
  34. xargs -t -n 1 esxcli software vib get -n | \
  35. tee -a /tmp/trial.txt
  36.  
  37.  
  38. ### AutoMount temporary VMFS
  39. esxcli storage vmfs snapshot list | grep -B1 'Can mount: true' | grep 'UUID' | sed -e 's;.*: ;;g' | xargs -t -n 1 esxcfg-volume -m
  40.  
  41. esxcli storage vmfs snapshot list | \
  42. grep -B1 'Can mount: true' | \
  43. grep 'UUID' | \
  44. sed -e 's;.*: ;;g' | \
  45. xargs -t -n 1 esxcfg-volume -m
  46.  
  47.  
  48.  
  49. #########
  50. esxcli storage vmfs snapshot list | awk '{print $2}' | awk 'NR>2' | uniq | xargs -t -n 1 esxcli system module get -m | grep VIB: | sed 's;.*: ;;g' | uniq | xargs -t -n 1 esxcli software vib get -n
  51.  
  52. #########
  53. [root@esxi:~] esxcli software profile update -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-6.7.0-20190404001-standard --dry-run
  54.  
  55. #########
  56. esxcfg-vswitch -l
  57. esxcfg-nics -l
  58.  
  59. #########
  60. ssacli ctrl all show | \
  61. sed -e 's;.*Slot ;;g' -e 's;   .*;;g' | \
  62. sed "/^$/d" | \
  63. while read line; do ssacli ctrl slot=$line show detail;ssacli ctrl slot=$line pd all show; ssacli ctrl slot=$line ld all show; \
  64. ssacli ctrl slot=$line pd all show | grep ":" | sed -e 's; (.*;;g' -e 's;.* ;;g' | while read pd; do ssacli ctrl slot=$line pd $pd show; done ; done
  65.  
  66. #########
  67. /etc/init.d/usbarbitrator
  68. esxcfg-volume --list
  69. esxcfg-volume --mount <VMFS UUID|label>
  70. esxcfg-volume -l | grep label | sed -e 's;.*/;;g' | xargs -t -n 1 'esxcfg-volume -m '
  71.  
  72.  
  73. #########
  74. vim-cmd vmsvc/getallvms | awk '{print $1}' | awk 'NR>1' | xargs -t -n 1 vim-cmd vmsvc/power.getstate
  75.  
  76.  
  77.  
  78. #########
  79. wget -P /vmfs/volumes/CZXXXXXXXX-ISO-Datastore/_ESXi_related/VIBs http://downloads.hpe.com/pub/softlib2/software1/pubsw-linux/p1268910445/v98768/scsi-hpvsa-5.5.0-88OEM.550.0.0.1331820.x86_64.vib
  80. esxcli software install -v /vmfs/volumes/CZXXXXXXXX-ISO-Datastore/_ESXi_related/VIBs/scsi-hpvsa-5.5.0-88OEM.550.0.0.1331820.x86_64.vib
  81.  
  82.  
  83. wget -P /vmfs/volumes/CZXXXXXXXX-ISO-Datastore/_ESXi_related/VIBs http://vibsdepot.hpe.com/hpe/apr2019/esxi-670-vibs/ssacli/ssacli-3.40.3.0-6.7.0.vib
  84. esxcli software install -v /vmfs/volumes/CZXXXXXXXX-ISO-Datastore/_ESXi_related/VIBs/ssacli-3.40.3.0-6.7.0.vib
  85.  
  86. wget http://hostupdate.vmware.com/software/VUM/PRODUCTION/main/esx/vmw/vib20/tools-light/VMware_locker_tools-light_10.3.5.10430147-12986307.vib
  87.  
  88. #########
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement