Behandeln von BMM-Problemen mithilfe von az networkcloud baremetalmachine run-read-command
Es kann Situationen geben, in denen Benutzer Probleme mit einem lokalen BMM untersuchen und beheben müssen. Operator Nexus bietet Benutzern die az networkcloud baremetalmachine run-read-command
, damit sie eine kuratierte Liste von schreibgeschützten Befehlen auszuführen können, um Informationen aus einem BMM abzurufen.
Die Befehlsausführung erzeugt eine Ausgabedatei mit den Ergebnissen, die im Speicherkonto des Cluster-Managers zu finden sind.
Voraussetzungen
- Installieren Sie die aktuelle Version der passenden Azure CLI-Erweiterung
- Stellen Sie sicher, dass der Ziel-BMM seine
poweredState
aufOn
und seinereadyState
aufTrue
festgelegt hat - Abrufen des Ressourcengruppennamens, den Sie für die
Cluster
-Ressource erstellt haben
Ausführen eines Run-Read-Befehls
Mit dem Run-Read-Befehl können Sie einen Befehl auf dem BMM ausführen, der nichts ändert. Einige Befehle verfügen über mehr als ein Wort oder benötigen ein Argument, um zu funktionieren. Diese Befehle werden wie folgt durchgeführt, um sie von den Befehlen zu trennen, die Dinge ändern können. Der Befehl „run-read-command“ kann z. B. kubectl get
verwenden, aber nicht kubectl apply
. Wenn Sie diese Befehle verwenden, müssen Sie alle Wörter im Feld „command“ platzieren. {"command":"kubectl get","arguments":["nodes"]}
ist beispielsweise richtig, {"command":"kubectl","arguments":["get","nodes"]}
ist falsch.
Beachten Sie außerdem, dass einige Befehle mit nc-toolbox nc-toolbox-runread
beginnen und wie dargestellt eingegeben werden müssen.
nc-toolbox-runread
ist ein spezielles Containerimage, das weitere Tools enthält, die nicht auf dem Bare-Metal-Host installiert sind, z. B. ipmitool
und racadm
.
Einige der Ausführungslesebefehle erfordern bestimmte Argumente, um schreibgeschützte Funktionen der Befehle zu erzwingen.
Ein Beispiel für Ausführungslesebefehle, die bestimmte Argumente erfordern, ist der zulässige Mellanox-Befehl mstconfig
, der das query
-Argument zum Erzwingen von Schreibschutz erfordert.
In der folgenden Liste sind die Befehle aufgeführt, die Sie verwenden können. Befehle in *italics*
dürfen arguments
nicht enthalten, der Rest kann.
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-Argument NICHT zulässig)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
(erfordertquery
Arg )nc-toolbox nc-toolbox-runread mstflint
(erfordertquery
Arg )nc-toolbox nc-toolbox-runread mstlink
(erfordertquery
Arg )nc-toolbox nc-toolbox-runread mstfwmanager
(erfordertquery
Arg )nc-toolbox nc-toolbox-runread mlx_temp
Die Befehlssyntax ist wie folgt:
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>"
Es können mehrere Befehle im JSON-Format für die Option --commands
bereitgestellt werden.
Geben Sie für einen Befehl mit mehreren Argumenten eine Liste zum arguments
-Parameter an. Anweisungen zum Konstruieren der --commands
-Struktur finden Sie unter Azure CLI-Kurzform.
Diese Befehle können zeitintensiv sein, daher wird empfohlen, --limit-time-seconds
auf mindestens 600 Sekunden (10 Minuten) festzulegen. Das Ausführen mehrerer Extrakte kann länger als 10 Minuten dauern.
Dieser Befehl wird synchron ausgeführt. Wenn Sie das Warten auf den Abschluss des Befehls überspringen möchten, geben Sie die --no-wait --debug
-Optionen an. Weitere Informationen finden Sie unter Nachverfolgen asynchroner Vorgänge.
Wenn ein optionales Argument --output-directory
bereitgestellt wird, wird das Ausgabeergebnis heruntergeladen und in das lokale Verzeichnis extrahiert.
In diesem Beispiel werden der hostname
-Befehl und ein ping
-Befehl ausgeführt
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>"
In diesem Beispiel wird der racadm getsysinfo -c
-Befehl ausgeführt
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>"
Überprüfen des Befehlsstatus und Anzeigen der Ausgabe
Eine Beispielausgabe wird gezeigt. Sie gibt der Einfachheit halber die obersten 4000 Zeichen des Ergebnisses auf dem Bildschirm aus und stellt einen kurzlebigen Link zum Speicherblob bereit, der das Befehlsausführungsergebnis enthält. Sie können den Link verwenden, um die gezippte Ausgabedatei (tar.gz) herunterzuladen.
====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
So zeigen Sie die Ausgabe eines az networkcloud baremetalmachine run-read-command
im Cluster-Manager-Speicherkonto an
Dieses Handbuch führt Sie durch den Zugriff auf die Ausgabedatei, die im Cluster-Manager-Speicherkonto erstellt wird, wenn ein az networkcloud baremetalmachine run-read-command
auf einem Server ausgeführt wird. Der Name der Datei wird in der az rest
-Statusausgabe identifiziert.
Öffnen Sie die verwaltete Cluster-Manager-Ressourcengruppe für den Cluster, in dem sich der Server befindet, und wählen Sie dann das Speicherkonto aus.
Wählen Sie in den Details des Speicherkontos den Speicherbrowser im Navigationsmenü auf der linken Seite aus.
Wählen Sie in den Details des Speicherbrowsers die Option für Blobcontainer aus.
Wählen Sie den BLOB-Container „baremetal-run-command-output“ aus.
Wählen Sie die Ausgabedatei aus dem Run-Read-Befehl aus. Der Dateiname kann aus dem
az rest --method get
-Befehl identifiziert werden. Außerdem stimmt der Zeitstempel Letzte Änderung mit dem Zeitpunkt überein, zu dem der Befehl ausgeführt wurde.Sie können die Ausgabedatei aus dem Pop-Out Übersicht verwalten und herunterladen.