Fix it now
Event ID 157 says “Disk <number> has been surprise removed”. Nobody ejected anything: the storage stack was told the device is gone and failed everything outstanding against it. Microsoft’s documented causes start with I/O throttling and a disk timeout value set too low, not with a dead drive.
Get-Disk
Get-PhysicalDisk | Select-Object FriendlyName,HealthStatus,OperationalStatus
Get-IscsiSession
mpclaim -s -d
reg query HKLM\SYSTEM\CurrentControlSet\Services\disk /v TimeOutValue
- Read the seconds before the 157 in the System log. An iSCSI session loss, an adapter reset or an event 129 immediately beforehand usually names the real fault.
- Check the disk timeout. Microsoft recommends 179 or larger for iSCSI-attached storage, and warns that past 180 seconds the system logs event ID 17 and restarts the machine.
- Look at whether the node was being throttled. Excessive I/O that pushes requests past the timeout threshold is Microsoft’s first listed cause of this event.
- Compare the path count against a node that is behaving, and check the physical layer on the path that vanished: link state, cabling, SFPs, switch and enclosure port counters.
- Only once the device is stably present again, bring the disk or cluster resource back online and check the volume for file system damage.
If cluster validation was deliberately run inside a guest, expect this event. Microsoft lists it as one of the documented causes, and it is not a fault.
If the disk is stable and the file system is clean, you can stop here. The next section explains what removal means to the storage stack and why the disk often comes back on its own.
Why it happens
Windows models storage as a bus with devices on it. A device can leave gracefully, which is what the safe removal interface does, or abruptly, which is what happens when a cable is pulled, a controller resets without re-enumerating the device, or an iSCSI or fibre channel session ends. Event 157 is the abrupt case, and the stack has no option but to fail everything outstanding against the device.
That makes 157 a symptom rather than a diagnosis, and the interesting information is in the seconds before it. Microsoft’s documented causes for the event are excessive I/O workload causing throttling and delay until the disk reaches its I/O timeout threshold, a disk timeout registry value set too small, a low memory condition, and cluster validation deliberately run inside the guest.
On shared storage there is a second reason to care. The disk often returns a few seconds later, and Windows may or may not reattach it cleanly. That is when you get file system damage on top of an outage, because writes were in flight when the device left. The removal is the visible event; the corruption is the one that costs you the weekend.
The transport session ended rather than the disk failing
You have this one if 157 preceded within seconds by an iSCSI connection loss or an adapter reset, and the disk reappears shortly afterwards.
- Treat the session loss as the fault and the removal as its consequence.
- For iSCSI, check portal addressing, network segregation and MTU consistency end to end.
- For fibre channel or SAS, check the HBA link, the switch port and the array port for errors and resets.
- Confirm MPIO is claiming the devices and the LUN has more than one path, so the next session loss is survivable.
The disk timeout is shorter than the delays this storage produces
You have this one if Removals during heavy I/O, on storage that is otherwise healthy and recovers by itself.
- Read
TimeOutValueunderHKLM\SYSTEM\CurrentControlSet\Services\disk. - Set it to 179 for iSCSI-attached storage, which is Microsoft’s recommended value.
- Do not exceed 179: at 180 seconds the system logs event ID 17 and restarts.
- Reboot, then repeat the workload that triggered it.
The workload is being throttled at the storage layer
You have this one if Removals cluster around backups, restores or a heavy batch job, with latency climbing beforehand.
- Correlate the event timestamps against your scheduled jobs and spread them out.
- Measure disk latency through the window with the PhysicalDisk counters rather than reasoning from averages.
- Where the storage tier genuinely cannot serve the load, move the busiest volumes rather than raising timeouts to hide it.
- Check for a low memory condition on the node at the same time; Microsoft lists it among the causes.
A cable, connector or slot is intermittent
You have this one if The same physical device, port or slot appears in every occurrence, and moving the drive or cable moves the problem with it.
- Map the device path in the event back to a physical slot or port.
- Reseat the drive and cable, and inspect the connector.
- Swap the cable or SFP for a known good one and observe.
- If the problem follows the slot rather than the drive, suspect the backplane or controller port.
Full reference
Where to look first, by storage type
| Storage type | First thing to check |
|---|---|
| iSCSI LUN | Whether the iSCSI session dropped in the same second, and the disk TimeOutValue |
| Fibre channel or SAS | HBA link state, switch port errors and array-side path events |
| Internal RAID | Controller log, backplane, and the drive’s own health flags |
| Virtual machine disk | I/O throttling at the platform layer, and the guest’s disk timeout value |
| Cluster shared disk | Whether one node lost it or every node did |
| Storage Spaces | Whether the physical disk was retired or lost communication |
The events around a 157, and what is actually published
| Event | Status |
|---|---|
| 157 | ‘Disk <number> has been surprise removed.’ Published, with documented causes |
| 17 | Published as the consequence of a disk timeout beyond 180 seconds: the system restarts |
| 7 | ‘The device has a bad block’ – a hardware fault, per Microsoft’s storage quick reference |
| 129 and 153 | Storport reset and retry events, published, and the usual company for a 157 |
| 15, 51 and 52 | No message text published by Microsoft. Microsoft lists 51 among the disk, file system and cluster errors to watch for, without giving its wording |
That last row matters when you are writing an alert rule. Building automation on events whose meaning the vendor does not publish means your runbook says something the product does not, and the first person to follow it at three in the morning will find that out.
The timeout value, in full
TimeOutValue, a REG_DWORD under HKLM\SYSTEM\CurrentControlSet\Services\disk, is how long the disk class driver waits before it gives up on a request. Microsoft’s iSCSI storage connectivity guidance recommends 179 or larger. The 157 documentation supplies the ceiling and the reason for it: do not exceed 179 seconds, because after 180 the system invokes event ID 17 and triggers a restart. Between those two numbers is the entire supported range, and there is no benefit to being near the top of it unless your array genuinely stalls that long.
After the disk comes back
Do not simply bring the volume online and carry on. Writes were in flight when the device left. Check the System log for NTFS events 55 and 98 on that volume and run an online scan before returning it to production.
- Confirm the device is stably present with
Get-DiskandGet-PhysicalDisk. - Confirm the path count matches a known-good node.
- Run
chkdsk X: /scanand read the result before mounting anything that writes. - Bring the cluster resource or role back online.
- Check the application’s own logs, particularly for databases, before declaring the incident closed.
When it keeps happening and nothing is faulty
- Collect the cluster logs from every affected node if this is a cluster:
Get-ClusterLog -Destination <path>. - Check whether a validation or diagnostic tool runs on a schedule inside the guest. Microsoft names deliberate cluster validation as a cause of this event.
- Look at memory pressure on the node in the same window; a low memory condition is on Microsoft’s list and looks nothing like a storage fault.
- Compare against a node that never sees it. Two nodes on the same fabric with different behaviour is a configuration difference, not a fabric problem.
Every code this article covers
| Code | What it points at | Source |
|---|---|---|
Event ID 157 |
‘Disk <number> has been surprise removed.’ Microsoft’s documented causes are I/O throttling past the timeout threshold, a disk timeout value set too small, low memory, and cluster validation run inside the guest | Microsoft Learn |
Event ID 15 |
Logged by the disk stack around a removal. Microsoft publishes no message text for this ID; read it as context for the 157 rather than as a separate finding | not published by the vendor |
Event ID 7 |
‘The device has a bad block’, which Microsoft attributes to a hardware fault and answers with vendor diagnostics or replacement | Microsoft Learn |
Event ID 51 |
Listed by Microsoft among the disk, file system and cluster errors worth watching for, but with no published message text | not published by the vendor |
Event ID 52 |
Logged by the disk stack against a device, with no message text published by Microsoft. Confirm any health verdict with the controller or array’s own tools before replacing hardware | not published by the vendor |
Confirm the fix worked
Get-Diskshows every expected disk with a healthy operational status.mpclaim -s -dmatches the path count on a known-good node.TimeOutValuereads the value you set, after a reboot, and is not above 179.- An online file system scan of every volume that was live during the removal reports no damage.
- A full backup cycle passes with no new event 157, and no event 17 restart.
Questions people ask about this
Does a surprise removal mean I have lost data?
Not necessarily, but assume writes in flight were lost. Check the file system on the affected volume and the application’s own logs, particularly for databases, before declaring it clean.
Do I need to buy anything to fix this?
No. Every diagnostic here uses tools included with Windows Server, and the two most common fixes are a registry value and a scheduling change. The only cost is whatever component turns out to be faulty.
Why does the disk come back on its own?
Because the underlying transport recovered and the device re-enumerated. That is good for availability and bad for diagnosis: the evidence is a handful of events rather than a dead device you can hold.
Should I suppress the alert if the disk always returns?
No. A device leaving the bus unexpectedly is never routine, and the occurrence that does not recover will then arrive with no warning at all.
Is raising the disk timeout a real fix or a workaround?
It is a real fix when the storage is legitimately slow for short periods, which is why Microsoft publishes a recommended value. It is a workaround when the storage is failing, and it stops being either past 179 seconds, where the machine restarts instead.
