> 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/windows/windows-disk-stress.md).

# Windows disk stress

Windows disk stress is a Windows chaos fault that drives disk IO on the target Windows VM by running `NUMBER_OF_WORKERS` IO worker processes that write `MEMORY_CONSUMPTION` MB to `DISK_PATH` (in `BLOCK_SIZE_IN_KILOBYTES` KB blocks with `WRITE_PERCENTAGE` percent writes) for `DURATION`, then stops the workers and cleans up the scratch files. The fault runs through the Windows chaos agent installed as a service on the target VM.

Use this fault to test how a workload on a Windows VM behaves when storage throughput is saturated: whether IO latency stays inside the SLA, whether databases queue writes correctly, 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>

* **IO pressure on a Windows VM:** When disk throughput saturates, does application latency stay inside the SLA?
* **Database resilience:** Does the database queue writes correctly when fsync latency spikes?
* **Page-file impact:** Does the workload survive when the page-file disk slows down?

***

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

* **Windows chaos infrastructure:** Install the chaos agent on the target VM. Go to [Windows requirements and security considerations](/resilience-testing/chaos-engineering/faults/chaos-fault-categories/windows/windows-chaos-permissions.md) for prerequisites.
* **User privileges:** Disk stress is an Advanced fault and requires administrator user.
* **Free space:** `DISK_PATH` has enough free space to absorb `MEMORY_CONSUMPTION` MB of writes per worker.

***

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

| Platform                                                  | Support status                                                                                                                                                                                                                                                  |
| --------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Windows Server VMs with the Windows chaos agent installed | Supported                                                                                                                                                                                                                                                       |
| Linux VMs                                                 | Not supported (use [VMware IO stress](/resilience-testing/chaos-engineering/faults/chaos-fault-categories/vmware/linux/vmware-io-stress.md) or [Linux disk fill](/resilience-testing/chaos-engineering/faults/chaos-fault-categories/linux/linux-disk-fill.md)) |

***

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

This fault is classified as **Advanced**. The chaos agent must be installed with administrator privileges and the fault must run as an administrator user.

***

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

**Chaos parameters**

| Tunable                   | Description                                                                | Default |
| ------------------------- | -------------------------------------------------------------------------- | ------- |
| `DURATION`                | Total duration of the fault as a Go duration string (for example `30s`).   | `30s`   |
| `MEMORY_CONSUMPTION`      | Amount of data each worker writes in MB.                                   | `1024`  |
| `BLOCK_SIZE_IN_KILOBYTES` | Block size used to fill the disk in KB.                                    | `50`    |
| `WRITE_PERCENTAGE`        | Percentage of operations that are writes (0-100). The remainder are reads. | `100`   |
| `NUMBER_OF_WORKERS`       | Number of IO worker processes.                                             | `2`     |
| `DISK_PATH`               | Path on the Windows VM where workers write.                                | `C:\`   |
| `RAMP_TIME`               | Wait period in seconds before and after the fault.                         | `0`     |

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>

The Windows chaos agent on the target VM launches `NUMBER_OF_WORKERS` IO workers that read/write `MEMORY_CONSUMPTION` MB under `DISK_PATH` in `BLOCK_SIZE_IN_KILOBYTES` KB blocks (with `WRITE_PERCENTAGE` percent writes) for `DURATION`, then stops the workers and removes the scratch 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 `DISK_PATH` saturates.
* Application IO latency may rise.
* Performance Monitor `PhysicalDisk\Avg. Disk Queue Length` reflects the activity.
* After the duration ends, the workers exit and the scratch files are removed.

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

The chaos agent stops the IO workers and removes the scratch files. IO latency returns to baseline within seconds.
{% endhint %}

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

* **Disk IO:** Use a [Prometheus probe](/resilience-testing/chaos-engineering/use-chaos-engineering/probes/apm-probes.md) on Windows Exporter `windows_logical_disk_*` metrics.
* **Application:** Use an [HTTP probe](/resilience-testing/chaos-engineering/use-chaos-engineering/probes/http-probe.md).

***

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

1. **Open Resource Monitor → Disk.**

   You should see the chaos worker process writing to `DISK_PATH` at the configured throughput during the window.
2. **Run `Get-Counter '\PhysicalDisk(*)\Avg. Disk Queue Length' -Continuous` in PowerShell.**

   Queue length on the target disk should rise during the chaos window.

***

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

* **End of duration:** The chaos agent stops the workers and removes the scratch files.
* **Abort:** Stopping the experiment also stops the workers and cleans up.
* **Manual recovery:** Delete any leftover scratch files under `DISK_PATH` if cleanup failed.

***

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

* **Disk full risk:** Setting `MEMORY_CONSUMPTION` \* `NUMBER_OF_WORKERS` close to free space can fill the disk before the fault ends.
* **System drive risk:** Stressing the system drive (`C:\`) can affect the OS itself; consider using a non-system drive.
* **Administrator required:** This is an Advanced fault and requires the agent to run as administrator.

***

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

<details>

<summary>Windows disk stress fails with not enough space on disk in Harness Chaos Engineering</summary>

DISK\_PATH does not have enough free space for MEMORY\_CONSUMPTION \* NUMBER\_OF\_WORKERS. Check free space (Get-PSDrive) and either reduce the request or target a roomier disk.

</details>

<details>

<summary>Windows disk stress fails with access denied</summary>

The chaos agent must be installed and running with administrator privileges for advanced faults like Disk stress. Reinstall the agent as administrator and retry.

</details>

***

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

* [Windows CPU stress](/resilience-testing/chaos-engineering/faults/chaos-fault-categories/windows/windows-cpu-stress.md): Stress CPU instead of disk IO.
* [Windows memory stress](/resilience-testing/chaos-engineering/faults/chaos-fault-categories/windows/windows-memory-stress.md): Stress memory instead of disk IO.
