Skip to content

Commit b910546

Browse files
committed
Add BMM read commands
1 parent bd6b7ab commit b910546

File tree

3 files changed

+169
-0
lines changed

3 files changed

+169
-0
lines changed

articles/operator-nexus/TOC.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
href: howto-configure-cluster.md
3333
- name: BareMetal Functions
3434
href: howto-baremetal-functions.md
35+
- name: BareMetal Run-Read Execution
36+
href: howto-baremetal-run-read.md
37+
- name: BareMetal Review Output Run-Read
38+
href: howto-baremetal-review-read-output.md
3539
- name: Isolation Domain
3640
href: howto-configure-isolation-domain.md
3741
- name: AKS-Hybrid
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: How to view the output of an `az networkcloud run-read-command` or `run-command` in the Operator Nexus Cluster Manager Storage Account
3+
description: Step by step guide on locating the output of a `az networkcloud run-read-command` or `az networkcloud run-command` in the Operator Nexus Cluster Manager Storage Account in the Azure Portal.
4+
author: eak13
5+
ms.author: ekarandjeff
6+
ms.service: azure
7+
ms.topic: how-to
8+
ms.date: 03/23/2023
9+
ms.custom: template-how-to
10+
---
11+
12+
# How to view the output of an `az networkcloud run-read-command` in the Cluster Manager Storage account
13+
14+
This guide will walk you through accessing the output file that is created in the Cluster Manager Storage account when an `az networkcloud baremetalmachine run-read-command` is executed on a server. The name of the file is identified in the `az rest` status output.
15+
16+
1. Open the Cluster Manager Managed Resource Group for the Cluster where the server is housed and then select the **Storage Account**.
17+
18+
1. In the Storage account details, select **Storage browser** from the navigation menu on the left side.
19+
20+
1. In the Storage browser details, select on **Blob containers**.
21+
22+
1. Select the baremetal-run-command-output blob container.
23+
24+
1. Select the output file from the run-read command. The file name can be identified from the `az rest --method get` command. Additionally, the **Last modified** timestamp will align with when the command was executed.
25+
26+
1. You can manage & download the output file from the **Overview** pop-out.
27+
28+
For information on running the `run-read-command` see:
29+
30+
- [Troubleshoot Baremetal Machine issues using the run-read command](howto-baremetal-run-read.md)
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
---
2+
title: Troubleshoot BMM issues using the `az networkcloud baremetalmachine run-read-command`
3+
description: Step by step guide on using the `az networkcloud baremetalmachine run-read-command` to run diagnostic commands on a BMM.
4+
author: eak13
5+
ms.author: ekarandjeff
6+
ms.service: azure
7+
ms.topic: how-to
8+
ms.date: 03/23/2023
9+
ms.custom: template-how-to
10+
---
11+
12+
# Troubleshoot BMM issues using the `az networkcloud baremetalmachine run-read-command`
13+
14+
There may be situations where a user needs to investigate & resolve issues with an on-premises 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.
15+
16+
The command execution will produce an output file containing the results that can be found in the Cluster Manager's Storage account.
17+
18+
## Prerequisites
19+
20+
1. Install the latest version of the
21+
[appropriate CLI extensions](./howto-install-cli-extensions.md)
22+
1. Ensure that the target BMM must have its `poweredState` set to `On` and have its `readyState` set to `True`
23+
1. Get the Resource group name that you created for `Cluster` resource
24+
25+
26+
## Executing a run-read command
27+
28+
The run-read command will execute a read-only command on the specified BMM.
29+
30+
The current list of supported commands are:
31+
32+
- `traceroute`
33+
- `ping`
34+
- `arp`
35+
- `tcpdump`
36+
- `brctl show`
37+
- `dmidecode`
38+
- `host`
39+
- `ip link show`
40+
- `ip address show`
41+
- `ip maddress show`
42+
- `ip route show`
43+
- `journalctl`
44+
- `kubectl logs`
45+
- `kubectl describe`
46+
- `kubectl get`
47+
- `kubectl api-resources`
48+
- `kubectl api-versions`
49+
- `uname`
50+
- `uptime`
51+
- `fdisk -l`
52+
- `hostname`
53+
- `ifconfig -a`
54+
- `ifconfig -s`
55+
- `mount`
56+
- `ss`
57+
- `ulimit -a`
58+
59+
The command syntax is:
60+
61+
```azurecli
62+
az networkcloud baremetalmachine run-read-command --name "<machine-name>"
63+
--limit-time-seconds <timeout> \
64+
--commands arguments="<arg1>" arguments="<arg2>" command="<command>" --resource-group "<resourceGroupName>" \
65+
--subscription "<subscription>" \
66+
--debug
67+
```
68+
69+
These commands to not require `arguments`:
70+
71+
- `fdisk -l`
72+
- `hostname`
73+
- `ifconfig -a`
74+
- `ifconfig -s`
75+
- `mount`
76+
- `ss`
77+
- `ulimit -a`
78+
79+
All other inputs are required. Multiple commands are each specified with their own `--commands` option.
80+
81+
Each `--commands` option specifies `command` and `arguments`. For a command with multiple arguments, `arguments` is repeated for each one.
82+
83+
`--debug` is required to get the operation status that can be queried to get the URL for the output file.
84+
85+
### This example will execute the `hostname` command and a `ping` command.
86+
87+
```azurecli
88+
az networkcloud baremetalmachine run-read-command --name "bareMetalMachineName" \
89+
--limit-time-seconds 60 \
90+
--commands command="hostname" \
91+
--commands arguments="192.168.0.99" arguments="-c" arguments="3" command="ping" \
92+
--resource-group "resourceGroupName" \
93+
--subscription "<subscription>" \
94+
--debug
95+
```
96+
97+
In the response, an HTTP status code of 202 is returned as the operation is performed asynchronously.
98+
99+
## Checking command status and viewing output
100+
101+
The debug output of the command execution will contain the 'Azure-AsyncOperation' response header. Note the URL provided.
102+
103+
```azurecli
104+
cli.azure.cli.core.sdk.policies: 'Azure-AsyncOperation': 'https://management.azure.com/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/providers/Microsoft.NetworkCloud/locations/EASTUS/operationStatuses/0797fdd7-28eb-48ec-8c70-39a3f893421d*A0123456789F331FE47B40E2BFBCE2E133FD3ED2562348BFFD8388A4AAA1271?api-version=2022-09-30-preview'
105+
```
106+
107+
Check the status of the operation with the `az rest` command:
108+
109+
```azurecli
110+
az rest --method get --url <Azure-AsyncOperation-URL>
111+
```
112+
113+
Repeat until the response to the URL displays the result of the run-read-command.
114+
115+
Sample output looks something like this. The `Succeeded` `status` indicates the command was executed on the BMM. The `resultUrl` provides a link to the zipped output file that contains the output from the command execution. The tar.gz file name can be used to identify the file in the Storage account of the Cluster Manager resource group.
116+
117+
See [How To BareMetal Review Output Run-Read](howto-baremetal-review-read-output.md) for instructions on locating the output file in the Storage Account. You can also use the link to directly access the output zip file.
118+
119+
```azurecli
120+
az rest --method get --url https://management.azure.com/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/providers/Microsoft.NetworkCloud/locations/EASTUS/operationStatuses/932a8fe6-12ef-419c-bdc2-5bb11a2a071d*C0123456789E735D5D572DECFF4EECE2DFDC121CC3FC56CD50069249183110F?api-version=2022-09-30-preview
121+
{
122+
"endTime": "2023-03-01T12:38:10.8582635Z",
123+
"error": {},
124+
"id": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/providers/Microsoft.NetworkCloud/locations/EASTUS/operationStatuses/932a8fe6-12ef-419c-bdc2-5bb11a2a071d*C0123456789E735D5D572DECFF4EECE2DFDC121CC3FC56CD50069249183110F",
125+
"name": "932a8fe6-12ef-419c-bdc2-5bb11a2a071d*C0123456789E735D5D572DECFF4EECE2DFDC121CC3FC56CD50069249183110F",
126+
"properties": {
127+
"exitCode": "15",
128+
"outputHead": "====Action Command Output====",
129+
"resultUrl": "https://cmnvc94zkjhvst.blob.core.windows.net/bmm-run-command-output/af4fea82-294a-429e-9d1e-e93d54f4ea24-action-bmmruncmd.tar.gz?se=2023-03-01T16%3A38%3A07Z&sig=Lj9MS01234567898fn4qb2E1HORGh260EHdRrCJTJg%3D&sp=r&spr=https&sr=b&st=2023-03-01T12%3A38%3A07Z&sv=2019-12-12"
130+
},
131+
"resourceId": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/m01-xx-HostedResources-xx/providers/Microsoft.NetworkCloud/bareMetalMachines/m01r750wkr3",
132+
"startTime": "2023-03-01T12:37:48.2823434Z",
133+
"status": "Succeeded"
134+
}
135+
```

0 commit comments

Comments
 (0)