Azure Local | Extended Monitoring Part 2: The Events I Was Missing

Alex ter Neuzen 16 min read
On this page

A few weeks ago I published my extended monitoring baseline for Azure Local. Since then I worked through two incidents, and afterwards I held each one against that baseline. It did not look good.

The first was a solution update that failed on every attempt. The baseline would not have fired, because nothing in it looks at Microsoft Defender. The second was a month in which three nodes across two clusters went down unexpectedly, while storage latency climbed until SQL Server VMs lost their connections. The baseline would have fired there: event 1135, a node removed from the cluster.

That is the symptom.

It does not tell you that a memory module is dying, that a policy just switched a Defender rule to Block, or that every volume in the cluster now runs through one node. In both incidents I found the explanation in the event logs on the nodes, by hand, after the fact. The events had been there all along.

This post is the follow-up to Azure Local | Extended Monitoring. It adds the events that would have told me what was going on, explains why each one earns its place, and walks through the changes in the Bicep template that collect them and alert on them. The original monitoring baseline is in the same repository; the checkpoint-monitoring extension described below is currently supplied separately as a patch.

The update that failed in the same second#

The short version of the first incident: the June cumulative update failed in the Cluster-Aware Updating (CAU) step, and every newer update refused to start until that one was resolved. The CAU report showed InstallMsuFiles.ps1 failing with 0xffffffff, first on azl-node02 and later on azl-node01. The Defender operational log on the same node showed event 1121 in the same second, every time.

The rule behind it is Block process creations originating from PSExec and WMI commands, ID D1E49AAC-8F56-4280-B9BA-993A6D77406C. CAU launches InstallMsuFiles.ps1 through WmiPrvSE.exe, which is exactly what that rule blocks. Microsoft lists it as a known issue: with this rule in Block, the solution update fails. The Azure Local security baseline keeps the rule in Audit, but a policy from Intune and Defender for Endpoint targeted the nodes with the rule in Block, and the cloud policy won.

I wrote up the full troubleshooting in Azure Local | Troubleshoot a Solution Update Blocked by Defender ASR. How could I have known this before patch night?

The answer is event 5007, “configuration changed”. It is logged every time a Defender setting changes, including the action of an attack surface reduction (ASR) rule. To find the moments the rule changed on a node:

powershell
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Windows Defender/Operational'; Id=5007} |
    Where-Object Message -match 'd1e49aac' |
    Select-Object -First 10 TimeCreated, Message |
    Format-List

One of the events it returned on azl-node01:

powershell
TimeCreated : 11-10-2026 22:30:00
Message     : Microsoft Defender Antivirus Configuration has changed. If this is an unexpected event you should review
              the settings as this may be the result of malware.
                Old value: HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules\d1e49aac-8f56-4280-b9ba-993a6d77406c = 0x2
                New value: SCC\Windows Defender Exploit Guard\ASR\Rules\d1e49aac-8f56-4280-b9ba-993a6d77406c = 0x1

The old value is the Azure Local baseline, 0x2 (Audit). The new value comes from a source the event calls SCC, and it is 0x1 (Block). On azl-node02 the same switch had happened on 29 September, almost two weeks before the update failed there.

Two weeks of warning, sitting in a log nobody collected.

The three Defender events that matter here:

EventMeaningWhat I do with it
1121An ASR rule blocked an actionSev2 alert, split by node and rule
1122An ASR rule audited an actionCollect only
5007A Defender setting changedSev2 alert when a watched rule is set to Block

Event 1122 has no alert, but it is the proof you want after the fix: during the next update you expect a 1122 for InstallMsuFiles.ps1 instead of a 1121.

Event 5007 needs some parsing, because the interesting part sits in the event text. This is the query behind the new alert, queries/defender-asr-rule-set-to-block.kql:

kusto
let auditOnlyRules = dynamic(["d1e49aac-8f56-4280-b9ba-993a6d77406c"]);
Event
| where EventLog == "Microsoft-Windows-Windows Defender/Operational" and EventID == 5007
| extend NewValue = extract(@"New value:\s*([^\r\n]+)", 1, RenderedDescription)
| where NewValue contains @"\ASR\Rules\" and NewValue matches regex @"=\s*0x1\s*$"
| extend RuleId = tolower(extract(@"ASR\\Rules\\([0-9A-Fa-f-]{36})", 1, NewValue)),
         SettingSource = extract(@"^([^\\]+)\\", 1, NewValue),
         NodeName = tolower(tostring(split(Computer, ".")[0]))
| where array_length(auditOnlyRules) == 0 or RuleId in (auditOnlyRules)
| summarize EventCount = count() by NodeName, RuleId, SettingSource

It takes the New value line, keeps it only when an ASR rule is set to 0x1, and pulls out the rule ID and the source of the setting. The list of watched rules is a parameter, defenderAsrAuditOnlyRuleIds, with the PSExec and WMI rule as the default. Why not alert on every rule that goes to Block? Because other ASR rules are in Block on purpose, on these nodes too. You only want to hear about the rules that must stay in Audit on Azure Local. If you do want every rule, an empty list watches them all.

There is one more reason to care about 5007 more than about 1121. The block itself happens during the update, and the update usually runs inside the maintenance window. If you use the maintenanceWindow parameter from the first post, the alert processing rule suppresses notifications exactly then. The 1121 alert is still created, but you only find it in the portal afterwards.

The block is the symptom you see during patch night. The policy change is the cause you can fix on a Tuesday afternoon.

Three nodes down in one month#

The second incident was at a customer with two three-node clusters. In November one node went down because of a failing memory module, and two nodes in the other cluster went down because of a failing processor. Add the regular update restarts, two nodes that were switched off with the power button or through the BMC, and a two-minute window during an update in which the nodes of one cluster lost each other.

The baseline would have fired 1135 every time a node dropped out. Fine. But to understand what had happened, I read the System log on six nodes by hand and built a timeline. These are the events that made that timeline:

Log / providerEventAlertWhy
System / Kernel-Power41Sev1Restart without a clean shutdown
System / WER-SystemErrorReporting1001Sev1Restart after a bugcheck, with the stop code
System / WHEA-Loggerby levelSev1 / Sev2Fatal or corrected hardware error
System / User321074noneWho or what restarted the node, and why

Event 41 is logged at the next start when Windows did not shut down cleanly: a crash, a power loss, or a forced power-off. Its event data helps tell those apart: when someone holds the power button, PowerButtonTimestamp is non-zero, and after a bugcheck BugcheckCode holds the stop code. Event 1001 comes with 41 after a bugcheck and says where the dump was written.

WHEA-Logger is where the hardware speaks. Event 18 is a fatal processor error, 46 a fatal memory error, and 19, 47 and 17 are corrected errors for processor, memory and PCI Express. There are more IDs than these, so I collect WHEA by level instead of by ID:

kusto
System!*[System[Provider[@Name='Microsoft-Windows-WHEA-Logger'] and (Level=1 or Level=2 or Level=3)]]

That is an XPath query for the data collection rule, not KQL, but it shows the idea: Critical, Error and Warning from one provider, whatever the ID. The alerts follow the same split. A WHEA error is a Sev1. The fatal ones, such as 18 and 46, are written at the next start, so by the time you see one the node already went down once. A WHEA warning is a corrected error. One of those is harmless, so the Sev2 alert only fires when hardwareCorrectedErrorThreshold corrected errors of the same type pile up on one node within 24 hours. The default is 3.

Event 1074 has no alert. It is logged just before a planned shutdown or restart and names the account and the reason. In the timeline, that is how I could separate the restarts somebody did on purpose from the ones nobody did. You do not want to be paged for it, but you want it in the workspace when you write the root cause analysis.

Which network went first?#

The two-minute window during the update is still not fully explained. The baseline knew that nodes dropped out of the cluster. It did not know over which network the heartbeats stopped. Failover clustering logs that too:

EventMeaning
1126A cluster network interface of a node is unreachable by at least one other node
1127A cluster network interface of a node failed
1129A cluster network is partitioned
1130A cluster network is down

These four go into warningClusterEventIds as Sev2. On a cluster with a management network and two storage VLANs, the next 1135 now comes with the name of the network that failed first.

Storage that stalls before SQL gives up#

The node failures were half of the second incident. The other half was what they left behind.

After every restart and failover, the other nodes take over the volumes, and on these clusters the volumes stayed where they landed: CsvBalancer was 0 on both. A month of failures later, one node per cluster owned every Cluster Shared Volume. With ReFS, a CSV runs in redirected mode: writes from other nodes go over SMB to the coordinator node. So every SQL Server VM that did not run on that one node sent all of its writes over the storage network to it. Add replication in both directions, with its checkpoints and merges, and you have the most likely reason the latency climbed until the SQL VMs lost their connections. A measurement during a replication job still has to confirm it.

The baseline has metric alerts for this: CSV latency above 50 ms and VHD latency above 100 ms. Those tell you that storage is slow. Two events tell you that it stalled, and where:

LogEventWhy
Hyper-V-StorageVSP-Admin9An I/O on a VHDX took about 10 seconds or longer
SMBServer/Operational1020A file system operation took longer than 15 seconds

StorageVSP event 9 is what the VM feels just before it gives up, and it names the VHDX, so you know which VM it was. SMBServer event 1020 is the other side of the redirect. Microsoft describes it as the file system not completing an operation within the allowed time, with a 15-second threshold. With ReFS CSVs, it shows up on the coordinator node. In this incident, that was the one node that owned everything.

Two more events belong in the same group. VMMS 18012, 18014 and 18016 mean a checkpoint failed, was cancelled or could not be created as a production checkpoint. Backup and replication jobs depend on checkpoints, and a failed one can leave a VM behind on an .avhdx. High-Availability 21502 means a clustered VM operation failed, for example a live migration. You need that one the moment you start moving VMs back to where they belong. Depending on the Windows version it lands in the System log or in the High-Availability Admin channel, so the template collects it from both.

Tracking leftover checkpoints#

Those failure events explain why a checkpoint operation failed, but they do not tell you who created a checkpoint that remains attached to a running VM. The checkpoint-monitoring extension adds a separate monitor for VMs that continue running from .avhdx files.

The severity 2 alert <prefix>-checkpoint-avhdx fires when a VM has been running from an .avhdx for 46 hours. It is split by VM and node, so each affected VM/node gets its own alert, and it resolves automatically when the checkpoint is gone. The checkpointAlertAfterHours threshold cannot exceed 46 because a log search alert can look back only 48 hours.

The Azure Local - leftover checkpoints workbook shows the VMs currently running on checkpoints, since when, and which are older than five days.

The data collection rule also samples \Hyper-V Virtual Storage Device(*)\Latency every 300 seconds. At 250 disks, that is about 70,000 rows per day.

The most important finding of this incident has no event at all. Nothing in Windows logs “all volumes are now on one node”. I come back to that below.

One event ID, two meanings#

Adding all these logs broke an assumption in the original alert query. It filtered on the log first and on a list of event IDs second:

kusto
Event
| where (EventLog == "System" and Source == "Microsoft-Windows-FailoverClustering")
    or EventLog == "Microsoft-Windows-Hyper-V-Worker-Admin"
| where EventID in ({{EVENT_IDS}})

With two logs that was fine. With nine, it is a trap. Event 1129 is a partitioned cluster network in FailoverClustering, and in the Defender log it means a user overrode an ASR block in warn mode. The ID alone is not enough.

The new queries/node-events.kql gets its whole filter from the template:

kusto
Event
| where {{EVENT_FILTER}}
| extend NodeName = tolower(tostring(split(Computer, ".")[0])),
         EventIdText = strcat(replace_string(Source, "Microsoft-Windows-", ""), "/", tostring(EventID))
| summarize EventCount = count() by NodeName, EventIdText

At deployment time, main.bicep builds one condition per log and provider. For the Sev1 rule, with the default parameters, that becomes:

kusto
(EventLog == "System" and Source in ("Microsoft-Windows-FailoverClustering") and EventID in (1135, 1177, 5120, 5142))
    or (EventLog == "System" and Source in ("Microsoft-Windows-Kernel-Power") and EventID in (41))
    or (EventLog == "System" and Source in ("Microsoft-Windows-WER-SystemErrorReporting") and EventID in (1001))

The EventIdText dimension now carries the provider as well, so a notification says Kernel-Power/41 or FailoverClustering/1129 instead of a bare number.

What changed in the template#

The cluster event IDs stay where they were. The new events get their own parameter, nodeEvents, with a type, so every entry carries its log, provider, IDs and severity:

bicep
{
  log: 'System'
  provider: 'Microsoft-Windows-Kernel-Power'
  eventIds: [
    41
  ]
  severity: 1
  description: 'Restart without a clean shutdown: crash, power loss, or power-off with the power button or the BMC'
}

Severity 1 or 2 creates an alert, severity 0 only collects the event. That is how 1074 ends up in the workspace without paging anyone. Each entry becomes its own XPath query in the data collection rule, and the type limits an entry to 20 event IDs, because Azure Monitor supports up to 20 expressions in one XPath query. The failover clustering IDs share one query, so keep criticalClusterEventIds and warningClusterEventIds at 20 together.

Defender and WHEA have their own switches, because their alerts need more than an ID list:

bicep
param deployDefenderAsrMonitoring = true
param defenderAsrAuditOnlyRuleIds = [
  'd1e49aac-8f56-4280-b9ba-993a6d77406c' // Block process creations originating from PSExec and WMI commands
]
param defenderAsrBlockExcludedRuleIds = []
param defenderCollectAsrAuditEvents = true

param deployHardwareErrorMonitoring = true
param hardwareCorrectedErrorThreshold = 3

defenderAsrBlockExcludedRuleIds is for an ASR rule that blocks often and harmlessly in your environment, so the 1121 alert stays meaningful. defenderCollectAsrAuditEvents can go off when many rules are in Audit and the 1122 volume is too high.

The result, next to the rules from the first post:

RuleSeverityFires on
azl-cluster-events-critical1Cluster membership, quorum, CSV, Kernel-Power 41, bugcheck 1001
azl-cluster-events-warning2Cluster resources and networks, guest crash, StorageVSP 9, SMBServer 1020, checkpoints, live migration
azl-defender-asr-rule-set-to-block2A watched ASR rule is set to Block (5007)
azl-defender-asr-block2An ASR rule blocked an action (1121)
azl-hardware-errors-fatal1WHEA error or critical
azl-hardware-errors-corrected2Corrected WHEA errors piling up within 24 hours
<prefix>-checkpoint-avhdx2A VM has been running on an .avhdx for 46 hours

The two existing event rules keep their names, so an upgrade updates them in place. Their display names change, and so do the values of the EventIdText dimension: alerts that are open on an old value resolve, and new ones fire with the new value. Both rules use the existing azl-id-alert-rules identity, so no extra role assignments are needed.

Checkpoint monitoring has its own parameters:

  • deployCheckpointMonitoring enables the checkpoint monitor.
  • checkpointAlertAfterHours sets the alert threshold and cannot exceed 46.
  • checkpointMaxAgeDays defaults to 5 days for the workbook.
  • checkpointCounterIntervalSeconds sets the counter collection interval; this baseline uses 300 seconds.
  • checkpointExcludedVmNames lists VMs to exclude.

The deployment script also checks that its identity can write the workbook and that the counter is arriving.

What this still does not catch#

Some things from these incidents have no event, and I did not want to pretend otherwise.

All volumes on one node. No event says so, and with CsvBalancer at 0 nothing moves them back. After every update, repair or failure, check Get-ClusterSharedVolume and move the volumes back by hand. That belongs in the update runbook until I have a better answer for it.

Checkpoint ownership. The monitor detects VMs running on .avhdx files and reports their age, but Windows does not provide enough information here to determine who created the checkpoint.

A failed solution update. There is no reliable node event for that either. The update state lives in Azure. Event 5007 on the PSExec and WMI rule covers the cause I have actually seen in the field, not every possible cause.

Validate before you trust the alerts#

The checkpoint-monitoring update applied to a clean clone without conflicts, but I have not compiled its Bicep or run its queries against a Log Analytics workspace. To compile the template and preview the changes in your environment, run:

powershell
.\Deploy-AzLocalMonitoring.ps1 -ResourceGroupName '<rg>' -WhatIf

Test the XPath queries on a node before you deploy. Get-WinEvent takes the part before the ! as the log name and the rest as the filter:

powershell
Get-WinEvent -LogName 'System' -MaxEvents 5 `
    -FilterXPath "*[System[Provider[@Name='Microsoft-Windows-WHEA-Logger'] and (Level=1 or Level=2 or Level=3)]]"

“No events were found” is fine; the query is valid and the node has had no hardware errors. “The specified query is invalid” is not. The deployment outputs the full list as eventXPathQueries.

Check the effective value of the PSExec and WMI rule on every node. This is the value Defender actually uses, not the one in the registry:

powershell
$p = Get-MpPreference
$i = [array]::IndexOf(@($p.AttackSurfaceReductionRules_Ids | ForEach-Object { $_.ToLower() }), 'd1e49aac-8f56-4280-b9ba-993a6d77406c')
if ($i -ge 0) { $p.AttackSurfaceReductionRules_Actions[$i] } else { 'not configured' }

2 is Audit and what you want. 1 is Block, and the next solution update fails. Fix it in the Intune or Defender for Endpoint policy that targets the node; a local change gets overwritten.

About 30 minutes after the deployment, check what arrives in the workspace:

kusto
Event
| where TimeGenerated > ago(1h)
| where EventLog != "Application" and EventLog !startswith "Microsoft-Windows-SDDC" and EventLog !startswith "Microsoft-Windows-Health"
| summarize count() by Computer, EventLog, Source, EventID

On a healthy cluster this list is short. Some Defender 1122 and 5007 events are normal.

Finally, run both ASR queries against your own events once. They read the rule ID from the event text, and that text can differ per Defender platform version or system language. I checked the parsing against the events from these clusters, which run English, and all alert queries pass the Kusto language parser. That is not the same as your cluster.

It’s an extension#

The first post was about getting the signals out of the cluster. This one is about which signals. In both incidents the answer was already on the nodes, written down to the second. It just never reached a person.

These events are a good place to start. Monitor them, and test the changes in your own environment before you deploy.

Download contents#

The existing monitoring baseline is in the azure-local-extended-monitoring repository. The checkpoint-monitoring extension is not in that repository yet. It is supplied separately as checkpoint-monitoring.patch or checkpoint-monitoring-files.zip; the patch applied to a clean clone without conflicts. Apply it from the monitoring repository root with git apply checkpoint-monitoring.patch; the ZIP contains the same files for manual copying. The event-monitoring changes in the existing repository include:

  • main.bicep: the nodeEvents type and parameter, the cluster network IDs, the Defender and WHEA parameters, and the generated XPath queries and alert filters
  • modules/event-log-alerts.bicep: the Sev1 and Sev2 node event alerts, now on generated filters
  • modules/defender-asr-alerts.bicep: ASR rule set to Block (5007) and ASR blocks (1121)
  • modules/hardware-error-alerts.bicep: fatal WHEA errors and corrected errors piling up
  • queries/node-events.kql (was cluster-events.kql), defender-asr-block.kql, defender-asr-rule-set-to-block.kql, hardware-errors-fatal.kql, hardware-errors-corrected.kql
  • main.bicepparam and README.md: the new parameters and a table of every collected event