Skip to content

Commit d7ddda9

Browse files
committed
feat(sap): Add Host Memory Alert policy for SAP HANA workloads
Add an alerting policy template and metadata for host memory errors on SAP HANA VM instances. This alert is meant for Google Cloud customers running SAP HANA workloads. It detects uncorrectable host memory errors (compute.instances.host_event_notify / HostMemoryAlert) and provides guidance on potential impact and recommended remediation.
1 parent 25d8c3e commit d7ddda9

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"displayName": "Host Memory Alert",
3+
"documentation": {
4+
"content": "### ⚠️ Host Memory Error Detected — Risk of SAP HANA Crash\n\nAn uncorrectable host memory error occurred on VM instance: [${resource.label.instance_id}](https://console.cloud.google.com/compute/instancesDetail/zones/${resource.label.zone}/instances/${resource.label.instance_id}?project=${resource.label.project_id}) (Project: `${resource.label.project_id}`).\n\n#### 💥 Potential Impact & Consequences\n- **Imminent Crash Risk:** Although Compute Engine automatically migrates affected VMs to a healthy host, affected virtual memory pages remain poisoned and inaccessible.\n- **Delayed Failure on Reads:** The workload might appear to run normally, but as soon as SAP HANA attempts to **read** the affected 4kB memory page, the SAP HANA workload will immediately fail and crash. (Writes do not trigger a crash because they redirect/replace data without reading or verifying the data first).\n- **Automatic Restart / Relocation:** Following a crash, SAP HANA will automatically restart if the `Autostart` parameter is set (`Autostart = 1`), or in the case of a Pacemaker cluster, the SAP HANA resource will restart or relocate depending on the cluster configuration.\n- Leaving the VM running without intervention will lead to an unexpected, uncoordinated outage.\n\n---\n\n#### 🛠️ Recommended Remediation: Stop & Start Instance\nTo release the poisoned memory pages and prevent an unscheduled crash, performing a **stop and start** of the instance is the best option:\n\n1. **Initiate Failover:** If this VM is the active primary node in a Pacemaker HA cluster, initiate a manual failover to the secondary node.\n2. **Stop the Instance:** Stop the affected VM instance to release the corrupted virtual memory pages.\n3. **Start the Instance:** Start the VM instance and bring SAP HANA back online / resume replication.\n\n> **Alternative (VM Reboot) & Why Stop/Start is Preferred:**\n> Rebooting the VM also clears virtual memory and releases the poisoned pages, making it an acceptable alternative. However, a **stop/start** is strongly recommended because:\n> 1. If live migration hasn't completed yet, a reboot leaves the VM on the unhealthy host.\n> 2. Remaining on an unhealthy host risks additional memory errors (hardware faults often produce multiple errors).\n> 3. Stop/start forces relocation to a healthy host, as degraded hardware is marked for repair.\n> 4. Sole-tenant nodes do not automatically live migrate on memory errors; a stop/start is required.\n\n---\n\n#### 🔗 Reference & Links\n- [View VM Instance Details](https://console.cloud.google.com/compute/instancesDetail/zones/${resource.label.zone}/instances/${resource.label.instance_id}?project=${resource.label.project_id})\n- [Google Cloud SAP Documentation: Protect workloads from host errors](https://docs.cloud.google.com/sap/docs/manage-host-errors#protect_your_sap_workloads_from_host_errors)",
5+
"mimeType": "text/markdown"
6+
},
7+
"userLabels": {},
8+
"conditions": [
9+
{
10+
"displayName": "Log match condition",
11+
"conditionMatchedLog": {
12+
"filter": "jsonPayload.@type=\"type.googleapis.com/cloud_vmm_proto.HostMemoryAlert\""
13+
}
14+
}
15+
],
16+
"alertStrategy": {
17+
"notificationRateLimit": {
18+
"period": "300s"
19+
},
20+
"autoClose": "1800s"
21+
},
22+
"combiner": "OR",
23+
"enabled": true,
24+
"notificationChannels": [],
25+
"severity": "CRITICAL"
26+
}

alerts/google-cloud-agent-for-sap/metadata.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ alert_policy_templates:
1717
display_name: "SAP HANA replication is not in sync"
1818
description: "Alerts whenever an SAP HANA system is no longer in sync with its secondary site"
1919
version: 1
20+
related_integrations:
21+
- id: google_agent_for_sap
22+
platform: GCP
23+
- id: "host-memory-alert"
24+
display_name: "Host Memory Alert"
25+
description: "Alerts whenever an uncorrectable host memory error event is detected on an SAP HANA VM instance."
26+
version: 1
2027
related_integrations:
2128
- id: google_agent_for_sap
2229
platform: GCP

0 commit comments

Comments
 (0)