esxi主机常用命令

 

 

  • esxi主机经常会因为 安全原因 ,需要设置防火墙

命令行操作:

 


esxcli network firewall ruleset allowedip list --ruleset-id=webAccess

esxcli network firewall ruleset allowedip add --ip-address=10.10.10.10  --ruleset-id=webAccess
esxcli network firewall ruleset allowedip add --ip-address=10.10.10.10  --ruleset-id=vSphereClient

  

  • 查看esxi主机中的虚拟机信息
 vim-cmd vmsvc/getallvms
 vim-cmd vmsvc --help 可以看到更多
 vim-cmd vmsvc/power.off
 vim-cmd vmsvc/power.on

  

  • 硬件监控不可用 
nagios报错
 wbemclient = pywbem.WBEMConnection(hosturl, (user,password), no_verification=True)
TypeError: __init__() got an unexpected keyword argument 'no_verification' 
属于它连接esxi出错了

检查esxi的 watchdog服务
/etc/init.d] ./sfcbd-watchdog status
尝试启动失败

sfcbd-init: Getting Exclusive access, please wait...
sfcbd-init: Exclusive access granted.
sfcbd-init: Request to restart sfcbd-watchdog, pid 3807730
sfcbd-init: restart request in disabled state, safely ignored.

修改设置:
esxcli system wbem get
esxcli system wbem set -e 1
esxcli system wbem get
再启动watchdog

再检测就ok了

  

 

  • 主机系统升级
esxcli software vib install -d  "/vmfs/volumes/HW_IBM4/ESXi650-202207001.zip" --no-sig-check
esxcli software vib install -d  "/vmfs/volumes/HW_IBM4/ESXi600-202002001.zip" --no-sig-check

  

 
 
posted @ 2024-03-04 17:06  Mloading  阅读(342)  评论(0)    收藏  举报