> 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-engineering/faults/chaos-fault-categories/azure/azure-instance-io-stress.md).

# Azure instance IO stress

Azure instance IO stress is an Azure chaos fault that drives sustained disk read/write IO on the volume mounted at `VOLUME_MOUNT_PATH` of each VM listed in `AZURE_INSTANCE_NAMES` (in `RESOURCE_GROUP`, subscription `AZURE_SUBSCRIPTION_ID`) for `TOTAL_CHAOS_DURATION` seconds. The fault writes `FILESYSTEM_UTILIZATION_BYTES` GB (or `FILESYSTEM_UTILIZATION_PERCENTAGE` percent when set) across `NUMBER_OF_WORKERS` workers using the Azure VM run-command extension.

Use this fault to test how a workload behaves when the storage subsystem is saturated: whether application latency degrades gracefully, whether write-heavy paths back off correctly, whether IO autoscale (Premium SSD bursting) kicks in, and whether monitoring detects the saturation within the alerting SLA.

{% hint style="info" %}
**RUN YOUR FIRST EXPERIMENT**

If you have not configured the chaos infrastructure yet, go to [Quickstart](/resilience-testing/chaos-engineering/new-to-chaos-engineering/quickstart.md) to install the chaos infrastructure and run an experiment end to end.
{% endhint %}

***

### Use cases <a href="#use-cases" id="use-cases"></a>

Run this fault when you want to answer concrete questions like:

* **IO pressure:** When the disk is saturated, does application latency stay inside the SLA?
* **Premium SSD bursting:** Does the disk burst credit cover the spike, or does throttling kick in?
* **Write-amplification:** Do logs, journals, or background writers degrade gracefully?
* **Monitoring fidelity:** Do alerts on `Disk Read Bytes` / `Disk Write Bytes` and disk queue depth fire inside the alerting SLA?

***

### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

* **Kubernetes version:** 1.21 or later for the chaos infrastructure cluster.
* **Target VMs reachable:** Each entry in `AZURE_INSTANCE_NAMES` exists in `RESOURCE_GROUP` and is in `running` state.
* **VM Agent and run-command enabled:** The Azure VM Agent must be running on the target VM.
* **Mount path exists:** `VOLUME_MOUNT_PATH` (default `/tmp`) must be a writable directory on the VM with enough free space for `FILESYSTEM_UTILIZATION_BYTES`.
* **Azure credentials available:** A service principal File Secret in Harness Secret Manager, workload identity on AKS, or managed identity on the AKS node pool.

***

### Supported environments <a href="#supported-environments" id="supported-environments"></a>

| Platform                       | Support status                                                                                                                                                       |
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Standalone Linux VMs           | Supported                                                                                                                                                            |
| Standalone Windows VMs         | Supported (use [Windows disk stress](/resilience-testing/chaos-engineering/faults/chaos-fault-categories/windows/windows-disk-stress.md) for native Windows support) |
| VMSS instances                 | Supported (set `SCALE_SET=enable`)                                                                                                                                   |
| AKS worker nodes (VMSS-backed) | Supported with `SCALE_SET=enable`                                                                                                                                    |

***

### Permissions required <a href="#permissions-required" id="permissions-required"></a>

The Azure principal used by the chaos pod needs the following role on the target resource group or subscription.

**Recommended built-in role:** `Virtual Machine Contributor`

**Custom role (minimum actions):** see the [Azure instance CPU hog permissions](/resilience-testing/chaos-engineering/faults/chaos-fault-categories/azure/azure-instance-cpu-hog.md#permissions-required) (same actions apply).

Go to [Azure fault permissions](/resilience-testing/chaos-engineering/faults/chaos-fault-categories/azure/security-configurations/fault-permissions.md) to read the full permission catalog.

***

### Authentication <a href="#authentication" id="authentication"></a>

Go to [Azure authentication methods](/resilience-testing/chaos-engineering/faults/chaos-fault-categories/azure/security-configurations/azure-authentication-methods.md) to set up Service principal, Workload identity, or Managed identity.

***

### Fault tunables <a href="#fault-tunables" id="fault-tunables"></a>

Configure the following fault parameters when you add Azure instance IO stress to an experiment in Chaos Studio. Defaults are shown for reference.

**Required parameters**

| Tunable                | Description                           | Default    |
| ---------------------- | ------------------------------------- | ---------- |
| `AZURE_INSTANCE_NAMES` | Comma-separated list of VM names.     | (required) |
| `RESOURCE_GROUP`       | Resource group that contains the VMs. | (required) |

**Stress parameters**

| Tunable                             | Description                                                                                           | Default |
| ----------------------------------- | ----------------------------------------------------------------------------------------------------- | ------- |
| `FILESYSTEM_UTILIZATION_BYTES`      | Total bytes (GB) written by the stress workers. Ignored when `FILESYSTEM_UTILIZATION_PERCENTAGE > 0`. | `5`     |
| `FILESYSTEM_UTILIZATION_PERCENTAGE` | Percentage of filesystem free space to use. Set to `0` to use `FILESYSTEM_UTILIZATION_BYTES`.         | `0`     |
| `NUMBER_OF_WORKERS`                 | Number of parallel IO stress workers.                                                                 | `1`     |
| `VOLUME_MOUNT_PATH`                 | Filesystem path used as the stress target.                                                            | `/tmp`  |

**Chaos parameters**

| Tunable                | Description                                                                                                                                                                                                      | Default    |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| `TOTAL_CHAOS_DURATION` | Total duration of the fault in seconds.                                                                                                                                                                          | `30`       |
| `CHAOS_INTERVAL`       | Delay in seconds between successive iterations when running for more than one cycle.                                                                                                                             | `30`       |
| `SCALE_SET`            | Set to `enable` when the VMs belong to a Virtual Machine Scale Set.                                                                                                                                              | `""`       |
| `SEQUENCE`             | Order in which multiple instances are stressed: `parallel` or `serial`.                                                                                                                                          | `parallel` |
| `RAMP_TIME`            | Wait period in seconds before and after the fault. Go to [ramp time](/resilience-testing/chaos-engineering/faults/chaos-fault-categories/common-tunables-for-all-faults.md#ramp-time) to read how it is applied. | `0`        |

**Authentication**

| Tunable                       | Description                                                                                           | Default |
| ----------------------------- | ----------------------------------------------------------------------------------------------------- | ------- |
| `AZURE_SUBSCRIPTION_ID`       | Target Azure subscription ID.                                                                         | `""`    |
| `AZURE_CLIENT_ID`             | Client ID of a user-assigned managed identity.                                                        | `""`    |
| `AZURE_AUTHENTICATION_SECRET` | Identifier of the **File Secret in Harness Secret Manager** that contains the service principal JSON. | `""`    |

Tunables that apply to every fault are documented in [common tunables for all faults](/resilience-testing/chaos-engineering/faults/chaos-fault-categories/common-tunables-for-all-faults.md).

***

### Fault execution in brief <a href="#fault-execution-in-brief" id="fault-execution-in-brief"></a>

Uses the Azure VM run-command extension to launch `NUMBER_OF_WORKERS` IO stress workers on each VM, writing `FILESYSTEM_UTILIZATION_BYTES` GB (or `FILESYSTEM_UTILIZATION_PERCENTAGE` percent of free space) to `VOLUME_MOUNT_PATH` for `TOTAL_CHAOS_DURATION` seconds, then terminates the workers and cleans up the stress files.

***

### Expected behavior during fault execution <a href="#expected-behavior-during-fault-execution" id="expected-behavior-during-fault-execution"></a>

* Disk read/write throughput on the affected VMs climbs for the duration.
* Application latency on read/write paths grows in proportion to the load.
* Azure Monitor `Disk Read Bytes/sec`, `Disk Write Bytes/sec`, and queue depth reflect the spike.
* After the duration ends, the workers exit, the stress files are cleaned up, and IO returns to baseline.

{% hint style="info" %}
**WHEN THE FAULT ENDS**

The chaos pod terminates the workers and removes the stress files written under `VOLUME_MOUNT_PATH`. Disk usage returns to baseline.
{% endhint %}

#### Signals to watch <a href="#signals-to-watch" id="signals-to-watch"></a>

* **VM disk metrics:** Use a [Prometheus probe](/resilience-testing/chaos-engineering/use-chaos-engineering/probes/apm-probes.md) on `node_disk_io_time_seconds_total` and assert the spike is observed.
* **Application latency:** Use an [HTTP probe](/resilience-testing/chaos-engineering/use-chaos-engineering/probes/http-probe.md) on a write-heavy endpoint.

***

### Verify the fault execution effect <a href="#verify-the-fault-execution-effect" id="verify-the-fault-execution-effect"></a>

1. **Inspect Azure Monitor disk metrics.**

   ```bash
   az monitor metrics list \
     --resource /subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.Compute/virtualMachines/<vm> \
     --metric "Disk Read Bytes,Disk Write Bytes" \
     --interval PT1M
   ```
2. **SSH into the VM and run `iostat -x 2` during the chaos window.**

   `%util` should climb and `await` should grow.

***

### Recovery and cleanup <a href="#recovery-and-cleanup" id="recovery-and-cleanup"></a>

* **End of duration:** The chaos pod terminates the workers and removes the stress files from `VOLUME_MOUNT_PATH`.
* **Abort the experiment:** Stopping the experiment from Chaos Studio also cleans up.
* **Manual recovery:** SSH into the VM and remove any `stress-*` files left behind under `VOLUME_MOUNT_PATH`.

***

### Limitations <a href="#limitations" id="limitations"></a>

* **Filesystem space requirement:** The chosen `VOLUME_MOUNT_PATH` must have enough free space; the fault errors out if it does not.
* **Premium SSD bursting:** Bursting credit may mask the impact on small VMs; size `FILESYSTEM_UTILIZATION_BYTES` accordingly.
* **Same-subscription targeting:** A single experiment targets one `AZURE_SUBSCRIPTION_ID`.

***

### Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

<details>

<summary>Azure instance IO stress fails with No space left on device in Harness Chaos Engineering</summary>

VOLUME\_MOUNT\_PATH does not have enough free space. Verify with df -h on the VM, then either lower FILESYSTEM\_UTILIZATION\_BYTES or pick a different mount path.

</details>

<details>

<summary>No IO spike visible in Azure Monitor</summary>

Azure Monitor metrics aggregate at 1-minute granularity. For short chaos windows, inspect node-level metrics through iostat or a Prometheus node exporter scrape. Premium SSD burst credits may also absorb short bursts.

</details>

***

### Related faults <a href="#related-faults" id="related-faults"></a>

* [Azure instance CPU hog](/resilience-testing/chaos-engineering/faults/chaos-fault-categories/azure/azure-instance-cpu-hog.md): Stress CPU instead of disk.
* [Azure instance memory hog](/resilience-testing/chaos-engineering/faults/chaos-fault-categories/azure/azure-instance-memory-hog.md): Stress memory instead of disk.
* [Azure disk loss](/resilience-testing/chaos-engineering/faults/chaos-fault-categories/azure/azure-disk-loss.md): Detach the disk entirely.
