> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/resilience-testing/chaos-testing/experiments/legacy-chaos-studio-deprecated-experiments.md).

# Legacy Chaos Studio (deprecated)

{% @harness-package-selector/package-selector platforms="%5B%7B%22label%22%3A%22Chaos%20Studio%22%2C%22slug%22%3A%22chaos-studio%22%2C%22path%22%3A%22resilience-testing%2Fchaos-testing%2Fexperiments%2Fchaos-studio-experiments%22%7D%2C%7B%22label%22%3A%22Legacy%20Chaos%20Studio%20(deprecated)%22%2C%22slug%22%3A%22legacy-chaos-studio-deprecated%22%2C%22path%22%3A%22resilience-testing%2Fchaos-testing%2Fexperiments%2Flegacy-chaos-studio-deprecated-experiments%22%7D%5D" selectedPlatform="legacy-chaos-studio-deprecated" %}

{% hint style="warning" %}
**LEGACY CHAOS STUDIO DEPRECATED**

The legacy Chaos Studio has been removed. This page is retained for reference only. All new experiments use the current Chaos Studio experience. Legacy infrastructure experiments are read-only and can no longer be edited.
{% endhint %}

### What is a Chaos Experiment? <a href="#what-is-a-chaos-experiment" id="what-is-a-chaos-experiment"></a>

Harness Chaos Engineering gives you the flexibility to create elaborate chaos experiments that help create complex, real-life failure scenarios against which you can validate your applications.

A **chaos experiment** consists of chaos faults arranged in a specific order to create a failure scenario. The chaos faults target various aspects of an application, including the constituent microservices and underlying infrastructure. You can tune the parameters associated with these faults to impart the desired chaos behavior.

You can define the experiment using the Chaos Studio, which helps create new experiments using the guided UI.

{% hint style="info" %}
**RESILIENCE SCORE**

The **resilience score** is a quantitative measure of how resilient your application is to chaos experiments. You can assign weights (1-10) to each fault based on priority, and the score is calculated as a percentage representing overall experiment success weighted by fault importance.
{% endhint %}

***

### Create Chaos Experiment <a href="#create-chaos-experiment" id="create-chaos-experiment"></a>

You can add one or more chaos faults to a chaos experiment and execute it. Different ways of building a chaos experiment are described below:

* [**Blank Canvas**](#using-blank-canvas) - Build the experiment from scratch, adding specific faults you want
* [**Templates from ChaosHubs**](#using-templates-from-chaoshubs) - Select from pre-curated experiment templates available in ChaosHubs
* [**Upload YAML**](#upload-yaml) - Upload an experiment manifest YAML file

#### Using Blank Canvas <a href="#using-blank-canvas" id="using-blank-canvas"></a>

1. On the **Experiment Builder** tab, click **Add** to add a fault to the experiment.

   ![Experiment Builder tab with Add button](/files/GFdHrlpgY5BE8JUUE5LE)
2. Select the fault you want to add to the experiment.

   ![Select Faults](/files/26g5tkrvYJykB7MFXRIN)
3. For each fault, tune the properties:
   * **Specify the target application (for pod-level Kubernetes faults):**

     * **App Namespace**: The namespace where your application is housed
     * **App Kind** or **App Label**: Choose between application type or associated label
       * **App Kind**: Type of target application (deployment, statefulset, daemonset, etc.)
       * **App Label**: Label associated with the target service (e.g., app=nginx)

     ![target app](/files/EzxT6dGoDlddW4sL6shZ)
   * **Tune fault parameters:** Customize chaos duration, ramp time, and fault-specific parameters
   * **Tune Fault Weightage:** Set the weight (1-10) for the fault to determine its importance for resilience score calculation

     ![Tune Fault](/files/L6g20EYAeSQ0MwQaRupj)

#### Using Templates from ChaosHubs <a href="#using-templates-from-chaoshubs" id="using-templates-from-chaoshubs"></a>

1. Select an experiment template from a ChaosHub:

   * Choose **Experiment Type** to see available ChaosHubs
   * Select a template to preview included faults

   ![Fault Templates](/files/7gDGqO8duh9487rhuAa1)

{% hint style="info" %}
**NOTE**

You can edit the template to add more faults or update existing ones.
{% endhint %}

#### Upload YAML <a href="#upload-yaml" id="upload-yaml"></a>

1. Upload an experiment manifest YAML file to create the experiment.

{% hint style="info" %}
**NOTE**

You can edit the experiment to update existing faults or add more.
{% endhint %}

After constructing the chaos experiment, save it:

![Save experiment options](/files/OBICOeEgnKMw2WwPT2Rp)

* Click **Save** to save the experiment to the Chaos Experiments page
* Select **Add Experiment to ChaosHub** to save as a template in a selected ChaosHub

***

### Add Serial and Parallel Faults <a href="#add-serial-and-parallel-faults" id="add-serial-and-parallel-faults"></a>

You can add multiple faults in a single chaos experiment that is scaled efficiently during execution.

{% hint style="info" %}
Consider the overall impact that these faults have on the application. Your experience in production environments may differ due to lack of resources when a number of parallel faults are being executed.
{% endhint %}

1. To add a fault that runs in parallel to another fault, point your mouse below an existing fault, and then select **Add**. You can follow the same process to add a serial fault.

   ![Complex Faults Experiment](/files/Qe3pXkDSHQVaRVNmgDPg)

{% hint style="info" %}
For Linux, experiments with a parallel fault are currently not supported.
{% endhint %}

The image below shows a single experiment that consists of serial and parallel faults:

* Faults **A**, **B**, and **C** are parallel faults. They begin execution at the same time.
* Faults **A**, **B**, **C** and faults **D** and **E** are serial. **A**, **B**, and **C** complete execution and then **D** and **E** begin execution.
* Similarly, faults **H** and **I** are serial faults, where **H** completes execution, and **I** begins.

  ![Complex Faults Experiment](/files/Pv8pOp6nDFLRRJB09bGt)

***

### Analyze Experiment <a href="#analyze-experiment" id="analyze-experiment"></a>

You can observe the status of execution of faults during experiment runs. The screen shows the experiment pipeline on the right side, and details such as **Environment**, **Infrastructure Name**, and the runs that have passed and failed on the left side.

![Experiment Executing](/files/ipICSOlvyvmXXA31tTyj)

When the experiment completes execution, it displays the **Resilience Score**. This score describes how resilient your application is to unplanned failures.

![Experiment Failed](/files/zaz7oDfRz6LLCN6cq1bX)

If any of the faults fail, you can find the **Fail Step** that elaborates on the reason why the fault failed.

![Result Fail Step](/files/beeVr8BwPq1EqzTTykMV)

***

### Advanced Configuration Options <a href="#advanced-configuration-options" id="advanced-configuration-options"></a>

On the Experiment Builder tab, you can click **Advanced Options** to configure advanced settings when creating an experiment for a Kubernetes chaos infrastructure:

![Advanced Options](/files/FULFdlHoxoTr724xia7E)

#### General Options <a href="#general-options" id="general-options"></a>

**Node Selector**

Specify the node on which the experiment pods will be scheduled by providing the node label as a key-value pair.

* This can be used with node-level faults to avoid scheduling the experiment pod on the target node(s).
* It can also be used to limit the scheduling of experiment pods on nodes with an unsupported OS.

  ![Node Selector](/files/GNgivLzJ8I6U7OXXrjgq)

**Toleration**

Specify the tolerations that must be satisfied by a tainted node to schedule the experiment pods. For more information on taints and tolerations, refer to the [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/).

* This can be used with node-level faults to avoid scheduling the experiment pod on the target node(s).
* It can also be used to limit the scheduling of the experiment pods on nodes with an unsupported OS.

  ![Toleration](/files/JqIB9sVabVLY4DrErG5E)

**Annotations**

Specify the annotations to be added to the experiment pods by providing them as key-value pairs. For more information on annotations, refer to the [Kubernetes documentation](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/).

Annotations can be used to bypass network proxies enforced by service mesh tools like Istio.

![Annotations](/files/sCm3Z9J4N4jlbntPaciW)

#### Security Options <a href="#security-options" id="security-options"></a>

**Enable runAsUser**

Specify the user ID to start all the processes in the experiment pod containers. By default, the user ID `1000` is used. This option allows privileged or restricted access for experiment pods.

![runAsUser](/files/TBhnMKwGlrlTfnYiTklJ)

**Enable runAsGroup**

Specify the group ID to start all the processes in the experiment pod containers instead of a user ID. This option allows privileged or restricted access for experiment pods.

![runAsGroup](/files/FCYFOq5HCawtPdzxRhnt)

#### Execute Experiment With Advanced Options <a href="#execute-experiment-with-advanced-options" id="execute-experiment-with-advanced-options"></a>

1. Select one of the advanced security options: **runAsUser** or **runAsGroup**.
2. Click **Security** tab and select/unselect one or both the options.

   ![advanced](/files/KvWP3HWflaRGiEMP21d0)
3. Click **Save**.

   ![save changes](/files/1mb2HxGMxiMY84krpBJQ)

***

### Run & Schedule Experiments <a href="#run-and-schedule-experiments" id="run-and-schedule-experiments"></a>

After configuring your chaos experiment, you can run the experiment immediately by clicking the **Run** button, or schedule it to run at a specific time by selecting the **Schedule** tab.

#### Execute Experiment Once <a href="#execute-experiment-once" id="execute-experiment-once"></a>

* To execute the experiment once, select **Non-Cron (Single run)**, click **Set Schedule**, and then select **Run**.
* To run the experiment once, and at a specific time, select the **Run Once at a specific time**, choose the date and time, click apply, and select **Set Schedule**.

  ![Schedule experiment](/files/7fERWBkemPp4K9PJcjGh)

#### Execute Experiment on a Schedule <a href="#execute-experiment-on-a-schedule" id="execute-experiment-on-a-schedule"></a>

1. To schedule the experiment to run periodically, select **Cron (Recurring run)**, and set the schedule using the **Minutes**, **Hourly**, **Daily**, **Monthly** or **Yearly** options. The **Cron Expression** will be automatically generated.
2. Click **Set Schedule**.

   ![cron experiment](/files/MHYpnj4VDU8JT8dFgwsh)

***

### Edit and Update Chaos Experiment <a href="#edit-and-update-chaos-experiment" id="edit-and-update-chaos-experiment"></a>

You can edit an existing chaos experiment to update the experiment's metadata, faults, schedule, etc. This section describes three actions:

1. [Edit an experiment](#edit-a-chaos-experiment)
2. [Update old experiment manifests](#update-old-experiment-manifests)
3. [Bulk update CRON schedules](#bulk-update-cron-schedules)

#### Edit a Chaos Experiment <a href="#edit-a-chaos-experiment" id="edit-a-chaos-experiment"></a>

1. On the **Chaos Experiments** page, select the **`⋮`** icon against the name of the experiment you want to edit and select **Edit Experiment**.

   ![Edit Experiment](/files/kY1H6dkE7jkmeuh1Zo1m)
2. You can either update the changes to the same experiment and save it or create a copy of the experiment and then apply the changes to it.

   ![save](/files/0xPpOxWprDPuQIcnDUCU)

#### Update Old Experiment Manifests <a href="#update-old-experiment-manifests" id="update-old-experiment-manifests"></a>

When you upgrade the chaos infrastructure, you also need to update the images in the experiment manifest (YAML file) corresponding to the updated chaos infrastructure. The upgraded images should match the images in the Enterprise ChaosHub.

When you create a new experiment, the images in the experiment manifest are configured to match the images in the Enterprise ChaosHub.

**What image versions to use?**

To determine the latest version of images, navigate to Enterprise Chaos Hub, and search for **chaos-go-runner**. The value associated with **chaos-go-runner** in the manifest in Enterprise Chaos Hub is the latest version.

![navigate](/files/caMp8uoMm0I1ysHcxc9w)

To update the experiment manifest, follow the steps below.

1. Select the experiment whose manifest you wish to update, and click the **Experiment Builder** tab.

   ![select](/files/Yn3cRYGYkcrlJcT4iN0Z)
2. The **VISUAL** is usually displayed, click the **YAML** to edit it. Click **Edit Yaml**.

   ![save](/files/dNuEHvSA2QdBifqsKlDy)

   ![save](/files/oGYkPqbKfsn8zIDRAaMl)
3. Find **chaos-go-runner** in the manifest and replace the corresponding version with the latest version.

   ![save](/files/S8uE3siMBnwTmY4rSHTR)
4. Once you update the images, click **Save** at the top right.

   ![save](/files/Quu1NKeP776vFsEAIOlx)

#### Bulk Update CRON Schedules <a href="#bulk-update-cron-schedules" id="bulk-update-cron-schedules"></a>

You can update multiple CRON-scheduled chaos experiments at once.

One important aspect is that you can **bulk update** multiple CRON schedules to a **single value**, that is, the CRON schedules you select to update will all update to a single common value.

You **can't** map different CRON schedules to their respective values while performing a bulk update. You can:

1. Bulk disable active schedules
2. Bulk enable inactive CRON schedules
3. Bulk stop running experiments

To reschedule/enable/disable a CRON schedule,

1. Go to **Chaos Experiments** and select the experiments you wish to change.
2. Choose one of the following options:
   1. **Reschedule CRON**
   2. **Enable CRON**
   3. **Disable CRON**

      ![bulk update](/files/aEeoHX4Koah21uivuLB4)
3. Based on the option you chose,
   * Reschedule CRON: You can change the schedule of the experiments by changing the values, and click **Confirm**.
   * Enable CRON or Disable CRON
     * Select one of the options (enable CRON or disable CRON), and click **Confirm**.
     * You will see a confirmation message on your screen about the updated schedule. Click **Close**.

{% hint style="info" %}
**NOTE**

You can bulk update (reschedule or enable/disable) not more than 20 experiments in one go.
{% endhint %}

***

### Export Chaos Experiment <a href="#export-chaos-experiment" id="export-chaos-experiment"></a>

You can export chaos experiments for future use. While creating or running an experiment, Chaos Studio automatically saves it for future access through the **Chaos Experiments** sidebar. You can also download the experiment as a manifest file to your machine or save it in a ChaosHub.

#### Download Experiment Manifest File <a href="#download-experiment-manifest-file" id="download-experiment-manifest-file"></a>

1. To download the manifest file for an experiment, select the **Chaos Experiments** sidebar option. You can access all the experiments that have been created or run in the past.
2. To export an experiment, select the **`⋮`** icon against the name of the experiment. Select **Download Manifest**. This downloads the experiment file to your machine.

   ![Download Experiment Manifest](/files/3sKJVuma48hMZAyplfkd)
3. You can directly upload this manifest file while creating a new experiment to use it as a template for the new experiment. You can, as usual, provide the **Name**, **Infrastructure type**, and **Infrastructure** for the chaos experiment and select **Upload YAML**. You can upload the manifest file from your machine or drag and drop the file.

   ![upload yaml](/files/VnaCGr1LPONPWaQCuz2N)

{% hint style="info" %}
**NOTE**

An efficient way to save, manage, and distribute the experiments as templates is to use ChaosHubs.
{% endhint %}

#### Add an Experiment to ChaosHub <a href="#add-an-experiment-to-chaoshub" id="add-an-experiment-to-chaoshub"></a>

1. To add an experiment to ChaosHub, select the **`⋮`** icon against the name of the experiment.
2. Select **Add to Chaos Hub**. Then, add an experiment name, optionally a description and a category tag, and choose the ChaosHub to add the experiment to from the list of added chaos hubs.

   ![Add Experiment to ChaosHub](/files/I3TS30wPPf7PsuA37d7t)
3. Select **Save**. Now, you should be able to see this experiment added to your chaos hub. You can access it and use it as a template for your new experiments.

   ![Added Experiment to Hub](/files/bgZfSyrQT5MkdJyPATBb)

***

### Halt and Delete Chaos Experiment <a href="#halt-and-delete-chaos-experiment" id="halt-and-delete-chaos-experiment"></a>

Halting the execution of a chaos experiment protects target applications from any unwanted and unforeseen consequences by immediately stopping the experiment and reverting the target resources to their initial state.

Halting a cron experiment disables it, preventing it from executing according to its cron schedule in the future.

#### Halt an Experiment <a href="#halt-an-experiment" id="halt-an-experiment"></a>

1. To halt an experiment execution, select its name from the list of experiments on the **Chaos Experiments** page. Click the `🚫` icon. The experiment's status will update to `Stopped`.

   ![Stopped Experiment Run](/files/EC8KWQ9D4KWw9AngEOEy)
2. If you need to halt multiple experiments simultaneously, go to the **Chaos Experiments** page and click **Stop All Experiments**. This will stop all currently executing experiments.

   ![Stop All Experiments](/files/5rfNPCMHOSQ3GYOmuaD5)

#### Delete an Experiment <a href="#delete-an-experiment" id="delete-an-experiment"></a>

Deleting an experiment removes it from the **Chaos Experiments** list under the **Chaos** tab. Deleting an experiment that is currently running will not only stop it immediately but also permanently remove it. To delete an experiment, click the **`⋮`** icon next to the experiment name and select **Delete Experiment**.

![Delete Experiment](/files/rNvHFigHvxab5NiW5hhm)

{% hint style="info" %}
**NOTE**

* Deleting an initialized or completed experiment will permanently remove it.
* Deleting a running experiment will both stop the execution and permanently remove the experiment.
* Deleting an experiment does not delete any templates created from that experiment.
  {% endhint %}

#### Delete Multiple Experiments <a href="#delete-multiple-experiments" id="delete-multiple-experiments"></a>

* You can delete multiple experiments by selecting it from the **Chaos Experiments** page and clicking the **Delete** button.

  ![delete multiple experiments](/files/F8JTh9oOmfWF08DZJXM7)
* Confirm by clicking **Delete**.

  ![click delete](/files/2ZxMg9PtsF23KoYdpkQK)

***

### Alerts for Chaos Experiments <a href="#alerts-for-chaos-experiments" id="alerts-for-chaos-experiments"></a>

Alerts provide crucial updates about your experiment runs, keeping you informed about the start, stop, and completion of your chaos experiments based on the experiment event you have configured to receive the alerts for.

#### Create and Use Alerts <a href="#create-and-use-alerts" id="create-and-use-alerts"></a>

You can setup alerts by [creating a channel](#create-a-channel) and [defining conditions](#create-a-condition). Once setup, you can [apply these conditions](#select-channel-for-alerts) to a rule.

{% hint style="info" %}

* Ensure that SMTP is configured on your account. HCE configures SMTP for you as a part of the basic setup for your application.
* To configure SMTP, ensure your account is connected to at least one delegate, regardless of the scope.
  {% endhint %}

#### Ensure SMTP is Configured <a href="#ensure-smtp-is-configured" id="ensure-smtp-is-configured"></a>

1. To verify SMTP configuration for your account, navigate to **Administrative Settings**.

   ![](/files/pLjW9q2OlrRhOtTY3FV0)
2. Check if **SMTP Configuration** is marked as **Configured**.

   ![](/files/qlRD6pWC3pTlpDkHfPS5)

#### Create a Channel <a href="#create-a-channel" id="create-a-channel"></a>

1. Navigate to **Chaos Engineering** module. Select **Project Settings** and then **Notifications Management**.

   ![](/files/GwtcUg3xcJ87sxpYLIol)

{% hint style="info" %}
Notification management should be configured at the project settings level within the **Chaos Engineering** module. This is because HCE supports chaos experiments as a project-level entity, making the rule a project-level entity.
{% endhint %}

2. Select **Channels** and then **+ New Channel**.

   ![](/files/7hdHGdud4zdswPDc9pyH)
3. Enter a **Channel Name**, select **Channel Type** (currently supports email only), and provide the associated value for channel type (email in this case). Select **Apply**.

   ![](/files/8X5aK7JtMwfxVKHm1kZK)

This creates a new channel.

![](/files/xr086HE0VVBwYJnNqEqg)

{% hint style="info" %}
Ensure you create a channel before creating a rule because a channel decides which method (email, slack, and so on) you wish to receive the alerts.
{% endhint %}

#### Create a Rule <a href="#create-a-rule" id="create-a-rule"></a>

1. To create a new rule, select **+ New Notification**.

   ![](/files/UO51uBL9Diw2b9bKITa6)
2. Enter a **Notification Name** and select **Continue**. Select **Chaos Experiments** as **Resource Type** because HCE currently supports alerting for chaos experiments only. Click **Continue**.

   ![](/files/Zy91yKI8zeeZM5958scu)

{% hint style="info" %}
HCE currently supports selecting resource types as chaos experiments for both Kubernetes and Linux chaos experiments.
{% endhint %}

4. You can associate a rule with one or more conditions. Select **+ Add Condition**. In the modal that appears, you can either create a condition or select one or more existing conditions. Select **Continue**.

#### Create a Condition <a href="#create-a-condition" id="create-a-condition"></a>

1. Provide a **Condition Name**, select the events (such as chaos experiment started, stopped, or completed) for which you want to receive the alerts. Select **Apply**.

   ![](/files/qzUEQQW0Vp00QZtqzu46)
2. Review the conditions configured for your rule and click **Continue**.

#### Select Channel for Alerts <a href="#select-channel-for-alerts" id="select-channel-for-alerts"></a>

1. Click **Select Channels**. Choose channel/s that you configured earlier and select **Apply Selected**. To create a new channel, select **New Channel**.

   ![](/files/Vviyo6g8o2el2pCv84Rv)
2. Select **Apply Selected**.

   ![](/files/OFO5X23QxwVywcQ8Yq5C)
3. You can **Enable** or disable the rule based by selecting or deselecting the radio button. By default, it is set to **Enable on Save**. Select **Submit**.

   ![](/files/arggUHjFCzW1xHOog7Qe)

{% hint style="info" %}
You can create multiple rules on the same chaos experiment, which will result in receiving multiple alerts (one per rule) for that experiment.
{% endhint %}

#### Sample Run Report <a href="#sample-run-report" id="sample-run-report"></a>

Once you've set up your email to receive alerts for completed chaos experiments (as part of [creating conditions](#create-a-condition)) and the feature flag is enabled, you'll receive a run report as an attachment. This report will include details like run information, fault details, and more.

![](/files/v7MogYKqc8imHJSTB9G4)

{% hint style="info" %}
Currently, you will only receive the report if you've configured a condition to receive alerts for **Completed** chaos experiments. You can't opt-out of receiving alerts for completed experiments.
{% endhint %}

#### Delete a Rule <a href="#delete-a-rule" id="delete-a-rule"></a>

Select the rule and click **Delete**. Confirm by selecting **Delete**.

![](/files/cA7Pkdjy3RxmZtRwzQ6H)
