Rozwiązywanie problemów z maszyną bez systemu operacyjnego przy użyciu az networkcloud baremetalmachine run-data-extract
polecenia
Mogą wystąpić sytuacje, w których użytkownik musi zbadać i rozwiązać problemy z lokalną maszyną bez systemu operacyjnego. Operator platformy Azure Nexus udostępnia określony zestaw poleceń wyodrębniania danych za pośrednictwem polecenia az networkcloud baremetalmachine run-data-extract
. Te polecenia umożliwiają użytkownikom pobieranie danych diagnostycznych z komputera bez systemu operacyjnego.
Polecenie generuje plik wyjściowy zawierający wyniki wyodrębnienia danych znajdującego się na koncie usługi Azure Storage Menedżera klastra.
Wymagania wstępne
- W tym artykule założono, że zainstalowano interfejs wiersza polecenia platformy Azure i rozszerzenie interfejsu
networkcloud
wiersza polecenia. Aby uzyskać więcej informacji, zobacz How to Install CLI Extensions (Jak zainstalować rozszerzenia interfejsu wiersza polecenia). - Docelowa maszyna bez systemu operacyjnego jest włączona i ma wartość ReadyState ustawioną na true.
- Składnia tych poleceń jest oparta na wersji 0.3.0+ interfejsu
az networkcloud
wiersza polecenia. - Pobierz nazwę zarządzanej grupy zasobów klastra (cluster_MRG) utworzoną dla zasobu klastra.
Weryfikowanie dostępu do konta magazynu
Sprawdź, czy masz dostęp do konta magazynu Menedżera klastra
- W witrynie Azure Portal przejdź do konta magazynu menedżera klastra.
- W obszarze Szczegóły konta magazynu wybierz pozycję Przeglądarka magazynu z menu nawigacji po lewej stronie.
- W obszarze Szczegóły przeglądarki usługi Storage wybierz pozycję Kontenery obiektów blob.
- Jeśli wystąpi błąd
403 This request is not authorized to perform this operation.
podczas uzyskiwania dostępu do konta magazynu, ustawienia zapory konta magazynu muszą zostać zaktualizowane, aby uwzględnić publiczny adres IP. - Zażądaj dostępu, tworząc bilet pomocy technicznej za pośrednictwem portalu w zasobie Menedżera klastra. Podaj publiczny adres IP, który wymaga dostępu.
Wykonywanie polecenia uruchamiania
Uruchomienie polecenia wyodrębniania danych wykonuje co najmniej jeden wstępnie zdefiniowany skrypt w celu wyodrębnienia danych z maszyny bez systemu operacyjnego.
Ostrzeżenie
Firma Microsoft nie udostępnia ani nie obsługuje żadnych wywołań interfejsu API Nexus operatora, które oczekują podania nazwy użytkownika i/lub hasła w postaci zwykłego tekstu. Należy pamiętać, że wszystkie wysłane wartości zostaną zarejestrowane i zostaną uznane za uwidocznione wpisy tajne, które powinny zostać obrócone i odwołane. Udokumentowana przez firmę Microsoft metoda bezpiecznego używania wpisów tajnych polega na przechowywaniu ich w usłudze Azure Key Vault, jeśli masz konkretne pytania lub wątpliwości, prześlij żądanie za pośrednictwem witryny Azure Portal.
Bieżąca lista obsługiwanych poleceń to
SupportAssist/TSR collection for Dell troubleshooting (Pomoc techniczna/kolekcja TSR dla firmy Dell)
Nazwa polecenia:hardware-support-data-collection
Argumenty: typ żądanych dziennikówSysInfo
- Informacje o systemieTTYLog
— Dane TTYLog magazynuDebug
— dzienniki debugowania
Zbieranie informacji o agencie Ochrona punktu końcowego w usłudze Microsoft Defender (MDE)
Nazwa polecenia:mde-agent-information
Argumenty: BrakZbieranie dzienników pomocy technicznej diagnostyki MDE
Nazwa polecenia:mde-support-diagnostics
Argumenty: BrakZbieranie stanu zestawienia sprzętu firmy Dell
Nazwa polecenia:hardware-rollup-status
Argumenty: BrakGenerowanie raportu CVE klastra
Nazwa polecenia:cluster-cve-report
Argumenty: Brak
Składnia polecenia to:
az networkcloud baremetalmachine run-data-extract --name "<machine-name>" \
--resource-group "<cluster_MRG>" \
--subscription "<subscription>" \
--commands '[{"arguments":["<arg1>","<arg2>"],"command":"<command1>"}]' \
--limit-time-seconds "<timeout>"
Określ wiele poleceń przy użyciu formatu json w --commands
opcji. Każdy command
określa polecenia i argumenty. W przypadku polecenia z wieloma argumentami podaj jako listę parametru arguments
. Aby uzyskać instrukcje dotyczące konstruowania struktury, zobacz Skrót interfejsu wiersza polecenia platformy --commands
Azure.
Te polecenia mogą być długotrwałe, dlatego zalecane jest ustawienie --limit-time-seconds
co najmniej 600 sekund (10 minut). Opcja Debug
lub uruchamianie wielu wyodrębnień może potrwać dłużej niż 10 minut.
W odpowiedzi operacja wykonuje asynchronicznie i zwraca kod stanu HTTP 202. Zobacz sekcję Wyświetlanie danych wyjściowych , aby uzyskać szczegółowe informacje na temat śledzenia uzupełniania poleceń i wyświetlania pliku wyjściowego.
Zbieranie danych pomocy technicznej sprzętu
W tym przykładzie hardware-support-data-collection
jest wykonywane polecenie i pobieranie SysInfo
i TTYLog
dzienniki z serwera Dell. Skrypt wykonuje racadm supportassist collect
polecenie na wyznaczonej maszynie baremetalowej. Wynikowy plik tar.gz zawiera spakowane dane wyjściowe wyodrębniania pliku polecenia w pliku hardware-support-data-<timestamp>.zip
.
az networkcloud baremetalmachine run-data-extract --name "bareMetalMachineName" \
--resource-group "cluster_MRG" \
--subscription "subscription" \
--commands '[{"arguments":["SysInfo", "TTYLog"],"command":"hardware-support-data-collection"}]' \
--limit-time-seconds 600
hardware-support-data-collection
Wyjście
====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
Przykładowa lista zebranych plików pomocy technicznej sprzętu
Archive: TSR20240227164024_FM56PK3.pl.zip
creating: tsr/hardware/
creating: tsr/hardware/spd/
creating: tsr/hardware/sysinfo/
creating: tsr/hardware/sysinfo/inventory/
inflating: tsr/hardware/sysinfo/inventory/sysinfo_CIM_BIOSAttribute.xml
inflating: tsr/hardware/sysinfo/inventory/sysinfo_CIM_Sensor.xml
inflating: tsr/hardware/sysinfo/inventory/sysinfo_DCIM_View.xml
inflating: tsr/hardware/sysinfo/inventory/sysinfo_DCIM_SoftwareIdentity.xml
inflating: tsr/hardware/sysinfo/inventory/sysinfo_CIM_Capabilities.xml
inflating: tsr/hardware/sysinfo/inventory/sysinfo_CIM_StatisticalData.xml
creating: tsr/hardware/sysinfo/lcfiles/
inflating: tsr/hardware/sysinfo/lcfiles/lclog_0.xml.gz
inflating: tsr/hardware/sysinfo/lcfiles/curr_lclog.xml
creating: tsr/hardware/psu/
creating: tsr/hardware/idracstateinfo/
inflating: tsr/hardware/idracstateinfo/avc.log
extracting: tsr/hardware/idracstateinfo/avc.log.persistent.1
[..snip..]
Zbieranie informacji o agencie MDE
Dane są zbierane za pomocą mde-agent-information
polecenia i sformatowane jako JSON na /hostfs/tmp/runcommand/mde-agent-information.json
. Plik JSON znajduje się w pliku zip wyodrębniania danych znajdującym się na koncie magazynu. Skrypt wykonuje sekwencję mdatp
poleceń na wyznaczonej maszynie baremetalowej.
W tym przykładzie wykonywane jest mde-agent-information
polecenie bez argumentów.
az networkcloud baremetalmachine run-data-extract --name "bareMetalMachineName" \
--resource-group "cluster_MRG" \
--subscription "subscription" \
--commands '[{"command":"mde-agent-information"}]' \
--limit-time-seconds 600
mde-agent-information
Wyjście
====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
Przykładowy obiekt JSON zebrany
{
"diagnosticInformation": {
"realTimeProtectionStats": $real_time_protection_stats,
"eventProviderStats": $event_provider_stats
},
"mdeDefinitions": $mde_definitions,
"generalHealth": $general_health,
"mdeConfiguration": $mde_config,
"scanList": $scan_list,
"threatInformation": {
"list": $threat_info_list,
"quarantineList": $threat_info_quarantine_list
}
}
Zbieranie diagnostyki pomocy technicznej rozwiązania MDE
Dane zebrane z mde-support-diagnostics
polecenia używają narzędzia ANALIZATORa klienta MDE do tworzenia pakietów informacji z mdatp
poleceń i odpowiednich plików dziennika. Plik konta tgz
magazynu będzie zawierać zip
plik o nazwie mde-support-diagnostics-<hostname>.zip
. Element zip
powinien zostać wysłany wraz z wszelkimi żądaniami pomocy technicznej, aby upewnić się, że zespoły pomocnicze mogą używać dzienników do rozwiązywania problemów i analizy głównej przyczyny, jeśli jest to konieczne.
W tym przykładzie wykonywane jest mde-support-diagnostics
polecenie bez argumentów.
az networkcloud baremetalmachine run-data-extract --name "bareMetalMachineName" \
--resource-group "cluster_MRG" \
--subscription "subscription" \
--commands '[{"command":"mde-support-diagnostics"}]' \
--limit-time-seconds 600
mde-support-diagnostics
Wyjście
====Action Command Output====
Executing mde-support-diagnostics command
[2024-01-23 16:07:37.588][INFO] XMDEClientAnalyzer Version: 1.3.2
[2024-01-23 16:07:38.367][INFO] Top Command output: [/tmp/top_output_2024_01_23_16_07_37mel0nue0.txt]
[2024-01-23 16:07:38.367][INFO] Top Command Summary: [/tmp/top_summary_2024_01_23_16_07_370zh7dkqn.txt]
[2024-01-23 16:07:38.367][INFO] Top Command Outliers: [/tmp/top_outlier_2024_01_23_16_07_37aypcfidh.txt]
[2024-01-23 16:07:38.368][INFO] [MDE Diagnostic]
[2024-01-23 16:07:38.368][INFO] Collecting MDE Diagnostic
[2024-01-23 16:07:38.613][WARNING] mde is not running
[2024-01-23 16:07:41.343][INFO] [SLEEP] [3sec] waiting for agent to create diagnostic package
[2024-01-23 16:07:44.347][INFO] diagnostic package path: /var/opt/microsoft/mdatp/wdavdiag/5b1edef9-3b2a-45c1-a45d-9e7e4b6b869e.zip
[2024-01-23 16:07:44.347][INFO] Successfully created MDE diagnostic zip
[2024-01-23 16:07:44.348][INFO] Adding mde_diagnostic.zip to report directory
[2024-01-23 16:07:44.348][INFO] Collecting MDE Health
[...snip...]
================================
Script execution result can be found in storage account:
https://cmmj627vvrzkst.blob.core.windows.net/bmm-run-command-output/7c5557b9-b6b6-a4a4-97ea-752c38918ded-action-bmmdataextcmd.tar.gz?se=2024-01-23T20%3A11%3A32Z&sig=9h20XlZO87J7fCr0S1234xcyu%2Fl%2BVuaDh1BE0J6Yfl8%3D&sp=r&spr=https&sr=b&st=2024-01-23T16%3A11%3A32Z&sv=2019-12-12
Po pobraniu pliku wyniku wykonania pliki pomocy technicznej można rozpakować na potrzeby analizy.
Przykładowa lista informacji zebranych przez analizator klienta MDE
Archive: mde-support-diagnostics-rack1compute02.zip
inflating: mde_diagnostic.zip
inflating: process_information.txt
inflating: auditd_info.txt
inflating: auditd_log_analysis.txt
inflating: auditd_logs.zip
inflating: ebpf_kernel_config.txt
inflating: ebpf_enabled_func.txt
inflating: ebpf_syscalls.zip
inflating: ebpf_raw_syscalls.zip
inflating: messagess.zip
inflating: conflicting_processes_information.txt
[...snip...]
Stan zestawienia sprzętu
Dane są zbierane za pomocą hardware-rollup-status
polecenia i sformatowane jako JSON na /hostfs/tmp/runcommand/rollupStatus.json
. Plik JSON znajduje się w pliku zip wyodrębniania danych znajdującym się na koncie magazynu. Zebrane dane będą pokazywać kondycję podsystemów maszyn.
W tym przykładzie wykonywane jest hardware-rollup-status
polecenie bez argumentów.
az networkcloud baremetalmachine run-data-extract --name "bareMetalMachineName" \
--resource-group "clusete_MRG" \
--subscription "subscription" \
--commands '[{"command":"hardware-rollup-status"}]' \
--limit-time-seconds 600
hardware-rollup-status
Wyjście
====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
Przykładowy zebrany kod JSON
{
"@odata.context" : "/redfish/v1/$metadata#DellRollupStatusCollection.DellRollupStatusCollection",
"@odata.id" : "/redfish/v1/Systems/System.Embedded.1/Oem/Dell/DellRollupStatus",
"@odata.type" : "#DellRollupStatusCollection.DellRollupStatusCollection",
"Description" : "A collection of DellRollupStatus resource",
"Members" :
[
{
"@odata.context" : "/redfish/v1/$metadata#DellRollupStatus.DellRollupStatus",
"@odata.id" : "/redfish/v1/Systems/System.Embedded.1/Oem/Dell/DellRollupStatus/iDRAC.Embedded.1_0x23_SubSystem.1_0x23_Current",
"@odata.type" : "#DellRollupStatus.v1_0_0.DellRollupStatus",
"CollectionName" : "CurrentRollupStatus",
"Description" : "Represents the subcomponent roll-up statuses.",
"Id" : "iDRAC.Embedded.1_0x23_SubSystem.1_0x23_Current",
"InstanceID" : "iDRAC.Embedded.1#SubSystem.1#Current",
"Name" : "DellRollupStatus",
"RollupStatus" : "Ok",
"SubSystem" : "Current"
},
{
"@odata.context" : "/redfish/v1/$metadata#DellRollupStatus.DellRollupStatus",
"@odata.id" : "/redfish/v1/Systems/System.Embedded.1/Oem/Dell/DellRollupStatus/iDRAC.Embedded.1_0x23_SubSystem.1_0x23_Voltage",
"@odata.type" : "#DellRollupStatus.v1_0_0.DellRollupStatus",
"CollectionName" : "VoltageRollupStatus",
"Description" : "Represents the subcomponent roll-up statuses.",
"Id" : "iDRAC.Embedded.1_0x23_SubSystem.1_0x23_Voltage",
"InstanceID" : "iDRAC.Embedded.1#SubSystem.1#Voltage",
"Name" : "DellRollupStatus",
"RollupStatus" : "Ok",
"SubSystem" : "Voltage"
},
[..snip..]
Generowanie raportu CVE klastra
Dane luk w zabezpieczeniach są zbierane za pomocą cluster-cve-report
polecenia i sformatowane jako dane JSON do {year}-{month}-{day}-nexus-cluster-vulnerability-report.json
. Plik JSON znajduje się w pliku zip wyodrębniania danych znajdującym się na koncie magazynu. Zebrane dane będą zawierać dane luk w zabezpieczeniach na obraz kontenera w klastrze.
W tym przykładzie wykonywane jest cluster-cve-report
polecenie bez argumentów.
Uwaga
Maszyna docelowa musi być węzłem płaszczyzny sterowania lub akcja nie zostanie wykonana.
az networkcloud baremetalmachine run-data-extract --name "bareMetalMachineName" \
--resource-group "cluster_MRG" \
--subscription "subscription" \
--commands '[{"command":"cluster-cve-report"}]' \
--limit-time-seconds 600
cluster-cve-report
Wyjście
====Action Command Output====
Nexus cluster vulnerability report saved.
================================
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
SCHEMAT RAPORTU CVE
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Vulnerability Report",
"type": "object",
"properties": {
"metadata": {
"type": "object",
"properties": {
"dateRetrieved": {
"type": "string",
"format": "date-time",
"description": "The date and time when the data was retrieved."
},
"platform": {
"type": "string",
"description": "The name of the platform."
},
"resource": {
"type": "string",
"description": "The name of the resource."
},
"runtimeVersion": {
"type": "string",
"description": "The version of the runtime."
},
"managementVersion": {
"type": "string",
"description": "The version of the management software."
},
"vulnerabilitySummary": {
"type": "object",
"properties": {
"criticalCount": {
"type": "integer",
"description": "Number of critical vulnerabilities."
},
"highCount": {
"type": "integer",
"description": "Number of high severity vulnerabilities."
},
"mediumCount": {
"type": "integer",
"description": "Number of medium severity vulnerabilities."
},
"lowCount": {
"type": "integer",
"description": "Number of low severity vulnerabilities."
},
"noneCount": {
"type": "integer",
"description": "Number of vulnerabilities with no severity."
},
"unknownCount": {
"type": "integer",
"description": "Number of vulnerabilities with unknown severity."
}
},
"required": ["criticalCount", "highCount", "mediumCount", "lowCount", "noneCount", "unknownCount"]
}
},
"required": ["dateRetrieved", "platform", "resource", "runtimeVersion", "managementVersion", "vulnerabilitySummary"]
},
"containers": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "object",
"properties": {
"namespace": {
"type": "string",
"description": "The namespace of the container."
},
"digest": {
"type": "string",
"description": "The digest of the container image."
},
"os": {
"type": "object",
"properties": {
"family": {
"type": "string",
"description": "The family of the operating system."
}
},
"required": ["family"]
},
"summary": {
"type": "object",
"properties": {
"criticalCount": {
"type": "integer",
"description": "Number of critical vulnerabilities in this container."
},
"highCount": {
"type": "integer",
"description": "Number of high severity vulnerabilities in this container."
},
"lowCount": {
"type": "integer",
"description": "Number of low severity vulnerabilities in this container."
},
"mediumCount": {
"type": "integer",
"description": "Number of medium severity vulnerabilities in this container."
},
"noneCount": {
"type": "integer",
"description": "Number of vulnerabilities with no severity in this container."
},
"unknownCount": {
"type": "integer",
"description": "Number of vulnerabilities with unknown severity in this container."
}
},
"required": ["criticalCount", "highCount", "lowCount", "mediumCount", "noneCount", "unknownCount"]
},
"vulnerabilities": {
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "Title of the vulnerability."
},
"vulnerabilityID": {
"type": "string",
"description": "Identifier of the vulnerability."
},
"fixedVersion": {
"type": "string",
"description": "The version in which the vulnerability is fixed."
},
"installedVersion": {
"type": "string",
"description": "The currently installed version."
},
"referenceLink": {
"type": "string",
"format": "uri",
"description": "Link to the vulnerability details."
},
"publishedDate": {
"type": "string",
"format": "date-time",
"description": "The date when the vulnerability was published."
},
"score": {
"type": "number",
"description": "The CVSS score of the vulnerability."
},
"severity": {
"type": "string",
"description": "The severity level of the vulnerability."
},
"resource": {
"type": "string",
"description": "The resource affected by the vulnerability."
},
"target": {
"type": "string",
"description": "The target of the vulnerability."
},
"packageType": {
"type": "string",
"description": "The type of the package."
},
"exploitAvailable": {
"type": "boolean",
"description": "Indicates if an exploit is available for the vulnerability."
}
},
"required": ["title", "vulnerabilityID", "fixedVersion", "installedVersion", "referenceLink", "publishedDate", "score", "severity", "resource", "target", "packageType", "exploitAvailable"]
}
}
},
"required": ["namespace", "digest", "os", "summary", "vulnerabilities"]
}
}
}
},
"required": ["metadata", "containers"]
}
Szczegóły danych CVE
Dane CVE są odświeżane na obraz kontenera co 24 godziny na podstawie wystąpienia zasobu kubernetes lub za każdym razem, gdy nastąpi zmiana zasobu Kubernetes odwołującego się do obrazu (w zależności od tego, co nastąpi wcześniej).
Wyświetlanie danych wyjściowych
Zanotuj podany link do pliku tar.gz spakowanego z wykonania polecenia. Nazwa pliku tar.gz identyfikuje plik na koncie magazynu grupy zasobów Menedżer klastra. Możesz również użyć linku, aby bezpośrednio uzyskać dostęp do wyjściowego pliku zip. Plik tar.gz zawiera również spakowane dane wyjściowe wyodrębniania pliku polecenia. Pobierz plik wyjściowy z obiektu blob magazynu do katalogu lokalnego, określając ścieżkę katalogu w opcjonalnym argumencie --output-directory
.
Uwaga: konto magazynu może być zablokowane 403 This request is not authorized to perform this operation.
z powodu ograniczeń sieci lub zapory. Aby uzyskać procedurę weryfikowania/żądania dostępu do konta magazynu, zobacz Weryfikowanie dostępu do konta magazynu.