Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Troubleshoot BMM issues using the
There might be situations where a user needs to investigate and resolve issues with an on-premises bare metal machine (BMM). Operator Nexus provides the az networkcloud baremetalmachine run-read-command so users can run a curated list of read only commands to get information from a BMM.
The command produces an output file containing the results of the run-read command execution. By default, the data is sent to the Cluster Manager storage account. There's also a preview method where users can configure the Cluster resource with a storage account and identity that has access to the storage account to receive the output.
Prerequisites
- Install the latest version of the appropriate CLI extensions
- Ensure that the target BMM must have its
poweredStateset toOnand have itsreadyStateset toTrue - Get the Managed Resource group name (cluster_MRG) that you created for
Clusterresource
Send command output to a user specified Storage Account
To configure the Storage Account and container to which command output is sent, see Azure Operator Nexus Cluster support for managed identities and user provided resources.
To access the output of a command, users need the appropriate access to the storage blob, including both having the necessary Azure role assignments and ensuring that any networking restrictions are properly configured.
For role assignments, a user must have the following role assignments on the blob container or its Storage Account:
- A data access role, such as Storage Blob Data Reader or Storage Blob Data Contributor
- The Azure Resource Manager Reader role, at a minimum
For information on assigning roles to storage accounts, see Assign an Azure role for access to blob data.
For networking restrictions, if the Storage Account allows public endpoint access via a firewall, the firewall must be configured with a networking rule to allow that user's IP address through. If it allows only private endpoint access, a user must be part of a network that has access to the private endpoint.
For information on allowing access through the storage account firewall using networking rules or private endpoints, see the respective documentation.
Verify access to the specified Storage Account
Before running commands, you might wish to verify you have access to the specified Storage Account:
- From the Azure portal, navigate to the Storage Account.
- In the Storage Account details, select Storage browser from the navigation menu on the left side.
- In the Storage browser details, select Blob containers.
- Find the container to which command output is to be sent and select it.
- If you encounter errors while accessing the Storage Account or container, the user you're using might need a role assignment for the Storage Account or container. Alternatively, the Storage Account’s firewall settings might need to be updated to include your IP address.
Execute a run-read command
The run-read command lets you run a command on the BMM that doesn't change anything. Some commands have more
than one word, or need an argument to work. These commands are made like this to separate them from the ones
that can change things. For example, run-read-command can use kubectl get but not kubectl apply. When you
use these commands, you have to put all the words in the "command" field. For example,
{command:'kubectl get',arguments:[nodes]} is right; {command:kubectl,arguments:[get,nodes]}
is wrong.
Also note that some commands begin with nc-toolbox nc-toolbox-runread and must be entered as shown.
nc-toolbox-runread is a special container image that includes more tools that aren't installed on the
bare metal host, such as ipmitool and racadm.
Some of the run-read commands require specific arguments be supplied to enforce read-only capabilities of the commands.
An example of run-read commands that require specific arguments is the allowed Mellanox command mstconfig,
which requires the query argument be provided to enforce read-only.
Warning
Microsoft doesn't provide or support any Operator Nexus API calls that expect plaintext username and/or password to be supplied. Note any values sent are logged and are considered exposed secrets, which should be rotated and revoked. The Microsoft documented method for securely using secrets is to store them in an Azure Key Vault. If you have specific questions or concerns, submit a request via the Azure portal.
This list shows the commands you can use. Commands in *italics* can't have arguments; the rest can.
arpbrctl showdmidecodefdisk -lhosthostnameifconfig -aifconfig -sip address showip link showip maddress showip route showjournalctlkubectl api-resourceskubectl api-versionskubectl describekubectl getkubectl logsmountpingsstcpdumptracerouteunameulimit -auptimetimedatectl statushostnamectl statusnc-toolbox nc-toolbox-runread ipmitool channel authcapnc-toolbox nc-toolbox-runread ipmitool channel infonc-toolbox nc-toolbox-runread ipmitool chassis statusnc-toolbox nc-toolbox-runread ipmitool chassis power statusnc-toolbox nc-toolbox-runread ipmitool chassis restart causenc-toolbox nc-toolbox-runread ipmitool chassis pohnc-toolbox nc-toolbox-runread ipmitool dcmi power get_limitnc-toolbox nc-toolbox-runread ipmitool dcmi sensorsnc-toolbox nc-toolbox-runread ipmitool dcmi asset_tagnc-toolbox nc-toolbox-runread ipmitool dcmi get_mc_id_stringnc-toolbox nc-toolbox-runread ipmitool dcmi thermalpolicy getnc-toolbox nc-toolbox-runread ipmitool dcmi get_temp_readingnc-toolbox nc-toolbox-runread ipmitool dcmi get_conf_paramnc-toolbox nc-toolbox-runread ipmitool delloem lcd infonc-toolbox nc-toolbox-runread ipmitool delloem lcd statusnc-toolbox nc-toolbox-runread ipmitool delloem mac listnc-toolbox nc-toolbox-runread ipmitool delloem mac getnc-toolbox nc-toolbox-runread ipmitool delloem lan getnc-toolbox nc-toolbox-runread ipmitool delloem powermonitor powerconsumptionnc-toolbox nc-toolbox-runread ipmitool delloem powermonitor powerconsumptionhistorync-toolbox nc-toolbox-runread ipmitool delloem powermonitor getpowerbudgetnc-toolbox nc-toolbox-runread ipmitool delloem vflash info cardnc-toolbox nc-toolbox-runread ipmitool echonc-toolbox nc-toolbox-runread ipmitool ekanalyzer printnc-toolbox nc-toolbox-runread ipmitool ekanalyzer summarync-toolbox nc-toolbox-runread ipmitool fru printnc-toolbox nc-toolbox-runread ipmitool fwum infonc-toolbox nc-toolbox-runread ipmitool fwum statusnc-toolbox nc-toolbox-runread ipmitool fwum tracelognc-toolbox nc-toolbox-runread ipmitool gendev listnc-toolbox nc-toolbox-runread ipmitool hpm rollbackstatusnc-toolbox nc-toolbox-runread ipmitool hpm selftestresultnc-toolbox nc-toolbox-runread ipmitool ime helpnc-toolbox nc-toolbox-runread ipmitool ime infonc-toolbox nc-toolbox-runread ipmitool isol infonc-toolbox nc-toolbox-runread ipmitool lan printnc-toolbox nc-toolbox-runread ipmitool lan alert printnc-toolbox nc-toolbox-runread ipmitool lan stats getnc-toolbox nc-toolbox-runread ipmitool mc bootparam getnc-toolbox nc-toolbox-runread ipmitool mc chassis pohnc-toolbox nc-toolbox-runread ipmitool mc chassis policy listnc-toolbox nc-toolbox-runread ipmitool mc chassis power statusnc-toolbox nc-toolbox-runread ipmitool mc chassis statusnc-toolbox nc-toolbox-runread ipmitool mc getenablesnc-toolbox nc-toolbox-runread ipmitool mc getsysinfonc-toolbox nc-toolbox-runread ipmitool mc guidnc-toolbox nc-toolbox-runread ipmitool mc infonc-toolbox nc-toolbox-runread ipmitool mc restart causenc-toolbox nc-toolbox-runread ipmitool mc watchdog getnc-toolbox nc-toolbox-runread ipmitool bmc bootparam getnc-toolbox nc-toolbox-runread ipmitool bmc chassis pohnc-toolbox nc-toolbox-runread ipmitool bmc chassis policy listnc-toolbox nc-toolbox-runread ipmitool bmc chassis power statusnc-toolbox nc-toolbox-runread ipmitool bmc chassis statusnc-toolbox nc-toolbox-runread ipmitool bmc getenablesnc-toolbox nc-toolbox-runread ipmitool bmc getsysinfonc-toolbox nc-toolbox-runread ipmitool bmc guidnc-toolbox nc-toolbox-runread ipmitool bmc infonc-toolbox nc-toolbox-runread ipmitool bmc restart causenc-toolbox nc-toolbox-runread ipmitool bmc watchdog getnc-toolbox nc-toolbox-runread ipmitool nm alert getnc-toolbox nc-toolbox-runread ipmitool nm capabilitync-toolbox nc-toolbox-runread ipmitool nm discovernc-toolbox nc-toolbox-runread ipmitool nm policy get policy_idnc-toolbox nc-toolbox-runread ipmitool nm policy limitingnc-toolbox nc-toolbox-runread ipmitool nm statisticsnc-toolbox nc-toolbox-runread ipmitool nm suspend getnc-toolbox nc-toolbox-runread ipmitool nm threshold getnc-toolbox nc-toolbox-runread ipmitool pefnc-toolbox nc-toolbox-runread ipmitool picmg addrinfonc-toolbox nc-toolbox-runread ipmitool picmg policy getnc-toolbox nc-toolbox-runread ipmitool power statusnc-toolbox nc-toolbox-runread ipmitool sdr elistnc-toolbox nc-toolbox-runread ipmitool sdr getnc-toolbox nc-toolbox-runread ipmitool sdr infonc-toolbox nc-toolbox-runread ipmitool sdr listnc-toolbox nc-toolbox-runread ipmitool sdr typenc-toolbox nc-toolbox-runread ipmitool sel elistnc-toolbox nc-toolbox-runread ipmitool sel getnc-toolbox nc-toolbox-runread ipmitool sel infonc-toolbox nc-toolbox-runread ipmitool sel listnc-toolbox nc-toolbox-runread ipmitool sel time getnc-toolbox nc-toolbox-runread ipmitool sensor getnc-toolbox nc-toolbox-runread ipmitool sensor listnc-toolbox nc-toolbox-runread ipmitool session infonc-toolbox nc-toolbox-runread ipmitool sol infonc-toolbox nc-toolbox-runread ipmitool sol payload statusnc-toolbox nc-toolbox-runread ipmitool user listnc-toolbox nc-toolbox-runread ipmitool user summarync-toolbox nc-toolbox-runread racadm arpnc-toolbox nc-toolbox-runread racadm coredumpnc-toolbox nc-toolbox-runread racadm diagnosticsnc-toolbox nc-toolbox-runread racadm eventfilters getnc-toolbox nc-toolbox-runread racadm fcstatisticsnc-toolbox nc-toolbox-runread racadm getnc-toolbox nc-toolbox-runread racadm getconfignc-toolbox nc-toolbox-runread racadm gethostnetworkinterfacesnc-toolbox nc-toolbox-runread racadm getlednc-toolbox nc-toolbox-runread racadm getniccfgnc-toolbox nc-toolbox-runread racadm getraclognc-toolbox nc-toolbox-runread racadm getractimenc-toolbox nc-toolbox-runread racadm getselnc-toolbox nc-toolbox-runread racadm getsensorinfonc-toolbox nc-toolbox-runread racadm getssninfonc-toolbox nc-toolbox-runread racadm getsvctagnc-toolbox nc-toolbox-runread racadm getsysinfonc-toolbox nc-toolbox-runread racadm gettracelognc-toolbox nc-toolbox-runread racadm getversionnc-toolbox nc-toolbox-runread racadm hwinventorync-toolbox nc-toolbox-runread racadm ifconfignc-toolbox nc-toolbox-runread racadm inlettemphistory getnc-toolbox nc-toolbox-runread racadm jobqueue viewnc-toolbox nc-toolbox-runread racadm lclog viewnc-toolbox nc-toolbox-runread racadm lclog viewconfigresultnc-toolbox nc-toolbox-runread racadm license viewnc-toolbox nc-toolbox-runread racadm netstatnc-toolbox nc-toolbox-runread racadm nicstatisticsnc-toolbox nc-toolbox-runread racadm pingnc-toolbox nc-toolbox-runread racadm ping6nc-toolbox nc-toolbox-runread racadm racdumpnc-toolbox nc-toolbox-runread racadm sslcertviewnc-toolbox nc-toolbox-runread racadm swinventorync-toolbox nc-toolbox-runread racadm systemconfig getbackupschedulernc-toolbox nc-toolbox-runread racadm systemperfstatistics(PeakReset argument NOT allowed)nc-toolbox nc-toolbox-runread racadm techsupreport getupdatetimenc-toolbox nc-toolbox-runread racadm traceroutenc-toolbox nc-toolbox-runread racadm traceroute6nc-toolbox nc-toolbox-runread racadm usercertviewnc-toolbox nc-toolbox-runread racadm vflashsd statusnc-toolbox nc-toolbox-runread racadm vflashpartition listnc-toolbox nc-toolbox-runread racadm vflashpartition status -anc-toolbox nc-toolbox-runread mstregdumpnc-toolbox nc-toolbox-runread mstconfig(requiresqueryarg)nc-toolbox nc-toolbox-runread mstflint(requiresqueryarg)nc-toolbox nc-toolbox-runread mstlink(requiresqueryarg)nc-toolbox nc-toolbox-runread mstfwmanager(requiresqueryarg)nc-toolbox nc-toolbox-runread mlx_temp
The command syntax for a single command with no arguments is as follows, using hostname as an example:
az networkcloud baremetalmachine run-read-command --name "<bareMetalMachineName>"
--limit-time-seconds "<timeout>" \
--commands "[{command:hostname}]" \
--resource-group "<cluster_MRG>" \
--subscription "<subscription>"
--nameis the name of the BMM resource on which to execute the command.- The
--commandsparameter always takes a list of commands, even if there's only one command. - Multiple commands can be provided in json format using Azure CLI Shorthand notation.
- Any whitespace must be enclosed in single quotes.
- Any arguments for each command must also be provided as a list, as shown in the following examples.
- Not all commands can run on any BMM. For example,
kubectlcommands can only be run from a BMM with thecontrol-planerole.
--commands "[{command:hostname},{command:'nc-toolbox nc-toolbox-runread racadm ifconfig'}]"
--commands "[{command:hostname},{command:'nc-toolbox nc-toolbox-runread racadm getsysinfo',arguments:[-c]}]"
--commands "[{command:ping,arguments:[198.51.102.1,-c,3]}]"
These commands can be long running so the recommendation is to set --limit-time-seconds to at least 600 seconds (10 minutes). Running multiple commands might take longer than 10 minutes.
This command runs synchronously. If you wish to skip waiting for the command to complete, specify the --no-wait --debug options. For more information, see how to track asynchronous operations.
When an optional argument --output-directory is provided, the output result is downloaded and extracted to the local directory, provided the user running the command has appropriate access to the Storage Account.
Warning
Using the --output-directory argument overwrites any files in the local directory that have the same name as the new files being created.
This example executes a 'kubectl get pods'
az networkcloud baremetalmachine run-read-command --name "<bareMetalMachineName>" \
--limit-time-seconds 60 \
--commands "[{command:'kubectl get',arguments:[pods,-n,nc-system]}]" \
--resource-group "<cluster_MRG>" \
--subscription "<subscription>"
This example executes the hostname command and a ping command
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 "<cluster_MRG>" \
--subscription "<subscription>"
This example executes the racadm getsysinfo -c command
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 "<cluster_MRG>" \
--subscription "<subscription>"
Check the command status
Sample output is shown. It prints the top 4,000 characters of the result to the screen for convenience and provides a short-lived link to the storage blob containing the command execution result.
====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
How to view the full output of a command in the associated Storage Account
To access the output of a command, users need the appropriate access to the storage blob, including both having the necessary Azure role assignments and ensuring that any networking restrictions are properly configured.
For role assignments, a user must have the following role assignments on the blob container or its Storage Account:
- A data access role, such as Storage Blob Data Reader or Storage Blob Data Contributor
- The Azure Resource Manager Reader role, at a minimum
For information on assigning roles to storage accounts, see Assign an Azure role for access to blob data.
For networking restrictions, if the Storage Account allows public endpoint access via a firewall, the firewall must be configured with a networking rule to allow that user's IP address through. If it allows only private endpoint access, a user must be part of a network that has access to the private endpoint.
For information on allowing access through the storage account firewall using networking rules or private endpoints, see the respective documentation.
With the necessary permissions and access configured, you can then use the link or command from the output summary to download the zipped output file (tar.gz).
You can also download it via the Azure portal:
- From the Azure portal, navigate to the Storage Account.
- In the Storage account details, select Storage browser from the navigation menu on the left side.
- In the Storage browser details, select on Blob containers.
- Select the blob container.
- Select the output file from the command. The file name can be identified from the output summary. Additionally, the Last modified timestamp aligns with when the command was executed.
- You can manage & download the output file from the Overview pop-out.