VMware EXSi6.0 開啓Shell和SSH功能 Windows10安裝SecureCRT遠程控制解決VMware vSphere Client無法連接ESXi虛擬服務器主機

思路:

1、檢查管理員pc到EXSi6.0服務器之間IP通訊是否正常,端口是否佔用。

2、判斷EXSi版本(確認是半虛擬化還是全虛擬化)

3、確保EXSi是否開啓了Shell和SSH支持,選擇CLI管理EXSi服務器

4、配置管理員pc的SecureCRT連接EXSi

5、重啓服務

6、嘗試通過vsphere client連接

 

 

1、檢查網絡EXSi 服務器IP:10.199.118.33,然後檢查端口443和端口22

 

       IP正常、端口不通。

2、遠程不行就本地,去測試機房找到服務器

一看大哥就沒配置hostname 下載和管理職能通過IPV4和IPV6的地址 

登錄,按F2,底部有提示,輸入賬號root和密碼

 

回車後Enabled,再回車就Disable了,回車是個好東西,切換狀態

SSH功能也要開,一樣的操作。

配置IPV4、DNS、Hostname都在這裏了

國際慣例,重啓生效,不過不是服務器重啓,是管理網絡重啓,這個很人性化。

嘗試使用SecureCRT通過SSH連接EXSi6.0全虛擬化服務器10.199.118.33:22

 

重啓services.sh可解決

鋪墊了這麼多,耐心也消耗完了,終於可以做事了,我把所有代碼展示出來,不做任何刪減

services.sh restart

[root@exsi6:~] services.sh restart
services.sh: stop /etc/init.d/vmtoolsd
Running vmtoolsd stop
vmtoolsd is not running
Errors: 
Sysinfo error on operation returned status : Not found. Please see the VMkernel log for detailed error information
services.sh: stopped /etc/init.d/vmtoolsd
services.sh: stop /etc/init.d/vmsyslogd
Running vmsyslogd stop
Stopping vmsyslogd service using init is not supported
services.sh: stopped /etc/init.d/vmsyslogd
services.sh: stop /etc/init.d/xorg
Running xorg stop
services.sh: stopped /etc/init.d/xorg
services.sh: stop /etc/init.d/snmpd
Running snmpd stop
root: snmpd is not running.
services.sh: stopped /etc/init.d/snmpd
services.sh: stop /etc/init.d/sfcbd
Running sfcbd stop
This operation is not supported.
Please use /etc/init.d/sfcbd-watchdog stop
services.sh: stopped /etc/init.d/sfcbd
services.sh: stop /etc/init.d/wsman
Running wsman stop
Stopping openwsmand
services.sh: stopped /etc/init.d/wsman
services.sh: stop /etc/init.d/sfcbd-watchdog
Running sfcbd-watchdog stop
Getting Exclusive access, please wait...
Exclusive access granted.

services.sh: stopped /etc/init.d/sfcbd-watchdog
services.sh: stop /etc/init.d/vpxa
Running vpxa stop
watchdog-vpxa: Terminating watchdog process with PID 2479306
vpxa stopped.
services.sh: stopped /etc/init.d/vpxa
services.sh: stop /etc/init.d/vobd
Running vobd stop
watchdog-vobd: Terminating watchdog process with PID 2478863
vobd stopped
services.sh: stopped /etc/init.d/vobd
services.sh: stop /etc/init.d/lacp
Running lacp stop
watchdog-net-lacp: Terminating watchdog process with PID 2478794
services.sh: stopped /etc/init.d/lacp
services.sh: stop /etc/init.d/memscrubd
Running memscrubd stop
memscrubd is not running
services.sh: stopped /etc/init.d/memscrubd
services.sh: stop /etc/init.d/nscd
Running nscd stop
watchdog-nscd: Terminating watchdog process with PID 2478785
services.sh: stopped /etc/init.d/nscd
services.sh: stop /etc/init.d/dcbd
Running dcbd stop
watchdog-dcbd: Terminating watchdog process with PID 2478740
services.sh: stopped /etc/init.d/dcbd
services.sh: stop /etc/init.d/smartd
Running smartd stop
watchdog-smartd: Terminating watchdog process with PID 2478773
smartd stopped
services.sh: stopped /etc/init.d/smartd
services.sh: stop /etc/init.d/cdp
Running cdp stop
watchdog-cdp: Terminating watchdog process with PID 2478769
services.sh: stopped /etc/init.d/cdp
services.sh: stop /etc/init.d/slpd
Running slpd stop
Stopping slpd
services.sh: stopped /etc/init.d/slpd
services.sh: stop /etc/init.d/rabbitmqproxy
Running rabbitmqproxy stop
rabbitmqproxy is not running
services.sh: stopped /etc/init.d/rabbitmqproxy
services.sh: stop /etc/init.d/lbtd
Running lbtd stop
watchdog-net-lbt: Terminating watchdog process with PID 2478249
net-lbt stopped
services.sh: stopped /etc/init.d/lbtd
services.sh: stop /etc/init.d/sdrsInjector
Running sdrsInjector stop
watchdog-sdrsInjector: Terminating watchdog process with PID 2478229
sdrsInjector stopped
services.sh: stopped /etc/init.d/sdrsInjector
services.sh: stop /etc/init.d/vvold
Running vvold stop
/etc/init.d/vvold stop, called by pid 2485409
vvold is not running.
services.sh: stopped /etc/init.d/vvold
services.sh: stop /etc/init.d/rhttpproxy
Running rhttpproxy stop
watchdog-rhttpproxy: Terminating watchdog process with PID 2478340
VMware HTTP reverse proxy stopped.
services.sh: stopped /etc/init.d/rhttpproxy
services.sh: stop /etc/init.d/storageRM
Running storageRM stop
watchdog-storageRM: Terminating watchdog process with PID 2478244
storageRM stopped
services.sh: stopped /etc/init.d/storageRM
services.sh: stop /etc/init.d/nfcd
Running nfcd stop
nfcd is not running
services.sh: stopped /etc/init.d/nfcd
services.sh: stop /etc/init.d/hostd
Running hostd stop
watchdog-hostd: Terminating watchdog process with PID 2478574
hostd stopped.
services.sh: stopped /etc/init.d/hostd
services.sh: stop /etc/init.d/vmfstraced
Running vmfstraced stop
watchdog-vmfstracegd: PID file /var/run/vmware/watchdog-vmfstracegd.PID does not exist
watchdog-vmfstracegd: Unable to terminate watchdog: No running watchdog process for vmfstracegd
vmfstracegd is not running
Failed to clear vmfstracegd memory reservation
services.sh: stopped /etc/init.d/vmfstraced
services.sh: stop /etc/init.d/sensord
Running sensord stop
sensord is not running
services.sh: stopped /etc/init.d/sensord
services.sh: stop /etc/init.d/usbarbitrator
Running usbarbitrator stop
watchdog-usbarbitrator: Terminating watchdog process with PID 2478106
usbarbitrator stopped
services.sh: stopped /etc/init.d/usbarbitrator
services.sh: stop /etc/init.d/swapobjd
Running swapobjd stop
watchdog-swapobjd: Terminating watchdog process with PID 2478073
Waiting for process to terminate...
swapobjd stopped
services.sh: stopped /etc/init.d/swapobjd
services.sh: stop /etc/init.d/SSH
Running SSH stop
SSH login disabled
VobUserLib_Init failed with -1
Connect to localhost failed: Connection failure.
Errors: 
Invalid operation requested: This ruleset is required and connot be disabled
services.sh: stopped /etc/init.d/SSH
services.sh: stop /etc/init.d/ESXShell
Running ESXShell stop
ESXi shell login disabled
VobUserLib_Init failed with -1
services.sh: stopped /etc/init.d/ESXShell
services.sh: stop /etc/init.d/DCUI
Running DCUI stop
Disabling DCUI logins
VobUserLib_Init failed with -1
services.sh: stopped /etc/init.d/DCUI
services.sh: stop /etc/init.d/vsantraced
Running vsantraced stop
watchdog-vsantraced: PID file /var/run/vmware/watchdog-vsantraced.PID does not exist
watchdog-vsantraced: Unable to terminate watchdog: No running watchdog process for vsantraced
vsantraced is not running
watchdog-vsantracedUrgen: PID file /var/run/vmware/watchdog-vsantracedUrgen.PID does not exist
watchdog-vsantracedUrgen: Unable to terminate watchdog: No running watchdog process for vsantracedUrgen
vsantracedUrgen is not running
Persisting traces to /scratch/vsantraces
cp: can't stat '/var/log/vsantraces/*.index': No such file or directory
ls: /var/log/vsantraces/*.gz: No such file or directory
Failed to clear vsantraced memory reservation
services.sh: stopped /etc/init.d/vsantraced
services.sh: start /etc/init.d/vsantraced
Running vsantraced start
VSAN Cluster not configured, not starting vsantraced
services.sh: started /etc/init.d/vsantraced
services.sh: start /etc/init.d/DCUI
services.sh: start /etc/init.d/ESXShell
services.sh: start /etc/init.d/SSH
Running DCUI start
Running ESXShell start
Running SSH start
Enabling DCUI login: runlevel = 
ESXi shell login enabled
VobUserLib_Init failed with -1
VobUserLib_Init failed with -1
services.sh: started /etc/init.d/DCUI
services.sh: started /etc/init.d/ESXShell
Connect to localhost failed: Connection failure.
SSH login enabled
VobUserLib_Init failed with -1
services.sh: started /etc/init.d/SSH
services.sh: start /etc/init.d/swapobjd
services.sh: start /etc/init.d/usbarbitrator
Running usbarbitrator start
Running swapobjd start
swapobjd started
services.sh: started /etc/init.d/swapobjd
usbarbitrator started
services.sh: started /etc/init.d/usbarbitrator
services.sh: start /etc/init.d/sensord
services.sh: start /etc/init.d/vmfstraced
services.sh: start /etc/init.d/hostd
services.sh: start /etc/init.d/nfcd
services.sh: start /etc/init.d/storageRM
services.sh: start /etc/init.d/rhttpproxy
services.sh: start /etc/init.d/vvold
services.sh: start /etc/init.d/sdrsInjector
services.sh: start /etc/init.d/lbtd
services.sh: start /etc/init.d/rabbitmqproxy
Running vmfstraced start
Running nfcd start
Running sensord start
Running hostd start
Running storageRM start
Running rhttpproxy start
Running rabbitmqproxy start
Running sdrsInjector start
Running lbtd start
Running vvold start
/etc/init.d/vvold start, called by pid 2485991
VMFS Global Tracing is not enabled.
services.sh: started /etc/init.d/vmfstraced
nfcd started
sdrsInjector started
net-lbt started
services.sh: started /etc/init.d/nfcd
sensord started
services.sh: started /etc/init.d/sdrsInjector
services.sh: started /etc/init.d/lbtd
services.sh: started /etc/init.d/sensord
storageRM started
services.sh: started /etc/init.d/storageRM
vvold max reserve memory set to 200
VMware HTTP reverse proxy started.
services.sh: started /etc/init.d/rhttpproxy
Ramdisk 'hostd' with estimated size of 1053MB already exists
rabbitmqproxy not up, probably not unconfigured yet.
hostd started.
services.sh: started /etc/init.d/hostd
services.sh: started /etc/init.d/rabbitmqproxy
WaitVvoldToComeUp /var/run/vmware/.vmware-vvol.started created
vvold stopped after start!
/var/run/vmware/.vmware-vvol.started is not created
Successfully cleared vvold memory reservation
services.sh: started /etc/init.d/vvold
services.sh: start /etc/init.d/slpd
Running slpd start
Starting slpd
services.sh: started /etc/init.d/slpd
services.sh: start /etc/init.d/cdp
services.sh: start /etc/init.d/smartd
services.sh: start /etc/init.d/dcbd
services.sh: start /etc/init.d/nscd
services.sh: start /etc/init.d/memscrubd
services.sh: start /etc/init.d/lacp
Running cdp start
Running smartd start
Running dcbd start
Running nscd start
Running memscrubd start
Running lacp start
The checkPages boot option is FALSE, hence memscrubd could not be started.
services.sh: started /etc/init.d/memscrubd
smartd started
services.sh: started /etc/init.d/smartd
nscd started
services.sh: started /etc/init.d/nscd
LACP daemon started
cdp started
dcbd started
services.sh: started /etc/init.d/lacp
services.sh: started /etc/init.d/cdp
services.sh: started /etc/init.d/dcbd
services.sh: start /etc/init.d/vobd
Running vobd start
vobd started
services.sh: started /etc/init.d/vobd
services.sh: start /etc/init.d/vpxa
Running vpxa start
services.sh: started /etc/init.d/vpxa
services.sh: start /etc/init.d/sfcbd-watchdog
Running sfcbd-watchdog start
Getting Exclusive access, please wait...
Exclusive access granted.
services.sh: started /etc/init.d/sfcbd-watchdog
services.sh: start /etc/init.d/wsman
services.sh: start /etc/init.d/sfcbd
services.sh: start /etc/init.d/snmpd
Running snmpd start
Running sfcbd start
Running wsman start
Starting openwsmand
This operation is not supported.
Please use /etc/init.d/sfcbd-watchdog start
services.sh: started /etc/init.d/sfcbd
services.sh: started /etc/init.d/wsman
root: snmpd has not been enabled.
services.sh: started /etc/init.d/snmpd
services.sh: start /etc/init.d/xorg
services.sh: start /etc/init.d/vmsyslogd
services.sh: start /etc/init.d/vmtoolsd
Running vmsyslogd start
Running xorg start
Running vmtoolsd start
vmsyslogd is running.
services.sh: started /etc/init.d/vmsyslogd
services.sh: started /etc/init.d/vmtoolsd
services.sh: started /etc/init.d/xorg

嘗試使用VMware vSphere Client連接EXSi6.0進行管理

配套一張大寫加粗的截圖!!! 

 

全過程沒有斷電,沒有重啓任何服務器,沒有影響業務,棒棒的~!

 

唯有有一個地方不理解,這個配置是上午配置的,下午443和22端口纔可以被使用,期間什麼也沒做,一切操作正常,但是就是要等到下午才能連接,也許是我吃飽了飯,運氣也變好了,本來想要重啓整臺服務器的,所有的虛機全部需要非正常關機。這個操作對於我來說太low了,所以拖延到下午才操作,正在鬱悶一切都操、配置作正常沒有問題,只能寄希望於重啓之際,我又嘗試SSH連接,居然成功了,重啓服務,使用vsphere 連接也成功了。

 

以下內容我本地沒有遇到,作爲拓展閱讀吧:(辛虧還有那麼一點點的耐心


2 若重啓services.sh報錯且仍然無法連接
watchdog-hostd:PID file /var/run/vmware/watchdog-hostd.PID not found
watchdog-hostd:Unable to terminate watchdog:Can't find process
/etc/init.d/hostd:kill:48:(84046924)-No such process
這個報錯是由於啓動/關閉hostd服務器引起的。說明hostd進程沒kill到。(原因運行一下/etc/init.d/hostd start or stop就知道)
ps | grep hostd 你會看到

說明有hostd進程
那運行/etc/init.d/hostd  stop
再運行
ps | grep hostd 
123456233  789789789  hostd
456123358  789789789  hostd
12334562    789789789  hostd
123458985  789789789  hostd
........

說明hostd根本沒有kill到
於是手動kill,選擇任意一個子進程ID kill就可以
如:kill -9 123458985

然後再運行ps | grep hostd ,發現已經沒有輸入,說明hostd已經kill掉。
於是再運行/etc/init.d/hostd start 就可以。
 

 

安裝EXSi教程,別人已經做的很好了:

https://jingyan.baidu.com/article/925f8cb8f35a25c0dde056f6.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章