René's URL Explorer Experiment


Title: KVM: kvmheartbeat.sh / kvmspheartbeat.sh hardcoded sysrq reboot causes false-positive host fencing on LINSTOR/DRBD primary storage · Issue #13089 · apache/cloudstack · GitHub

Open Graph Title: KVM: kvmheartbeat.sh / kvmspheartbeat.sh hardcoded sysrq reboot causes false-positive host fencing on LINSTOR/DRBD primary storage · Issue #13089 · apache/cloudstack

X Title: KVM: kvmheartbeat.sh / kvmspheartbeat.sh hardcoded sysrq reboot causes false-positive host fencing on LINSTOR/DRBD primary storage · Issue #13089 · apache/cloudstack

Description: Description The KVM agent's storage heartbeat scripts (kvmheartbeat.sh, kvmspheartbeat.sh) hard-code an immediate kernel-level reboot via echo b > /proc/sysrq-trigger when a heartbeat write to primary storage times out. This: Bypasses al...

Open Graph Description: Description The KVM agent's storage heartbeat scripts (kvmheartbeat.sh, kvmspheartbeat.sh) hard-code an immediate kernel-level reboot via echo b > /proc/sysrq-trigger when a heartbeat write to prim...

X Description: Description The KVM agent's storage heartbeat scripts (kvmheartbeat.sh, kvmspheartbeat.sh) hard-code an immediate kernel-level reboot via echo b > /proc/sysrq-trigger when a heartbeat write ...

Opengraph URL: https://github.com/apache/cloudstack/issues/13089

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"KVM: kvmheartbeat.sh / kvmspheartbeat.sh hardcoded sysrq reboot causes false-positive host fencing on LINSTOR/DRBD primary storage","articleBody":"### Description\n\nThe KVM agent's storage heartbeat scripts (`kvmheartbeat.sh`, `kvmspheartbeat.sh`) hard-code an immediate kernel-level reboot via `echo b \u003e /proc/sysrq-trigger` when a heartbeat write to primary storage times out. This:\n\n1. Bypasses all OS-level shutdown protections (no clean filesystem unmount, no graceful VM stop)\n2. Drops ALL running VMs on the host instantly\n3. Triggers HA cascade — surviving hosts get flooded with VM restart requests\n4. Cannot be replaced with a gentler action (restart agent, graceful reboot, log-only) without forking the script\n\n### Affected files\n\n- `scripts/vm/hypervisor/kvm/kvmheartbeat.sh` (around line 162)\n- `scripts/vm/hypervisor/kvm/kvmspheartbeat.sh` (around line 64)\n\n```sh\n# Both scripts contain:\n/usr/bin/logger -t heartbeat \"...will reboot system...\"\nsync \u0026\nsleep 5\necho b \u003e /proc/sysrq-trigger     # \u003c-- hardcoded panic-reboot\n```\n\n### Reproduction\n\n1. CloudStack 4.22.0.0 KVM hypervisor running Ubuntu 24.04\n2. Primary storage: **LINSTOR with DRBD** replication (Linstor storage pool)\n3. Trigger parallel DRBD resyncs across many resources (e.g. after a peer-node reboot, or `linstor resource resume-sync` after a maintenance pause)\n4. While resync I/O contends with normal I/O on the same disks, the heartbeat write to its `hb` file occasionally takes longer than the hardcoded timeout\n5. The host immediately force-reboots itself via sysrq, even though no actual fault exists\n\n### Real-world impact\n\nWe hit this 5+ times within 4 hours during recovery from an unrelated incident. Cascade pattern:\n\n- Heartbeat times out on host A → sysrq reboot → 90+ VMs dropped\n- HA worker reschedules those VMs onto host B\n- Host B's I/O spikes → its heartbeat times out → sysrq reboot → all its VMs dropped\n- Host A comes back, repeat\n\nEach reboot took ~3 minutes; total customer-visible outage was several hours. Patching the script line out (`echo b \u003e /proc/sysrq-trigger` → log-only) immediately stopped the cascade.\n\nThe exact log line preceding each reboot:\n\n```\nheartbeat[68685]: kvmspheartbeat.sh will reboot system because it was unable to write the heartbeat to the storage.\n```\n\n### Affected versions\n\n- CloudStack: **4.22.0.0** (cloudstack-agent / cloudstack-common 4.22.0.0)\n- Hypervisor: Ubuntu 24.04 LTS / KVM, libvirt 10.x\n- Storage: LINSTOR 1.33.2 / DRBD 9.3.1 (LINBIT public PPA)\n- Reproduces on both single-cluster and multi-cluster zones\n\n### Why this matters\n\nThe assumption \"heartbeat write timeout = host is dead\" was reasonable for **NFS shared storage** where transient I/O latency is rare and the only failure mode of concern is split-brain during a real network partition.\n\nWith **LINSTOR/DRBD** (or any local storage doing replication), the same disk serves application I/O, replication I/O, and heartbeat I/O — heartbeat can be transiently delayed without the host being dead. A fence-on-failure mechanism shouldn't be a binary panic-button: it should be **configurable**, and ideally **graceful** by default.\n\n### Existing partial workaround (poorly documented)\n\nThere is already an agent property `reboot.host.and.alert.management.on.heartbeat.timeout` (default `true`) that, when set to `false`, prevents the Java-side `KVMHAMonitor` from invoking the shell script in fence mode (cflag=1). Setting:\n\n```properties\nreboot.host.and.alert.management.on.heartbeat.timeout=false\n```\n\navoids the reboot entirely. This is an undocumented but effective workaround for the described issue.\n\nHowever, this is a binary on/off — it doesn't support intermediate fence actions (restart agent, graceful reboot, log-with-alert). Operators want a middle ground: detect the failure, *react* in a less destructive way.\n\n### Proposed enhancement\n\nAdd a finer-grained `kvm.heartbeat.fence.action` property that **supersedes** the binary boolean when set:\n\n```properties\n# Action when storage heartbeat write fails persistently\n# Values: reboot | graceful-reboot | restart-agent | log-only\n# Default: reboot (preserves current behavior for backward compatibility)\nkvm.heartbeat.fence.action=graceful-reboot\n```\n\nAction semantics:\n\n- `reboot` — current behavior (sysrq-trigger), kept as fallback for backward compat\n- `graceful-reboot` — `systemctl reboot` instead of sysrq, lets VMs stop cleanly\n- `restart-agent` — restart `cloudstack-agent` only; running VMs survive\n- `log-only` — log + alert, take no automatic action (admin investigates)\n\nExisting `reboot.host.and.alert.management.on.heartbeat.timeout=false` continues to work as a complete bypass (Java-side, never invokes the shell script in fence mode).\n\n### Workarounds available today\n\n1. **Set `reboot.host.and.alert.management.on.heartbeat.timeout=false`** in `/etc/cloudstack/agent/agent.properties` (Java-side flag — best official option until a proper fix lands)\n2. **Patch both shell scripts** to replace `echo b \u003e /proc/sysrq-trigger` with a `logger` line — survives until next package upgrade\n3. **Move heartbeat target to host-local storage** that's not under DRBD I/O contention\n\n### Willingness to contribute\n\nA follow-up PR implementing the configurable `kvm.heartbeat.fence.action` design above is in progress.\n","author":{"url":"https://github.com/jmsperu","@type":"Person","name":"jmsperu"},"datePublished":"2026-04-30T23:56:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/13089/cloudstack/issues/13089"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e9191fd5-116d-a7e0-9230-1dd0ebcbc740
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9AA2:216A08:420881:5829A7:6A4DC7C1
html-safe-nonce24969fcd030d7cdc8afbf134db1d92188087eb0796ef88249f8a3a109cda8176
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QUEyOjIxNkEwODo0MjA4ODE6NTgyOUE3OjZBNERDN0MxIiwidmlzaXRvcl9pZCI6IjUxNDE4NzM5NjE5Njk3NjU3NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac77ca49e3a70e02f80a10924a966e5bf189ce4f04a68fe60b7ce71d551b74906a
hovercard-subject-tagissue:4361989413
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/apache/cloudstack/13089/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c0e9d9b45503698d6782f099800563aefe1e9afffda9a2ca20b258cc27566769/apache/cloudstack/issues/13089
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c0e9d9b45503698d6782f099800563aefe1e9afffda9a2ca20b258cc27566769/apache/cloudstack/issues/13089
og:image:altDescription The KVM agent's storage heartbeat scripts (kvmheartbeat.sh, kvmspheartbeat.sh) hard-code an immediate kernel-level reboot via echo b > /proc/sysrq-trigger when a heartbeat write to prim...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejmsperu
hostnamegithub.com
expected-hostnamegithub.com
None06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33
turbo-cache-controlno-preview
go-importgithub.com/apache/cloudstack git https://github.com/apache/cloudstack.git
octolytics-dimension-user_id47359
octolytics-dimension-user_loginapache
octolytics-dimension-repository_id9759448
octolytics-dimension-repository_nwoapache/cloudstack
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id9759448
octolytics-dimension-repository_network_root_nwoapache/cloudstack
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/apache/cloudstack/issues/13089#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fcloudstack%2Fissues%2F13089
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fcloudstack%2Fissues%2F13089
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=apache%2Fcloudstack
Reloadhttps://github.com/apache/cloudstack/issues/13089
Reloadhttps://github.com/apache/cloudstack/issues/13089
Reloadhttps://github.com/apache/cloudstack/issues/13089
Please reload this pagehttps://github.com/apache/cloudstack/issues/13089
apache https://github.com/apache
cloudstackhttps://github.com/apache/cloudstack
Notifications https://github.com/login?return_to=%2Fapache%2Fcloudstack
Fork 1.3k https://github.com/login?return_to=%2Fapache%2Fcloudstack
Star 3k https://github.com/login?return_to=%2Fapache%2Fcloudstack
Code https://github.com/apache/cloudstack
Issues 536 https://github.com/apache/cloudstack/issues
Pull requests 268 https://github.com/apache/cloudstack/pulls
Discussions https://github.com/apache/cloudstack/discussions
Actions https://github.com/apache/cloudstack/actions
Projects https://github.com/apache/cloudstack/projects
Wiki https://github.com/apache/cloudstack/wiki
Security and quality 0 https://github.com/apache/cloudstack/security
Insights https://github.com/apache/cloudstack/pulse
Code https://github.com/apache/cloudstack
Issues https://github.com/apache/cloudstack/issues
Pull requests https://github.com/apache/cloudstack/pulls
Discussions https://github.com/apache/cloudstack/discussions
Actions https://github.com/apache/cloudstack/actions
Projects https://github.com/apache/cloudstack/projects
Wiki https://github.com/apache/cloudstack/wiki
Security and quality https://github.com/apache/cloudstack/security
Insights https://github.com/apache/cloudstack/pulse
Featurehttps://github.com/apache/cloudstack/issues?q=type:"Feature"
#13090https://github.com/apache/cloudstack/pull/13090
KVM: kvmheartbeat.sh / kvmspheartbeat.sh hardcoded sysrq reboot causes false-positive host fencing on LINSTOR/DRBD primary storagehttps://github.com/apache/cloudstack/issues/13089#top
#13090https://github.com/apache/cloudstack/pull/13090
https://github.com/jmsperu
4.23.0https://github.com/apache/cloudstack/milestone/42
https://github.com/jmsperu
jmsperuhttps://github.com/jmsperu
on Apr 30, 2026https://github.com/apache/cloudstack/issues/13089#issue-4361989413
jmsperuhttps://github.com/jmsperu
Featurehttps://github.com/apache/cloudstack/issues?q=type:"Feature"
Apache CloudStack BugFest - Issueshttps://github.com/orgs/apache/projects/362
4.23.0https://github.com/apache/cloudstack/milestone/42
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.