使用 az networkcloud baremetalmachine run-data-extract
命令針對裸機電腦問題進行疑難排解
在某些情況下,使用者可能需要調查並解決內部部署裸機電腦的問題。 Azure 操作員 Nexus 會透過 az networkcloud baremetalmachine run-data-extract
提供一組指定的資料擷取命令。 這些命令可讓使用者從裸機電腦取得診斷資料。
此命令會產生輸出檔案,其中包含位於叢集管理員Azure 儲存體帳戶中資料擷取的結果。
開始之前
- 本文假設您已安裝 Azure 命令列介面和
networkcloud
命令列介面延伸模組。 如需詳細資訊,請參閱 如何安裝 CLI 延伸模組 。 - 目標裸機機器已開啟,且 readyState 已設定為 True。
- 這些命令的語法是以 CLI 的
az networkcloud
0.3.0+ 版本為基礎。
執行執行命令
執行資料擷取命令會執行一或多個預先定義的腳本,以從裸機電腦擷取資料。
目前支援的命令清單為
Dell 疑難排解的 SupportAssist/TSR 集合
命令名稱:hardware-support-data-collection
引數:要求的記錄類型SysInfo
- 系統資訊TTYLog
- 儲存體 TTYLog 資料Debug
- 偵錯記錄
收集適用於端點的 Microsoft Defender (MDE) 代理程式資訊
命令名稱:mde-agent-information
引數:無收集 Dell 硬體匯總狀態
命令名稱:hardware-rollup-status
引數:無
命令語法為:
az networkcloud baremetalmachine run-data-extract --name "<machine-name>" \
--resource-group "<resource-group>" \
--subscription "<subscription>" \
--commands '[{"arguments":["<arg1>","<arg2>"],"command":"<command1>"}]' \
--limit-time-seconds <timeout>
在 選項中使用 --commands
json 格式指定多個命令。 每個 command
都會指定命令和引數。 針對具有多個引數的命令,提供 做為參數的清單 arguments
。 如需建構 --commands
結構的指示,請參閱 Azure CLI 速記 。
這些命令可以長時間執行,因此建議設定為 --limit-time-seconds
至少 600 秒(10 分鐘)。 選項 Debug
或執行多個擷取可能需要超過 10 分鐘的時間。
此範例會執行 命令, hardware-support-data-collection
並從 Dell Server 取得 SysInfo
和 TTYLog
記錄。
az networkcloud baremetalmachine run-data-extract --name "bareMetalMachineName" \
--resource-group "resourceGroupName" \
--subscription "subscription" \
--commands '[{"arguments":["SysInfo", "TTYLog"],"command":"hardware-support-data-collection"}]' \
--limit-time-seconds 600
此範例會 mde-agent-information
執行不含引數的命令。
az networkcloud baremetalmachine run-data-extract --name "bareMetalMachineName" \
--resource-group "resourceGroupName" \
--subscription "subscription" \
--commands '[{"command":"mde-agent-information"}]' \
--limit-time-seconds 600
此範例會 hardware-rollup-status
執行不含引數的命令。
az networkcloud baremetalmachine run-data-extract --name "bareMetalMachineName" \
--resource-group "resourceGroupName" \
--subscription "subscription" \
--commands '[{"command":"hardware-rollup-status"}]' \
--limit-time-seconds 600
在回應中,作業會以非同步方式執行,並傳回 HTTP 狀態碼 202。 如需如何追蹤命令完成和檢視輸出檔案的詳細資訊,請參閱檢視輸出 一節。
檢視輸出
範例輸出看起來像這樣。 請注意命令執行中 tar.gz 壓縮檔案的提供連結。 tar.gz 檔案名會識別叢集管理員資源群組儲存體帳戶中的檔案。 您也可以使用連結直接存取輸出 zip 檔案。 tar.gz 檔案也包含 中的 hardware-support-data-<timestamp>.zip
壓縮解壓縮命令檔輸出。 藉由在選擇性引數 --output-directory
中指定目錄路徑,將輸出檔案從儲存體 Blob 下載到本機目錄。
====Action Command Output====
Executing hardware-support-data-collection command
Getting following hardware support logs: SysInfo,TTYLog
Job JID_814372800396 is running, waiting for it to complete ...
Job JID_814372800396 Completed.
---------------------------- JOB -------------------------
[Job ID=JID_814372800396]
Job Name=SupportAssist Collection
Status=Completed
Scheduled Start Time=[Not Applicable]
Expiration Time=[Not Applicable]
Actual Start Time=[Thu, 13 Apr 2023 20:54:40]
Actual Completion Time=[Thu, 13 Apr 2023 20:59:51]
Message=[SRV088: The SupportAssist Collection Operation is completed successfully.]
Percent Complete=[100]
----------------------------------------------------------
Deleting Job JID_814372800396
Collection successfully exported to /hostfs/tmp/runcommand/hardware-support-data-2023-04-13T21:00:01.zip
================================
Script execution result can be found in storage account:
https://cm2p9bctvhxnst.blob.core.windows.net/bmm-run-command-output/dd84df50-7b02-4d10-a2be-46782cbf4eef-action-bmmdataextcmd.tar.gz?se=2023-04-14T01%3A00%3A15Zandsig=ZJcsNoBzvOkUNL0IQ3XGtbJSaZxYqmtd%2BM6rmxDFqXE%3Dandsp=randspr=httpsandsr=bandst=2023-04-13T21%3A00%3A15Zandsv=2019-12-12
資料會使用 mde-agent-information
命令收集,並將 格式設定為 JSON 至 /hostfs/tmp/runcommand/mde-agent-information.json
。 JSON 檔案位於儲存體帳戶中的資料擷取 zip 檔案中。
====Action Command Output====
Executing mde-agent-information command
MDE agent is running, proceeding with data extract
Getting MDE agent information for bareMetalMachine
Writing to /hostfs/tmp/runcommand
================================
Script execution result can be found in storage account:
https://cmzhnh6bdsfsdwpbst.blob.core.windows.net/bmm-run-command-output/f5962f18-2228-450b-8cf7-cb8344fdss63b0-action-bmmdataextcmd.tar.gz?se=2023-07-26T19%3A07%3A22Z&sig=X9K3VoNWRFP78OKqFjvYoxubp65BbNTq%2BGnlHclI9Og%3D&sp=r&spr=https&sr=b&st=2023-07-26T15%3A07%3A22Z&sv=2019-12-12
資料會使用 hardware-rollup-status
命令收集,並將 格式設定為 JSON 至 /hostfs/tmp/runcommand/rollupStatus.json
。 JSON 檔案位於儲存體帳戶中的資料擷取 zip 檔案中。
====Action Command Output====
Executing hardware-rollup-status command
Getting rollup status logs for b37dev03a1c002
Writing to /hostfs/tmp/runcommand
================================
Script execution result can be found in storage account:
https://cmkfjft8twwpst.blob.core.windows.net/bmm-run-command-output/20b217b5-ea38-4394-9db1-21a0d392eff0-action-bmmdataextcmd.tar.gz?se=2023-09-19T18%3A47%3A17Z&sig=ZJcsNoBzvOkUNL0IQ3XGtbJSaZxYqmtd%3D&sp=r&spr=https&sr=b&st=2023-09-19T14%3A47%3A17Z&sv=2019-12-12