Skip to content

Commit b35b995

Browse files
Merge pull request #288559 from eak13/main
Updates for BYOSA being in preview
2 parents 6a18192 + 4960616 commit b35b995

File tree

2 files changed

+212
-70
lines changed

2 files changed

+212
-70
lines changed

articles/operator-nexus/howto-baremetal-run-data-extract.md

Lines changed: 97 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
22
title: Troubleshoot bare metal machine issues using the `az networkcloud baremetalmachine run-data-extract` command for Azure Operator Nexus
33
description: Step by step guide on using the `az networkcloud baremetalmachine run-data-extract` to extract data from a bare metal machine for troubleshooting and diagnostic purposes.
4-
author: DanCrank
5-
ms.author: danielcrank
4+
author: eak13
5+
ms.author: ekarandjeff
66
ms.service: azure-operator-nexus
77
ms.topic: how-to
8-
ms.date: 10/11/2024
8+
ms.date: 10/16/2024
99
ms.custom: template-how-to, devx-track-azurecli
1010
---
1111

1212
# Troubleshoot bare metal machine issues using the `az networkcloud baremetalmachine run-data-extract` command
1313

1414
There might be situations where a user needs to investigate and resolve issues with an on-premises bare metal machine. Azure Operator Nexus provides a prescribed set of data extract commands via `az networkcloud baremetalmachine run-data-extract`. These commands enable users to get diagnostic data from a bare metal machine.
1515

16-
The command produces an output file containing the results of the data extract. Users should configure the Cluster resource with a storage account and identity that has access to the storage account to receive the output. There's a deprecated method of sending data to the Cluster Manager storage account if a storage account hasn't been provided on the Cluster. The Cluster Manager's storage account will be disabled in a future release as using a separate storage account is more secure.
16+
The command produces an output file containing the results of the data extract. 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.
1717

1818
## Prerequisites
1919

@@ -22,17 +22,51 @@ The command produces an output file containing the results of the data extract.
2222
- The syntax for these commands is based on the 0.3.0+ version of the `az networkcloud` CLI.
2323
- Get the Cluster Managed Resource group name (cluster_MRG) that you created for Cluster resource.
2424

25-
## Create and configure storage resources (customer-managed storage)
25+
## Verify access to the Cluster Manager storage account
26+
27+
> [!NOTE]
28+
> The Cluster Manager storage account output method will be deprecated in the future once Cluster on-boarding to Trusted Services is complete and the user managed storage option is fully supported.
29+
30+
If using the Cluster Manager storage method, verify you have access to the Cluster Manager's storage account:
31+
32+
1. From Azure portal, navigate to Cluster Manager's Storage account.
33+
1. In the Storage account details, select **Storage browser** from the navigation menu on the left side.
34+
1. In the Storage browser details, select on **Blob containers**.
35+
1. If you encounter a `403 This request is not authorized to perform this operation.` while accessing the storage account, storage account’s firewall settings need to be updated to include the public IP address.
36+
1. Request access by creating a support ticket via Portal on the Cluster Manager resource. Provide the public IP address that requires access.
37+
38+
## **PREVIEW:** Send command output to a user specified storage account
39+
40+
> [!IMPORTANT]
41+
> Please note that this method of specifying a user storage account for command output is in preview. **This method should only be used with user storage accounts that do not have firewall enabled.** If your environment requires the storage account firewall be enabled, use the existing Cluster Manager output method.
42+
43+
### Create and configure storage resources
2644

2745
1. Create a storage account, or identify an existing storage account that you want to use. See [Create an Azure storage account](/azure/storage/common/storage-account-create?tabs=azure-portal).
28-
2. In the storage account, create a blob storage container. See [Create a container](/azure/storage/blobs/storage-quickstart-blobs-portal#create-a-container).
29-
3. Assign the "Storage Blob Data Contributor" role to users and managed identities which need access to the run-data-extract output. See [Assign an Azure role for access to blob data](/azure/storage/blobs/assign-azure-role-data-access?tabs=portal). The role must also be assigned to either a user-assigned managed identity or the cluster's own system-assigned managed identity. For more information on managed identities, see [Managed identities for Azure resources](/entra/identity/managed-identities-azure-resources/overview).
46+
1. Create a blob storage container in the storage account. See [Create a container](/azure/storage/blobs/storage-quickstart-blobs-portal#create-a-container).
47+
1. Assign the "Storage Blob Data Contributor" role to users and managed identities which need access to the run-data-extract output.
48+
1. See [Assign an Azure role for access to blob data](/azure/storage/blobs/assign-azure-role-data-access?tabs=portal). The role must also be assigned to either a user-assigned managed identity or the cluster's own system-assigned managed identity.
49+
1. For more information on managed identities, see [Managed identities for Azure resources](/entra/identity/managed-identities-azure-resources/overview).
50+
1. If using the Cluster's system assigned identity, the system assigned identity needs to be added to the cluster before it can be granted access.
51+
1. When assigning a role to the cluster's system-assigned identity, make sure you select the resource with the type "Cluster (Operator Nexus)."
3052

31-
When assigning a role to the cluster's system-assigned identity, make sure you select the resource with the type "Cluster (Operator Nexus)."
53+
### Configure the cluster to use a user-assigned managed identity for storage access
3254

33-
## Configure the cluster to use a user-assigned managed identity for storage access
55+
Use this command to create a cluster with a user managed storage account and user-assigned identity. Note this example is an abbreviated command that just highlights the fields pertinent for adding the user managed storage. It isn't the full cluster create command.
3456

35-
Use this command to configure the cluster for a user-assigned identity:
57+
```azurecli-interactive
58+
az networkcloud cluster create --name "<cluster-name>" \
59+
--resource-group "<cluster-resource-group>" \
60+
...
61+
--mi-user-assigned "<user-assigned-identity-resource-id>" \
62+
--command-output-settings identity-type="UserAssignedIdentity" \
63+
identity-resource-id="<user-assigned-identity-resource-id>" \
64+
container-url="<container-url>" \
65+
...
66+
--subscription "<subscription>"
67+
```
68+
69+
Use this command to configure an existing cluster for a user provided storage account and user-assigned identity. The update command can also be used to change the storage account location and identity if needed.
3670

3771
```azurecli-interactive
3872
az networkcloud cluster update --name "<cluster-name>" \
@@ -44,11 +78,22 @@ az networkcloud cluster update --name "<cluster-name>" \
4478
--subscription "<subscription>"
4579
```
4680

47-
The identity resource ID can be found by clicking "JSON view" on the identity resource; the ID is at the top of the panel that appears. The container URL can be found on the Settings -> Properties tab of the container resource.
81+
### Configure the cluster to use a system-assigned managed identity for storage access
4882

49-
## Configure the cluster to use a system-assigned managed identity for storage access
83+
Use this command to create a cluster with a user managed storage account and system assigned identity. Note this example is an abbreviated command that just highlights the fields pertinent for adding the user managed storage. It isn't the full cluster create command.
5084

51-
Use this command to configure the cluster to use its own system-assigned identity:
85+
```azurecli-interactive
86+
az networkcloud cluster create --name "<cluster-name>" \
87+
--resource-group "<cluster-resource-group>" \
88+
...
89+
--mi-system-assigned true \
90+
--command-output-settings identity-type="SystemAssignedIdentity" \
91+
container-url="<container-url>" \
92+
...
93+
--subscription "<subscription>"
94+
```
95+
96+
Use this command to configure an existing cluster for a user provided storage account and to use its own system-assigned identity. The update command can also be used to change the storage account location.
5297

5398
```azurecli-interactive
5499
az networkcloud cluster update --name "<cluster-name>" \
@@ -61,7 +106,7 @@ az networkcloud cluster update --name "<cluster-name>" \
61106

62107
To change the cluster from a user-assigned identity to a system-assigned identity, the CommandOutputSettings must first be cleared using the command in the next section, then set using this command.
63108

64-
## Clear the cluster's CommandOutputSettings
109+
### Clear the cluster's CommandOutputSettings
65110

66111
The CommandOutputSettings can be cleared, directing run-data-extract output back to the cluster manager's storage. However, it isn't recommended since it's less secure, and the option will be removed in a future release.
67112

@@ -75,15 +120,41 @@ az rest --method patch \
75120
--body '{"properties": {"commandOutputSettings":null}}'
76121
```
77122

78-
## Verify Storage Account access (cluster manager storage)
123+
### View the principal ID for the managed identity
79124

80-
If using the deprecated Cluster Manager storage method, verify you have access to the Cluster Manager's storage account
125+
The identity resource ID can be found by selecting "JSON view" on the identity resource; the ID is at the top of the panel that appears. The container URL can be found on the Settings -> Properties tab of the container resource.
81126

82-
1. From Azure portal, navigate to Cluster Manager's Storage account.
83-
1. In the Storage account details, select **Storage browser** from the navigation menu on the left side.
84-
1. In the Storage browser details, select on **Blob containers**.
85-
1. If you encounter a `403 This request is not authorized to perform this operation.` while accessing the storage account, storage account’s firewall settings need to be updated to include the public IP address.
86-
1. Request access by creating a support ticket via Portal on the Cluster Manager resource. Provide the public IP address that requires access.
127+
The CLI can also be used to view the identity and the associated principal ID data within the cluster.
128+
129+
Example:
130+
131+
```console
132+
az networkcloud cluster show --ids /subscriptions/<Subscription ID>/resourceGroups/<Cluster Resource Group Name>/providers/Microsoft.NetworkCloud/clusters/<Cluster Name>
133+
```
134+
135+
System-assigned identity example:
136+
137+
```
138+
"identity": {
139+
"principalId": "2cb564c1-b4e5-4c71-bbc1-6ae259aa5f87",
140+
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
141+
"type": "SystemAssigned"
142+
},
143+
```
144+
145+
User-assigned identity example:
146+
147+
```
148+
"identity": {
149+
"type": "UserAssigned",
150+
"userAssignedIdentities": {
151+
"/subscriptions/<subscriptionID>/resourcegroups/<resourceGroupName>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<userAssignedIdentityName>": {
152+
"clientId": "e67dd610-99cf-4853-9fa0-d236b214e984",
153+
"principalId": "8e6d23d6-bb6b-4cf3-a00f-4cd640ab1a24"
154+
}
155+
}
156+
},
157+
```
87158

88159
## Execute a run command
89160

@@ -136,7 +207,7 @@ In the response, the operation performs asynchronously and returns an HTTP statu
136207

137208
### Hardware Support Data Collection
138209

139-
This example executes the `hardware-support-data-collection` command and get `SysInfo` and `TTYLog` logs from the Dell Server. The script executes a `racadm supportassist collect` command on the designated baremetal machine. The resulting tar.gz file contains the zipped extract command file outputs in `hardware-support-data-<timestamp>.zip`.
210+
This example executes the `hardware-support-data-collection` command and get `SysInfo` and `TTYLog` logs from the Dell Server. The script executes a `racadm supportassist collect` command on the designated bare metal machine. The resulting tar.gz file contains the zipped extract command file outputs in `hardware-support-data-<timestamp>.zip`.
140211

141212
```azurecli
142213
az networkcloud baremetalmachine run-data-extract --name "bareMetalMachineName" \
@@ -202,7 +273,7 @@ Archive: TSR20240227164024_FM56PK3.pl.zip
202273
Data is collected with the `mde-agent-information` command and formatted as JSON
203274
to `/hostfs/tmp/runcommand/mde-agent-information.json`. The JSON file is found
204275
in the data extract zip file located in the storage account. The script executes a
205-
sequence of `mdatp` commands on the designated baremetal machine.
276+
sequence of `mdatp` commands on the designated bare metal machine.
206277

207278
This example executes the `mde-agent-information` command without arguments.
208279

@@ -591,12 +662,12 @@ https://cmkfjft8twwpst.blob.core.windows.net/bmm-run-command-output/20b217b5-ea3
591662

592663
The CVE data is refreshed per container image every 24 hours or when there's a change to the Kubernetes resource referencing the image.
593664

594-
## Viewing the Output
665+
## Viewing the output
595666

596-
The command provides another command (if using customer provided storage) or a link (if using cluster manager storage) to download the full output. The tar.gz file also contains the zipped extract command file outputs. Download the output file from the storage blob to a local directory by specifying the directory path in the optional argument `--output-directory`.
667+
The command provides a link (if using cluster manager storage) or another command (if using user provided storage) to download the full output. The tar.gz file also contains the zipped extract command file outputs. Download the output file from the storage blob to a local directory by specifying the directory path in the optional argument `--output-directory`.
597668

598669
> [!WARNING]
599670
> Using the `--output-directory` argument will overwrite any files in the local directory that have the same name as the new files being created.
600671
601672
> [!NOTE]
602-
> Storage Account could be locked resulting in `403 This request is not authorized to perform this operation.` due to networking or firewall restrictions. Refer to the [customer-managed storage](#create-and-configure-storage-resources-customer-managed-storage) or [cluster manager storage](#verify-storage-account-access-cluster-manager-storage) sections for procedures to verify access.
673+
> Storage Account could be locked resulting in `403 This request is not authorized to perform this operation.` due to networking or firewall restrictions. Refer to the [cluster manager storage](#verify-access-to-the-cluster-manager-storage-account) or the [user managed storage](#create-and-configure-storage-resources) sections for procedures to verify access.

0 commit comments

Comments
 (0)