Rozwiązywanie problemów z programem BMM przy użyciu narzędzia az networkcloud baremetalmachine run-read-command
Mogą wystąpić sytuacje, w których użytkownik musi zbadać i rozwiązać problemy z lokalnym programem BMM. Operator Nexus udostępnia, az networkcloud baremetalmachine run-read-command
aby użytkownicy mogli uruchamiać wyselekcjonaną listę poleceń tylko do odczytu, aby uzyskać informacje z programu BMM.
Wykonanie polecenia generuje plik wyjściowy zawierający wyniki, które można znaleźć na koncie magazynu Menedżera klastra.
Wymagania wstępne
- Instalowanie najnowszej wersji odpowiednich rozszerzeń interfejsu wiersza polecenia
- Upewnij się, że docelowy program BMM musi mieć ustawioną
poweredState
wartośćOn
i musi mieć ustawionąreadyState
wartośćTrue
- Pobierz nazwę grupy zasobów utworzoną dla
Cluster
zasobu
Wykonywanie polecenia run-read
Polecenie run-read umożliwia uruchomienie polecenia w programie BMM, które nie zmienia niczego. Niektóre polecenia mają więcej niż jedno słowo lub wymagają argumentu do działania. Te polecenia są wykonywane w ten sposób, aby oddzielić je od tych, które mogą zmienić rzeczy. Na przykład polecenie run-read-może używać polecenia kubectl get
, ale nie kubectl apply
. W przypadku używania tych poleceń należy umieścić wszystkie wyrazy w polu "command". Na przykład {"command":"kubectl get","arguments":["nodes"]}
jest słuszne. {"command":"kubectl","arguments":["get","nodes"]}
Jest to złe.
Należy również pamiętać, że niektóre polecenia zaczynają się od nc-toolbox nc-toolbox-runread
i muszą być wprowadzone, jak pokazano.
nc-toolbox-runread
to specjalny obraz kontenera, który zawiera więcej narzędzi, które nie są zainstalowane na hoście baremetalowym, takim jak ipmitool
i racadm
.
Niektóre polecenia run-read wymagają dostarczenia określonych argumentów w celu wymuszenia możliwości tylko do odczytu poleceń.
Przykładem poleceń run-read, które wymagają określonych argumentów, jest dozwolone polecenie mstconfig
Mellanox , które wymaga podania argumentu query
w celu wymuszania tylko do odczytu.
Poniższa lista zawiera polecenia, których można użyć. Polecenia w programie *italics*
nie mogą mieć arguments
; reszta może.
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
(Argument PeakReset NOT allowed)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
(wymagaquery
arg )nc-toolbox nc-toolbox-runread mstflint
(wymagaquery
arg )nc-toolbox nc-toolbox-runread mstlink
(wymagaquery
arg )nc-toolbox nc-toolbox-runread mstfwmanager
(wymagaquery
arg )nc-toolbox nc-toolbox-runread mlx_temp
Składnia polecenia to:
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>"
Do opcji można podać wiele poleceń w formacie --commands
json.
W przypadku polecenia z wieloma argumentami podaj jako listę parametrów 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). Uruchamianie wielu wyodrębnień może potrwać dłużej niż 10 minut.
To polecenie jest uruchamiane synchronicznie. Jeśli chcesz pominąć oczekiwanie na ukończenie polecenia, określ --no-wait --debug
opcje. Aby uzyskać więcej informacji, zobacz jak śledzić operacje asynchroniczne.
Po podaniu opcjonalnego argumentu --output-directory
wynik wyjściowy zostanie pobrany i wyodrębniony do katalogu lokalnego.
W tym przykładzie hostname
jest wykonywane polecenie i ping
polecenie
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>"
W tym przykładzie racadm getsysinfo -c
jest wykonywane polecenie
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>"
Sprawdzanie stanu polecenia i wyświetlanie danych wyjściowych
Wyświetlane są przykładowe dane wyjściowe. Wyświetla on 4000 pierwszych znaków wyniku na ekranie dla wygody i zapewnia krótkotrwały link do obiektu blob magazynu zawierającego wynik wykonania polecenia. Możesz użyć linku, aby pobrać spakowany plik wyjściowy (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
Jak wyświetlić dane wyjściowe elementu az networkcloud baremetalmachine run-read-command
na koncie magazynu menedżera klastra
Ten przewodnik przeprowadzi Cię przez proces uzyskiwania dostępu do pliku wyjściowego utworzonego na koncie magazynu menedżera klastra, gdy obiekt az networkcloud baremetalmachine run-read-command
jest wykonywany na serwerze. Nazwa pliku jest identyfikowana w danych wyjściowych az rest
stanu.
Otwórz zarządzaną grupę zasobów menedżera klastra dla klastra, w którym znajduje się serwer, a następnie wybierz konto magazynu.
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.
Wybierz kontener obiektów blob wyjściowych baremetal-run-run-command..
Wybierz plik wyjściowy z polecenia run-read. Nazwę pliku można zidentyfikować za pomocą
az rest --method get
polecenia . Ponadto znacznik czasu Ostatniej modyfikacji jest zgodny z momentem wykonania polecenia.Plik wyjściowy można zarządzać i pobierać z okna podręcznego Przegląd .