使用 針對 BMM 問題進行疑難解答 az networkcloud baremetalmachine run-read-command
在某些情況下,使用者可能需要調查及解決內部部署 BMM 的問題。 操作員 Nexus 提供, az networkcloud baremetalmachine run-read-command
讓使用者可以執行只讀命令的策劃清單,以從 BMM 取得資訊。
命令執行會產生輸出檔案,其中包含可在叢集管理員 儲存體 帳戶中找到的結果。
必要條件
- 安裝最新版本的適當 CLI 擴充功能
- 確定目標 BMM 必須
poweredState
設定為On
,並將其readyState
設定為True
- 取得您為資源建立的
Cluster
資源組名
執行執行讀取命令
run-read 命令可讓您在 BMM 上執行不會變更任何項目的命令。 某些命令有多個單字,或需要自變數才能運作。 這些命令會像這樣,將它們與可以變更事物的命令區隔開來。 例如,run-read-command 可以使用,但不能kubectl apply
使用 kubectl get
。 當您使用這些命令時,您必須將所有字放在 「command」 欄位中。 例如, {"command":"kubectl get","arguments":["nodes"]}
是對的; {"command":"kubectl","arguments":["get","nodes"]}
是錯誤的。
另請注意,某些命令的開頭 nc-toolbox nc-toolbox-runread
是 ,必須輸入 ,如下所示。
nc-toolbox-runread
是特殊的容器映像,其中包含更多未安裝在裸機主機上的工具,例如 ipmitool
和 racadm
。
某些執行讀取命令需要提供特定的自變數,以強制執行命令的唯讀功能。
需要特定自變數的 Run-read 命令範例是允許的 Mellanox 命令 mstconfig
,因此 query
需要提供 自變數以強制執行只讀。
下列清單顯示您可以使用的命令。 中的 *italics*
命令不能有 arguments
;其餘命令可以。
arp
brctl show
dmidecode
fdisk -l
host
hostname
ifconfig -a
ifconfig -s
ip address show
ip link show
ip maddress show
ip route show
journalctl
kubectl api-resources
kubectl api-versions
kubectl describe
kubectl get
kubectl logs
mount
ping
ss
tcpdump
traceroute
uname
ulimit -a
uptime
nc-toolbox nc-toolbox-runread ipmitool channel authcap
nc-toolbox nc-toolbox-runread ipmitool channel info
nc-toolbox nc-toolbox-runread ipmitool chassis status
nc-toolbox nc-toolbox-runread ipmitool chassis power status
nc-toolbox nc-toolbox-runread ipmitool chassis restart cause
nc-toolbox nc-toolbox-runread ipmitool chassis poh
nc-toolbox nc-toolbox-runread ipmitool dcmi power get_limit
nc-toolbox nc-toolbox-runread ipmitool dcmi sensors
nc-toolbox nc-toolbox-runread ipmitool dcmi asset_tag
nc-toolbox nc-toolbox-runread ipmitool dcmi get_mc_id_string
nc-toolbox nc-toolbox-runread ipmitool dcmi thermalpolicy get
nc-toolbox nc-toolbox-runread ipmitool dcmi get_temp_reading
nc-toolbox nc-toolbox-runread ipmitool dcmi get_conf_param
nc-toolbox nc-toolbox-runread ipmitool delloem lcd info
nc-toolbox nc-toolbox-runread ipmitool delloem lcd status
nc-toolbox nc-toolbox-runread ipmitool delloem mac list
nc-toolbox nc-toolbox-runread ipmitool delloem mac get
nc-toolbox nc-toolbox-runread ipmitool delloem lan get
nc-toolbox nc-toolbox-runread ipmitool delloem powermonitor powerconsumption
nc-toolbox nc-toolbox-runread ipmitool delloem powermonitor powerconsumptionhistory
nc-toolbox nc-toolbox-runread ipmitool delloem powermonitor getpowerbudget
nc-toolbox nc-toolbox-runread ipmitool delloem vflash info card
nc-toolbox nc-toolbox-runread ipmitool echo
nc-toolbox nc-toolbox-runread ipmitool ekanalyzer print
nc-toolbox nc-toolbox-runread ipmitool ekanalyzer summary
nc-toolbox nc-toolbox-runread ipmitool fru print
nc-toolbox nc-toolbox-runread ipmitool fwum info
nc-toolbox nc-toolbox-runread ipmitool fwum status
nc-toolbox nc-toolbox-runread ipmitool fwum tracelog
nc-toolbox nc-toolbox-runread ipmitool gendev list
nc-toolbox nc-toolbox-runread ipmitool hpm rollbackstatus
nc-toolbox nc-toolbox-runread ipmitool hpm selftestresult
nc-toolbox nc-toolbox-runread ipmitool ime help
nc-toolbox nc-toolbox-runread ipmitool ime info
nc-toolbox nc-toolbox-runread ipmitool isol info
nc-toolbox nc-toolbox-runread ipmitool lan print
nc-toolbox nc-toolbox-runread ipmitool lan alert print
nc-toolbox nc-toolbox-runread ipmitool lan stats get
nc-toolbox nc-toolbox-runread ipmitool mc bootparam get
nc-toolbox nc-toolbox-runread ipmitool mc chassis poh
nc-toolbox nc-toolbox-runread ipmitool mc chassis policy list
nc-toolbox nc-toolbox-runread ipmitool mc chassis power status
nc-toolbox nc-toolbox-runread ipmitool mc chassis status
nc-toolbox nc-toolbox-runread ipmitool mc getenables
nc-toolbox nc-toolbox-runread ipmitool mc getsysinfo
nc-toolbox nc-toolbox-runread ipmitool mc guid
nc-toolbox nc-toolbox-runread ipmitool mc info
nc-toolbox nc-toolbox-runread ipmitool mc restart cause
nc-toolbox nc-toolbox-runread ipmitool mc watchdog get
nc-toolbox nc-toolbox-runread ipmitool bmc bootparam get
nc-toolbox nc-toolbox-runread ipmitool bmc chassis poh
nc-toolbox nc-toolbox-runread ipmitool bmc chassis policy list
nc-toolbox nc-toolbox-runread ipmitool bmc chassis power status
nc-toolbox nc-toolbox-runread ipmitool bmc chassis status
nc-toolbox nc-toolbox-runread ipmitool bmc getenables
nc-toolbox nc-toolbox-runread ipmitool bmc getsysinfo
nc-toolbox nc-toolbox-runread ipmitool bmc guid
nc-toolbox nc-toolbox-runread ipmitool bmc info
nc-toolbox nc-toolbox-runread ipmitool bmc restart cause
nc-toolbox nc-toolbox-runread ipmitool bmc watchdog get
nc-toolbox nc-toolbox-runread ipmitool nm alert get
nc-toolbox nc-toolbox-runread ipmitool nm capability
nc-toolbox nc-toolbox-runread ipmitool nm discover
nc-toolbox nc-toolbox-runread ipmitool nm policy get policy_id
nc-toolbox nc-toolbox-runread ipmitool nm policy limiting
nc-toolbox nc-toolbox-runread ipmitool nm statistics
nc-toolbox nc-toolbox-runread ipmitool nm suspend get
nc-toolbox nc-toolbox-runread ipmitool nm threshold get
nc-toolbox nc-toolbox-runread ipmitool pef
nc-toolbox nc-toolbox-runread ipmitool picmg addrinfo
nc-toolbox nc-toolbox-runread ipmitool picmg policy get
nc-toolbox nc-toolbox-runread ipmitool power status
nc-toolbox nc-toolbox-runread ipmitool sdr elist
nc-toolbox nc-toolbox-runread ipmitool sdr get
nc-toolbox nc-toolbox-runread ipmitool sdr info
nc-toolbox nc-toolbox-runread ipmitool sdr list
nc-toolbox nc-toolbox-runread ipmitool sdr type
nc-toolbox nc-toolbox-runread ipmitool sel elist
nc-toolbox nc-toolbox-runread ipmitool sel get
nc-toolbox nc-toolbox-runread ipmitool sel info
nc-toolbox nc-toolbox-runread ipmitool sel list
nc-toolbox nc-toolbox-runread ipmitool sel time get
nc-toolbox nc-toolbox-runread ipmitool sensor get
nc-toolbox nc-toolbox-runread ipmitool sensor list
nc-toolbox nc-toolbox-runread ipmitool session info
nc-toolbox nc-toolbox-runread ipmitool sol info
nc-toolbox nc-toolbox-runread ipmitool sol payload status
nc-toolbox nc-toolbox-runread ipmitool user list
nc-toolbox nc-toolbox-runread ipmitool user summary
nc-toolbox nc-toolbox-runread racadm arp
nc-toolbox nc-toolbox-runread racadm coredump
nc-toolbox nc-toolbox-runread racadm diagnostics
nc-toolbox nc-toolbox-runread racadm eventfilters get
nc-toolbox nc-toolbox-runread racadm fcstatistics
nc-toolbox nc-toolbox-runread racadm get
nc-toolbox nc-toolbox-runread racadm getconfig
nc-toolbox nc-toolbox-runread racadm gethostnetworkinterfaces
nc-toolbox nc-toolbox-runread racadm getled
nc-toolbox nc-toolbox-runread racadm getniccfg
nc-toolbox nc-toolbox-runread racadm getraclog
nc-toolbox nc-toolbox-runread racadm getractime
nc-toolbox nc-toolbox-runread racadm getsel
nc-toolbox nc-toolbox-runread racadm getsensorinfo
nc-toolbox nc-toolbox-runread racadm getssninfo
nc-toolbox nc-toolbox-runread racadm getsvctag
nc-toolbox nc-toolbox-runread racadm getsysinfo
nc-toolbox nc-toolbox-runread racadm gettracelog
nc-toolbox nc-toolbox-runread racadm getversion
nc-toolbox nc-toolbox-runread racadm hwinventory
nc-toolbox nc-toolbox-runread racadm ifconfig
nc-toolbox nc-toolbox-runread racadm inlettemphistory get
nc-toolbox nc-toolbox-runread racadm jobqueue view
nc-toolbox nc-toolbox-runread racadm lclog view
nc-toolbox nc-toolbox-runread racadm lclog viewconfigresult
nc-toolbox nc-toolbox-runread racadm license view
nc-toolbox nc-toolbox-runread racadm netstat
nc-toolbox nc-toolbox-runread racadm nicstatistics
nc-toolbox nc-toolbox-runread racadm ping
nc-toolbox nc-toolbox-runread racadm ping6
nc-toolbox nc-toolbox-runread racadm racdump
nc-toolbox nc-toolbox-runread racadm sslcertview
nc-toolbox nc-toolbox-runread racadm swinventory
nc-toolbox nc-toolbox-runread racadm systemconfig getbackupscheduler
nc-toolbox nc-toolbox-runread racadm systemperfstatistics
(不允許 PeakReset 自變數)nc-toolbox nc-toolbox-runread racadm techsupreport getupdatetime
nc-toolbox nc-toolbox-runread racadm traceroute
nc-toolbox nc-toolbox-runread racadm traceroute6
nc-toolbox nc-toolbox-runread racadm usercertview
nc-toolbox nc-toolbox-runread racadm vflashsd status
nc-toolbox nc-toolbox-runread racadm vflashpartition list
nc-toolbox nc-toolbox-runread racadm vflashpartition status -a
nc-toolbox nc-toolbox-runread mstregdump
nc-toolbox nc-toolbox-runread mstconfig
(需要query
自變數)nc-toolbox nc-toolbox-runread mstflint
(需要query
自變數)nc-toolbox nc-toolbox-runread mstlink
(需要query
自變數)nc-toolbox nc-toolbox-runread mstfwmanager
(需要query
自變數)nc-toolbox nc-toolbox-runread mlx_temp
命令語法為:
az networkcloud baremetalmachine run-read-command --name <machine-name>
--limit-time-seconds <timeout> \
--commands '[{"command":"<command1>"},{"command":"<command2>","arguments":["<arg1>","<arg2>"]}]' \
--resource-group "<resourceGroupName>" \
--subscription "<subscription>"
您可以使用 json 格式來提供多個命令來 --commands
選項。
針對具有多個自變數的命令,提供 做為參數的清單 arguments
。 如需建構--commands
結構的指示,請參閱 Azure CLI 速記。
這些命令可以長時間執行,因此建議設定為 --limit-time-seconds
至少 600 秒(10 分鐘)。 執行多個擷取可能需要 10 分鐘的時間。
此命令會同步執行。 如果您想要略過等候命令完成,請指定 --no-wait --debug
選項。 如需詳細資訊,請參閱 如何追蹤異步操作。
提供選擇性自變數 --output-directory
時,輸出結果會下載並解壓縮到本機目錄。
此範例會 hostname
執行 命令和 ping
命令
az networkcloud baremetalmachine run-read-command --name "<bareMetalMachineName>" \
--limit-time-seconds 60 \
--commands '[{"command":"hostname"},{"command":"ping","arguments":["198.51.102.1","-c","3"]}]' \
--resource-group "<resourceGroupName>" \
--subscription "<subscription>"
此範例會 racadm getsysinfo -c
執行 命令
az networkcloud baremetalmachine run-read-command --name "<bareMetalMachineName>" \
--limit-time-seconds 60 \
--commands '[{"command":"nc-toolbox nc-toolbox-runread racadm getsysinfo","arguments":["-c"]}]' \
--resource-group "<resourceGroupName>" \
--subscription "<subscription>"
檢查命令狀態和檢視輸出
顯示範例輸出。 它會將結果的前 4,000 個字元列印到畫面,以方便起見,並提供包含命令執行結果的記憶體 Blob 短期連結。 您可以使用連結來下載壓縮的輸出檔案 (tar.gz)。
====Action Command Output====
+ hostname
rack1compute01
+ ping 198.51.102.1 -c 3
PING 198.51.102.1 (198.51.102.1) 56(84) bytes of data.
--- 198.51.102.1 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2049ms
================================
Script execution result can be found in storage account:
https://<storage_account_name>.blob.core.windows.net/bmm-run-command-output/a8e0a5fe-3279-46a8-b995-51f2f98a18dd-action-bmmrunreadcmd.tar.gz?se=2023-04-14T06%3A37%3A00Z&sig=XXX&sp=r&spr=https&sr=b&st=2023-04-14T02%3A37%3A00Z&sv=2019-12-12
如何在叢集管理員 儲存體 帳戶中檢視的az networkcloud baremetalmachine run-read-command
輸出
本指南會逐步引導您存取在伺服器上執行 時,於叢集管理員 儲存體 帳戶az networkcloud baremetalmachine run-read-command
中建立的輸出檔案。 狀態輸出中 az rest
會識別檔案的名稱。
開啟伺服器所在叢集的叢集管理員受控資源群組,然後選取 儲存體 帳戶。
在 儲存體 帳戶詳細數據中,從左側導覽功能表中選取 儲存體 瀏覽器。
在 儲存體 瀏覽器詳細數據中,選取 [Blob 容器]。
選取 baremetal-run-command-output Blob 容器。
從 run-read 命令中選取輸出檔案。 您可以從 命令識別
az rest --method get
檔名。 此外, 上次修改的 時間戳會與執行命令時對齊。您可以從 [概觀] 彈出視窗管理及下載輸出檔案。