Skip to content

Commit a703b91

Browse files
author
priya shet
committed
NetworkCloud - How to docs updated based on latest CLI changes (12-12)
1 parent 7b23f7d commit a703b91

6 files changed

+90
-118
lines changed

articles/operator-nexus/howto-baremetal-review-read-output.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.date: 03/23/2023
99
ms.custom: template-how-to
1010
---
1111

12-
# How to view the output of an `az networkcloud run-read-command` in the Cluster Manager Storage account
12+
# How to view the output of an `az networkcloud baremetalmachine run-read-command` in the Cluster Manager Storage account
1313

1414
This guide walks 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.
1515

articles/operator-nexus/howto-baremetal-run-read.md

Lines changed: 25 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,13 @@ The command syntax is:
6060
```azurecli
6161
az networkcloud baremetalmachine run-read-command --name "<machine-name>"
6262
--limit-time-seconds <timeout> \
63-
--commands arguments="<arg1>" arguments="<arg2>" command="<command>" --resource-group "<resourceGroupName>" \
63+
--commands '[{"command":"<command1>"},{"command":"<command2>","arguments":["<arg1>","<arg2>"]}]' \
64+
--resource-group "<resourceGroupName>" \
6465
--subscription "<subscription>" \
6566
--debug
6667
```
6768

68-
These commands to not require `arguments`:
69+
These commands do not require `arguments`:
6970

7071
- `fdisk -l`
7172
- `hostname`
@@ -75,60 +76,48 @@ These commands to not require `arguments`:
7576
- `ss`
7677
- `ulimit -a`
7778

78-
All other inputs are required. Multiple commands are each specified with their own `--commands` option.
79+
All other inputs are required.
7980

80-
Each `--commands` option specifies `command` and `arguments`. For a command with multiple arguments, `arguments` is repeated for each one.
81+
Multiple commands can be provided in json format to `--commands` option. Each `command` specifies command and the arguments.
8182

82-
`--debug` is required to get the operation status that can be queried to get the URL for the output file.
83+
For a command with multiple arguments, provide as a list to `arguments` parameter. See [Azure CLI Shorthand](https://github.com/Azure/azure-cli/blob/dev/doc/shorthand_syntax.md) for instructions on constructing the `--commands` structure.
84+
85+
These commands can be long running so the recommendation is to set `--limit-time-seconds` to at least 600 seconds (10 minutes). The `Debug` option or running multiple extracts might take longer that 10 minutes.
86+
87+
This command runs synchronously. If you wish to skip waiting for the command to complete, specify the `--no-wait` option.
8388

8489
### This example executes the `hostname` command and a `ping` command.
8590

8691
```azurecli
8792
az networkcloud baremetalmachine run-read-command --name "bareMetalMachineName" \
8893
--limit-time-seconds 60 \
89-
--commands command="hostname" \
90-
--commands arguments="192.168.0.99" arguments="-c" arguments="3" command="ping" \
94+
--commands '[{"command":"hostname"],"arguments":["192.168.0.99","-c","3"]},{"command":"ping"}]' \
9195
--resource-group "resourceGroupName" \
92-
--subscription "<subscription>" \
93-
--debug
96+
--subscription "<subscription>"
9497
```
9598

9699
In the response, an HTTP status code of 202 is returned as the operation is performed asynchronously.
97100

98101
## Checking command status and viewing output
99102

100-
The debug output of the command execution contains the 'Azure-AsyncOperation' response header. Note the URL provided.
101-
102-
```azurecli
103-
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'
104-
```
105103

106-
Check the status of the operation with the `az rest` command:
104+
Sample output looks something like this and provides a link to the zipped output file(tar.gz) 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. You can also use the link to directly access the output zip file. Download the output file from storage blob to a local directory by specifying the directory path in the optional argument `--output-directory`.
107105

108106
```azurecli
109-
az rest --method get --url <Azure-AsyncOperation-URL>
110-
```
107+
====Action Command Output====
108+
+ hostname
109+
rack1compute01
110+
+ ping 192.168.0.99 -c 3
111+
PING 192.168.0.99 (192.168.0.99) 56(84) bytes of data.
111112
112-
Repeat until the response to the URL displays the result of the run-read-command.
113+
--- 192.168.0.99 ping statistics ---
114+
3 packets transmitted, 0 received, 100% packet loss, time 2049ms
113115
114-
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.
115116
116-
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.
117117
118-
```azurecli
119-
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
120-
{
121-
"endTime": "2023-03-01T12:38:10.8582635Z",
122-
"error": {},
123-
"id": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/providers/Microsoft.NetworkCloud/locations/EASTUS/operationStatuses/932a8fe6-12ef-419c-bdc2-5bb11a2a071d*C0123456789E735D5D572DECFF4EECE2DFDC121CC3FC56CD50069249183110F",
124-
"name": "932a8fe6-12ef-419c-bdc2-5bb11a2a071d*C0123456789E735D5D572DECFF4EECE2DFDC121CC3FC56CD50069249183110F",
125-
"properties": {
126-
"exitCode": "15",
127-
"outputHead": "====Action Command Output====",
128-
"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"
129-
},
130-
"resourceId": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/m01-xx-HostedResources-xx/providers/Microsoft.NetworkCloud/bareMetalMachines/m01r750wkr3",
131-
"startTime": "2023-03-01T12:37:48.2823434Z",
132-
"status": "Succeeded"
133-
}
118+
================================
119+
Script execution result can be found in storage account:
120+
https://cm49vr6vnc6kst.blob.core.windows.net/bmm-run-command-output/a8e0a5fe-3279-46a8-b995-51f2f98a18dd-action-bmmrunreadcmd.tar.gz?se=2023-04-14T06%3A37%3A00Z&sig=ZlN6t%2F534OpmEE545Xie7feHupKSU4v6XYfZTKG6WVo%3D&sp=r&spr=https&sr=b&st=2023-04-14T02%3A37%3A00Z&sv=2019-12-12
134121
```
122+
123+
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.

articles/operator-nexus/howto-cluster-manager.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Some arguments that are available for every Azure CLI command
5151

5252
## Create a Cluster Manager
5353

54-
Use the `az network clustermanager create` command to create a Cluster Manager. This command creates a new Cluster Manager or updates the properties of the Cluster Manager if it exists. If you have multiple Azure subscriptions, select the appropriate subscription ID using the [az account set](/cli/azure/account#az-account-set) command.
54+
Use the `az networkwork clustermanager create` command to create a Cluster Manager. This command creates a new Cluster Manager or updates the properties of the Cluster Manager if it exists. If you have multiple Azure subscriptions, select the appropriate subscription ID using the [az account set](/cli/azure/account#az-account-set) command.
5555

5656
```azurecli
5757
az networkcloud clustermanager create \

articles/operator-nexus/howto-cluster-metrics-configuration-management.md

Lines changed: 50 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -23,106 +23,88 @@ Users can't control the behavior (enable or disable) for collection of these inc
2323
2424
## How to manage cluster metrics configuration
2525

26-
To support the lifecycle of cluster metrics configurations, the following `az rest` interactions allow for the creation and management of a cluster's metrics configurations.
26+
To support the lifecycle of cluster metrics configurations, the following interactions allow for the creation and management of a cluster's metrics configurations.
2727

2828
### Creating a metrics configuration
2929

30-
Use of the `az rest` command requires that the request input is defined, and then a `PUT` request is made to the `Microsoft.NetworkCloud` resource provider.
31-
32-
Define a file with the desired metrics configuration.
30+
Use the `az network cluster metricsconfiguration create` command to create metrics configuration for cluster. If you have multiple Azure subscriptions, select the appropriate subscription ID using the [az account set](/cli/azure/account#az-account-set) command.
31+
32+
```azurecli
33+
az networkcloud cluster metricsconfiguration create \
34+
--cluster-name "<CLUSTER>" \
35+
--extended-location name="<CLUSTER_EXTENDED_LOCATION_ID>" type="CustomLocation" \
36+
--location "<LOCATION>" \
37+
--collection-interval <COLLECTION_INTERVAL (1-1440)> \
38+
--enabled-metrics "<METRIC_TO_ENABLE_1>" "<METRIC_TO_ENABLE_2>" \
39+
--tags <TAG_KEY1>="<TAG_VALUE1>" <TAG_KEY2>="<TAG_VALUE2>" \
40+
--resource-group "<RESOURCE_GROUP>"
41+
```
3342

3443
* Replace values within `<` `>` with your specific information.
3544
* Query the cluster resource and find the value of `<CLUSTER-EXTENDED-LOCATION-ID>` in the `properties.clusterExtendedLocation`
3645
* The `collectionInterval` field is required, `enabledMetrics` is optional and may be omitted.
3746

38-
Example filename: create_metrics_configuration.json
39-
40-
```json
41-
{
42-
"location": "<REGION (example: eastus)>",
43-
"extendedLocation": {
44-
"name": "<CLUSTER-EXTENDED-LOCATION-ID>",
45-
"type": "CustomLocation"
46-
},
47-
"properties": {
48-
"collectionInterval": <COLLECTION-INTERVAL (1-1440)>,
49-
"enabledMetrics": [
50-
"<METRIC-TO-ENABLE-1>",
51-
"<METRIC-TO-ENABLE-2>"
52-
]
53-
}
54-
}
55-
```
56-
5747
> [!NOTE]
5848
> * The default metrics collection interval for standard set of metrics is set to every 5 minutes. Changing the `collectionInterval` will also impact the collection frequency for default standard metrics.
49+
> * There can be only one set of metrics configuration defined per cluster. The resource is created with the name `default`.
5950
60-
The following commands will create the metrics configuration. The only name allowed for the metricsConfiguration is `default`.
61-
62-
```sh
63-
export SUBSCRIPTION=<the subscription id for the cluster>
64-
export RESOURCE_GROUP=<the resource group for the cluster>
65-
export CLUSTER=<the cluter name>
6651

67-
az rest -m put -u "https://management.azure.com/subscriptions/${SUBSCRIPTION}/resourceGroups/${RESOURCE_GROUP}/providers/Microsoft.NetworkCloud/clusters/${CLUSTER}/metricsConfigurations/default?api-version=2022-12-12-preview" -b @create_metrics_configuration.json --debug
68-
```
69-
70-
Specifying `--debug` in REST API will result in the tracking operation status in the returned command output. This operation status can be queried to monitor the progress of the operation. See: [How-to track asynchronous operations](howto-track-async-operations-cli.md).
52+
Specifying `--debug` in az cli command will result in the tracking operation status in the returned command output. This operation status can be queried to monitor the progress of the operation. See: [How-to track asynchronous operations](howto-track-async-operations-cli.md).
7153

7254
## Retrieving a metrics configuration
7355

7456
After a metrics configuration is created, it can be retrieved using a `az rest` command:
7557

76-
```sh
77-
export SUBSCRIPTION=<the subscription id for the cluster>
78-
export RESOURCE_GROUP=<the resource group for the cluster>
79-
export CLUSTER=<the cluter name>
8058

81-
az rest -m get -u "https://management.azure.com/subscriptions/${SUBSCRIPTION}/resourceGroups/${RESOURCE_GROUP}/providers/Microsoft.NetworkCloud/clusters/${CLUSTER}/metricsConfigurations/default?api-version=2022-12-12-preview"
59+
```azurecli
60+
az networkcloud cluster metricsconfiguration show \
61+
--cluster-name "<CLUSTER>" \
62+
--resource-group "<RESOURCE_GROUP>"
8263
```
8364

8465
This command will return a JSON representation of the metrics configuration.
8566

8667
## Updating a metrics configuration
8768

88-
Much like the creation of a metrics configuration, an update can be performed to change the configuration. A file, containing the metrics to be updated, is consumed as an input.
69+
Much like the creation of a metrics configuration, an update can be performed to change the configuration.
8970

90-
Example filename: update_metrics_configuration.json
71+
This command is used to patch properties of the provided metrics configuration of cluster, or update the tags assigned to the metrics configuration.
9172

92-
```json
93-
{
94-
"properties": {
95-
"collectionInterval": <COLLECTION-INTERVAL (1-1440)>,
96-
"enabledMetrics": [
97-
"<METRIC-TO-ENABLE-1>",
98-
"<METRIC-TO-ENABLE-2>"
99-
]
100-
}
101-
}
73+
```azurecli
74+
az networkcloud cluster metricsconfiguration update \
75+
--cluster-name "<CLUSTER>" \
76+
--collection-interval <COLLECTION_INTERVAL (1-1440)> \
77+
--enabled-metrics "<METRIC_TO_ENABLE_1>" "<METRIC_TO_ENABLE_2>" \
78+
--tags <TAG_KEY1>="<TAG_VALUE1>" <TAG_KEY2>="<TAG_VALUE2>" \
79+
--resource-group "<RESOURCE_GROUP>"
10280
```
10381

104-
This file is used as input to an `az rest` command. The change may include either or both of the updatable fields, `collectionInterval` or `enabledMetrics`. The `collectionInterval` can be updated independently of `enabledMetrics`. Omit fields that aren't being changed.
105-
106-
```sh
107-
export SUBSCRIPTION=<the subscription id for the cluster>
108-
export RESOURCE_GROUP=<the resource group for the cluster>
109-
export CLUSTER=<the cluter name>
82+
The change may include either or both of the updatable fields, `collectionInterval` or `enabledMetrics`. The `collectionInterval` can be updated independently of `enabledMetrics`. Omit fields that aren't being changed.
11083

111-
az rest -m put -u "https://management.azure.com/subscriptions/${SUBSCRIPTION}/resourceGroups/${RESOURCE_GROUP}/providers/Microsoft.NetworkCloud/clusters/${CLUSTER}/metricsConfigurations/default?api-version=2022-12-12-preview" -b @update_metrics_configuration.json --debug
112-
```
113-
114-
Specifying `--debug` in REST API will result in the tracking operation status in the returned command output. This operation status can be queried to monitor the progress of the operation. See: [How-to track asynchronous operations](howto-track-async-operations-cli.md).
84+
Specifying `--debug` in az cli will result in the tracking operation status in the returned command output. This operation status can be queried to monitor the progress of the operation. See: [How-to track asynchronous operations](howto-track-async-operations-cli.md).
11585

11686
## Deleting a metrics configuration
11787

118-
Deletion of the metrics configuration will return the cluster to an unaltered configuration. To delete a metrics configuration, `az rest` API is used.
119-
120-
```sh
121-
export SUBSCRIPTION=<the subscription id for the cluster>
122-
export RESOURCE_GROUP=<the resource group for the cluster>
123-
export CLUSTER=<the cluter name>
88+
Deletion of the metrics configuration will return the cluster to an unaltered configuration. To delete a metrics configuration, use the below command:
12489

125-
az rest -m delete -u "https://management.azure.com/subscriptions/${SUBSCRIPTION}/resourceGroups/${RESOURCE_GROUP}/providers/Microsoft.NetworkCloud/clusters/${CLUSTER}/metricsConfigurations/default?api-version=2022-12-12-preview" --debug
90+
```azurecli
91+
az networkcloud cluster metricsconfiguration delete \
92+
--cluster-name "<CLUSTER>" \
93+
--resource-group "<RESOURCE_GROUP>"
12694
```
12795

128-
Specifying `--debug` in REST API will result in the tracking operation status in the returned command output. This operation status can be queried to monitor the progress of the operation. See: [How-to track asynchronous operations](howto-track-async-operations-cli.md).
96+
Specifying `--debug` in az cli will result in the tracking operation status in the returned command output. This operation status can be queried to monitor the progress of the operation. See: [How-to track asynchronous operations](howto-track-async-operations-cli.md).
97+
98+
| Parameter name | Description |
99+
| --------------------------------------| -------------------------------------------------------------------------------------------------- |
100+
| CLUSTER | Resource Name of Cluster |
101+
| LOCATION | The Azure Region where the Cluster will be deployed |
102+
| CLUSTER_EXTENDED_LOCATION_ID | The Cluster extended Location from Azure portal |
103+
| COLLECTION_INTERVAL | The collection frequency for default standard metrics |
104+
| RESOURCE_GROUP | The Cluster resource group name |
105+
| TAG_KEY1 | Optional tag1 to pass to Cluster create |
106+
| TAG_VALUE1 | Optional tag1 value to pass to Cluster Create |
107+
| TAG_KEY2 | Optional tag2 to pass to Cluster create |
108+
| TAG_VALUE2 | Optional tag2 value to pass to Cluster create |
109+
| METRIC_TO_ENABLE_1 | Optional metric1 that have been chosen to be enabled in addition to the default metrics |
110+
| METRIC_TO_ENABLE_2 | Optional metric2 that have been chosen to be enabled in addition to the default metrics |

articles/operator-nexus/howto-configure-cluster.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ az networkcloud cluster show --resource-group "$CLUSTER_RG" \
121121
--resource-name "$CLUSTER_RESOURCE_NAME"
122122
```
123123

124-
The Cluster deployment is complete when the `provisioningState` of the resource
124+
The Cluster creation is complete when the `provisioningState` of the resource
125125
shows: `"provisioningState": "Succeeded"`
126126

127127
### Cluster logging
@@ -133,9 +133,8 @@ Cluster create Logs can be viewed in the following locations:
133133

134134
## Deploy Cluster
135135

136-
Once a Cluster has been created and the Rack Manifests have been added, the
137-
deploy cluster action can be triggered. The deploy Cluster action creates the
138-
bootstrap image and deploys the Cluster.
136+
Once a Cluster has been created, the deploy cluster action can be triggered.
137+
The deploy Cluster action creates the bootstrap image and deploys the Cluster.
139138

140139
Deploy Cluster will initiate a sequence of events to occur in the Cluster Manager
141140

@@ -152,20 +151,20 @@ Deploy the on-premises Cluster:
152151
az networkcloud cluster deploy \
153152
--name "$CLUSTER_NAME" \
154153
--resource-group "$CLUSTER_RESOURCE_GROUP" \
155-
--subscription "$SUBSCRIPTION_ID"
154+
--subscription "$SUBSCRIPTION_ID" \
155+
--no-wait
156156
```
157157

158158
## Cluster deployment validation
159159

160160
View the status of the cluster:
161161

162162
```azurecli
163-
az networkcloud Cluster show --resource-group "$CLUSTER_RG" \
163+
az networkcloud cluster show --resource-group "$CLUSTER_RG" \
164164
--resource-name "$CLUSTER_RESOURCE_NAME"
165165
```
166166

167-
The Cluster deployment is complete when the `provisioningState` of the resource
168-
shows: `"provisioningState": "Succeeded"`
167+
The Cluster deployment is complete when detailedStatus is set to `Running` and detailedStatusMessage shows message `Cluster is up and running`.
169168

170169
## Cluster deployment Logging
171170

0 commit comments

Comments
 (0)