You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/chaos-studio/chaos-studio-fault-library.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -817,7 +817,7 @@ These sample values produced ~100% disk pressure when tested on a `Standard_D2s_
817
817
| Prerequisites |**Linux**: The **stress-ng** utility needs to be installed. Installation happens automatically as part of agent installation, using the default package manager, on several operating systems including Debian-based (like Ubuntu), Red Hat Enterprise Linux, and OpenSUSE. For other distributions, including Azure Linux, you must install **stress-ng** manually. For more information, see the [upstream project repository](https://github.com/ColinIanKing/stress-ng). |
818
818
| Urn | urn:csci:microsoft:agent:stressNg/1.0 |
819
819
| Parameters (key, value) ||
820
-
| stressNgArguments | One or more arguments to pass to the stress-ng process. For information on possible stress-ng arguments, see the [stress-ng](https://wiki.ubuntu.com/Kernel/Reference/stress-ng) article. |
820
+
| stressNgArguments | One or more arguments to pass to the stress-ng process. For information on possible stress-ng arguments, see the [stress-ng](https://wiki.ubuntu.com/Kernel/Reference/stress-ng) article. **NOTE: Do NOT include the "-t " argument because it will cause an error. Experiment length is defined directly in the Azure chaos experiment UI, NOT in the stressNgArguments.**|
Copy file name to clipboardExpand all lines: articles/chaos-studio/chaos-studio-tutorial-aks-cli.md
+25-16Lines changed: 25 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,9 @@ title: Create a chaos experiment using a Chaos Mesh fault with Azure CLI
3
3
description: Create an experiment that uses an AKS Chaos Mesh fault by using Azure Chaos Studio with the Azure CLI.
4
4
author: prasha-microsoft
5
5
ms.topic: how-to
6
-
ms.date: 04/21/2022
6
+
ms.date: 04/25/2024
7
7
ms.author: abbyweisberg
8
-
ms.reviewer: prashabora
8
+
ms.reviewer: nikhilkaul
9
9
ms.service: chaos-studio
10
10
ms.custom: template-how-to, devx-track-azurecli
11
11
ms.devlang: azurecli
@@ -75,25 +75,27 @@ You can also [use the installation instructions on the Chaos Mesh website](https
75
75
76
76
Chaos Studio can't inject faults against a resource unless that resource is added to Chaos Studio first. To add a resource to Chaos Studio, create a [target and capabilities](chaos-studio-targets-capabilities.md) on the resource. AKS clusters have only one target type (service-direct), but other resources might have up to two target types. One target type is for service-direct faults. Another target type is for agent-based faults. Each type of Chaos Mesh fault is represented as a capability like PodChaos, NetworkChaos, and IOChaos.
77
77
78
-
1. Create a target by replacing `$RESOURCE_ID`with the resource ID of the AKS cluster you're adding.
78
+
1. Create a target by replacing `$SUBSCRIPTION_ID`, `$resourceGroupName`, and `$AKS_CLUSTER_NAME`with the relevant strings of the AKS cluster you're adding.
79
79
80
80
```azurecli-interactive
81
-
az rest --method put --url "https://management.azure.com/$RESOURCE_ID/providers/Microsoft.Chaos/targets/Microsoft-AzureKubernetesServiceChaosMesh?api-version=2023-11-01" --body "{\"properties\":{}}"
81
+
az rest --method put --url "https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$resourceGroupName/providers/Microsoft.ContainerService/managedClusters/$AKS_CLUSTER_NAME/providers/Microsoft.Chaos/targets/Microsoft-AzureKubernetesServiceChaosMesh?api-version=2024-01-01" --body "{\"properties\":{}}"
82
82
```
83
83
84
-
1. Create the capabilities on the target by replacing `$RESOURCE_ID` with the resource ID of the AKS cluster you're adding. Replace `$CAPABILITY` with the [name of the fault capability you're enabling](chaos-studio-fault-library.md).
84
+
2. Create the capabilities on the target by replacing `$SUBSCRIPTION_ID`, `$resourceGroupName`, and `$AKS_CLUSTER_NAME` with the relevant strings of the AKS cluster you're adding.
85
+
86
+
Replace `$CAPABILITY` with the ["Capability Name" of the fault you're adding](chaos-studio-fault-library.md).
85
87
86
-
```azurecli-interactive
87
-
az rest --method put --url "https://management.azure.com/$RESOURCE_ID/providers/Microsoft.Chaos/targets/Microsoft-AzureKubernetesServiceChaosMesh/capabilities/$CAPABILITY?api-version=2023-11-01" --body "{\"properties\":{}}"
88
-
```
88
+
```azurecli-interactive
89
+
az rest --method put --url "https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$resourceGroupName/providers/Microsoft.ContainerService/managedClusters/$AKS_CLUSTER_NAME/providers/Microsoft.Chaos/targets/Microsoft-AzureKubernetesServiceChaosMesh/capabilities/$CAPABILITY?api-version=2024-01-01" --body "{\"properties\":{}}"
90
+
```
89
91
90
-
For example, if you're enabling the `PodChaos` capability:
92
+
**Here's an example of enabling the `PodChaos` capability for your reference:**
91
93
92
-
```azurecli-interactive
93
-
az rest --method put --url "https://management.azure.com/subscriptions/b65f2fec-d6b2-4edd-817e-9339d8c01dc4/resourceGroups/myRG/providers/Microsoft.ContainerService/managedClusters/myCluster/providers/Microsoft.Chaos/targets/Microsoft-AzureKubernetesServiceChaosMesh/capabilities/PodChaos-2.1?api-version=2023-11-01" --body "{\"properties\":{}}"
94
-
```
94
+
```azurecli-interactive
95
+
az rest --method put --url "https://management.azure.com/subscriptions/b65f2fec-d6b2-4edd-817e-9339d8c01dc4/resourceGroups/myRG/providers/Microsoft.ContainerService/managedClusters/myCluster/providers/Microsoft.Chaos/targets/Microsoft-AzureKubernetesServiceChaosMesh/capabilities/PodChaos-2.1?api-version=2024-01-01" --body "{\"properties\":{}}"
96
+
```
95
97
96
-
This step must be done for each capability you want to enable on the cluster.
98
+
This step must be done for **each*** capability you want to enable on the cluster.
97
99
98
100
You've now successfully added your AKS cluster to Chaos Studio.
99
101
@@ -202,10 +204,17 @@ Now you can create your experiment. A chaos experiment defines the actions you w
202
204
## Give the experiment permission to your AKS cluster
203
205
When you create a chaos experiment, Chaos Studio creates a system-assigned managed identity that executes faults against your target resources. This identity must be given [appropriate permissions](chaos-studio-fault-providers.md) to the target resource for the experiment to run successfully.
204
206
205
-
Give the experiment access to your resources by using the following command. Replace `$EXPERIMENT_PRINCIPAL_ID` with the principal ID from the previous step. Replace `$RESOURCE_ID` with the resource ID of the target resource. In this case, it's the AKS cluster resource ID. Run this command for each resource targeted in your experiment.
207
+
1. Retrieve the `$EXPERIMENT_PRINCIPAL_ID` by running the following command and copying the `PrincipalID` from the response. Replace `$SUBSCRIPTION_ID`, `$RESOURCE_GROUP`, and `$EXPERIMENT_NAME` with the properties for your experiment.
208
+
209
+
```azurecli-interactive
210
+
az rest --method get --uri https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.Chaos/experiments/$EXPERIMENT_NAME?api-version=2024-01-01
211
+
```
212
+
213
+
2. Give the experiment access to your resources by using the following command. Replace `$EXPERIMENT_PRINCIPAL_ID` with the principal ID from the previous step. Replace `$SUBSCRIPTION_ID`, `$resourceGroupName`, and `$AKS_CLUSTER_NAME` with the relevant strings of the AKS cluster.
214
+
206
215
207
216
```azurecli-interactive
208
-
az role assignment create --role "Azure Kubernetes Service Cluster Admin Role" --assignee-object-id $EXPERIMENT_PRINCIPAL_ID --scope $RESOURCE_ID
217
+
az role assignment create --role "Azure Kubernetes Service Cluster Admin Role" --assignee-object-id $EXPERIMENT_PRINCIPAL_ID --scope subscriptions/$SUBSCRIPTION_ID/resourceGroups/$resourceGroupName/providers/Microsoft.ContainerService/managedClusters/$AKS_CLUSTER_NAME
209
218
```
210
219
211
220
## Run your experiment
@@ -214,7 +223,7 @@ You're now ready to run your experiment. To see the effect, we recommend that yo
214
223
1. Start the experiment by using the Azure CLI. Replace `$SUBSCRIPTION_ID`, `$RESOURCE_GROUP`, and `$EXPERIMENT_NAME` with the properties for your experiment.
215
224
216
225
```azurecli-interactive
217
-
az rest --method post --uri https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.Chaos/experiments/$EXPERIMENT_NAME/start?api-version=2023-11-01
226
+
az rest --method post --uri https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.Chaos/experiments/$EXPERIMENT_NAME/start?api-version=2024-01-01
218
227
```
219
228
220
229
1. The response includes a status URL that you can use to query experiment status as the experiment runs.
Copy file name to clipboardExpand all lines: articles/chaos-studio/troubleshooting.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,6 +132,10 @@ This error might happen if you added the agent by using the Azure portal, which
132
132
133
133
To resolve this problem, go to the VM or virtual machine scale set in the Azure portal and go to **Identity**. Open the **User assigned** tab and add your user-assigned identity to the VM. After you're finished, you might need to reboot the VM for the agent to connect.
134
134
135
+
### My agent-based fault failed with the error "Agent is already performing another task"
136
+
137
+
This error will happen if you try to run multiple agent faults at the same time. Today the agent only supports running a single agent-fault at a time, and will fail if you define an experiment that runs multiple agent faults at the same time.
138
+
135
139
## Problems when setting up a managed identity
136
140
137
141
### When I try to add a system-assigned/user-assigned managed identity to my existing experiment, it fails to save.
0 commit comments