FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

KVM HA: Fix CheckOnHostAnswer success flag when there is no heartbeat by sureshanaparti · Pull Request #13373 · apache/cloudstack · GitHub

KVM HA: Fix CheckOnHostAnswer success flag when there is no heartbeat - #13373

Merged
weizhouapache merged 4 commits into
apache:4.22from
shapeblue:ha-checkonhostanswer-fix
Jul 6, 2026
Merged

KVM HA: Fix CheckOnHostAnswer success flag when there is no heartbeat#13373
weizhouapache merged 4 commits into
apache:4.22from
shapeblue:ha-checkonhostanswer-fix

Conversation

sureshanaparti commented Jun 8, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Description

This PR fixes the CheckOnHostAnswer success flag when there is no heartbeat, for KVM HA.

Fixes #13371

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

sureshanaparti linked an issue Jun 8, 2026 that may be closed by this pull request

Copy link
Copy Markdown

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

codecov Bot commented Jun 8, 2026
edited
Loading

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.67%. Comparing base (21b2025) to head (4d298b4).
⚠️ Report is 7 commits behind head on 4.22.

Files with missing lines Patch % Lines
...ache/cloudstack/kvm/ha/KVMHostActivityChecker.java 0.00% 1 Missing ⚠️
...oud/hypervisor/vmware/resource/VmwareResource.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.22   #13373      +/-   ##
============================================
- Coverage     17.67%   17.67%   -0.01%     
+ Complexity    15792    15791       -1     
============================================
  Files          5922     5922              
  Lines        533165   533166       +1     
  Branches      65208    65208              
============================================
  Hits          94242    94242              
- Misses       428276   428277       +1     
  Partials      10647    10647              
Flag Coverage Δ
uitests 3.69% <ø> (ø)
unittests 18.75% <50.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

Copy link
Copy Markdown

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

sureshanaparti requested a review from Copilot June 8, 2026 12:09
sureshanaparti changed the base branch from main to 4.22 June 8, 2026 12:12

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

Copy link
Copy Markdown

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 18187

Copy link
Copy Markdown
Member

@sureshanaparti
there is a test failure

14:34:05 [ERROR] testCheckOnHostCommand(com.cloud.hypervisor.kvm.resource.LibvirtComputingResourceTest)  Time elapsed: 0.279 s  <<< FAILURE!
14:34:05 java.lang.AssertionError
14:34:05 	at com.cloud.hypervisor.kvm.resource.LibvirtComputingResourceTest.testCheckOnHostCommand(LibvirtComputingResourceTest.java:3133)

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

Copy link
Copy Markdown

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

sureshanaparti marked this pull request as ready for review June 8, 2026 13:20

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18189

Copy link
Copy Markdown
Member

@sureshanaparti
it looks like the change made no effects

public CheckOnHostAnswer(CheckOnHostCommand cmd, String details) {
super(cmd, false, details);
determined = false;
alive = false;
}

these two lines are the same actually

                return new CheckOnHostAnswer(command, "Heart is not beating");
                return new CheckOnHostAnswer(command, false, "Heart is not beating");

sureshanaparti commented Jun 8, 2026
edited
Loading

Copy link
Copy Markdown
Contributor Author

@sureshanaparti it looks like the change made no effects

public CheckOnHostAnswer(CheckOnHostCommand cmd, String details) {
super(cmd, false, details);
determined = false;
alive = false;
}

these two lines are the same actually

                return new CheckOnHostAnswer(command, "Heart is not beating");
                return new CheckOnHostAnswer(command, false, "Heart is not beating");

@weizhouapache answer's success flag is set in the second case (result should be true which indicates the cmd is successfully processed without any errors, and then get the other details - isAlive, etc), and answer.getResult() is true here:

if (answer != null) {
if (answer.getResult()) {
hostStatusFromNeighbour = ((CheckOnHostAnswer)answer).isAlive() ? Status.Up : Status.Down;
logger.debug("Neighboring {} returned status [{}] for the investigated {}.", neighbor.toString(), hostStatusFromNeighbour, host.toString());
if (hostStatusFromNeighbour == Status.Up) {
return hostStatusFromNeighbour;
}
} else {
logger.debug("{} is not active according to neighbor {}, details: {}.", host.toString(), neighbor.toString(), answer.getDetails());
}
} else {

weizhouapache commented Jun 8, 2026
edited by sureshanaparti
Loading

Copy link
Copy Markdown
Member

@weizhouapache answer's success flag is set in the second case (result should be true which indicates the cmd is success, and then get the other details - isAlive, etc), and answer.getResult() is true here:

if (answer != null) {
if (answer.getResult()) {
hostStatusFromNeighbour = ((CheckOnHostAnswer)answer).isAlive() ? Status.Up : Status.Down;
logger.debug("Neighboring {} returned status [{}] for the investigated {}.", neighbor.toString(), hostStatusFromNeighbour, host.toString());
if (hostStatusFromNeighbour == Status.Up) {
return hostStatusFromNeighbour;
}
} else {
logger.debug("{} is not active according to neighbor {}, details: {}.", host.toString(), neighbor.toString(), answer.getDetails());
}
} else {

ok, I will re-test

weizhouapache left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

verified ok

Copy link
Copy Markdown
Member

@kiranchavala
could you test it too if you have time ? thanks

Copy link
Copy Markdown
Member

need another approval on dev review or qa

cc @harikrishna-patnala @DaanHoogland @kiranchavala @NuxRo

@Override
public Answer execute(final CheckOnHostCommand command, final CitrixResourceBase citrixResourceBase) {
return new CheckOnHostAnswer(command, "Not Implmeneted");
return new CheckOnHostAnswer(command, "Not Implemented");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

is the <null> needed as second parameter here as well?

harikrishna-patnala added a commit to shapeblue/cloudstack that referenced this pull request Jul 6, 2026

kiranchavala left a comment
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM, VM ha kicks in after the host is determined as Down

covered both scenarios

  1. VM HA + Host ha Disabled

  2. VM HA + Host ha Enabled

Before fix

2026-07-06 11:09:02,217 INFO [c.c.a.m.ClusteredAgentManagerImpl] (AgentTaskPool-1:[ctx-95f49608]) (logid:e286330d) The agent from host Host {"id":1,"name":"ref-trl-11971-k-Mol8-kiran-chavala-kvm1","type":"Routing","uuid":"f381eed2-bc93-43a1-9a8a-d439d804b40a"} state determined is Disconnected

After fix

2026-07-06 11:31:19,802 INFO [c.c.a.m.ClusteredAgentManagerImpl] (AgentTaskPool-4:[ctx-e65f658b]) (logid:2e73eea3) The agent from host Host {"id":1,"name":"ref-trl-11971-k-Mol8-kiran-chavala-kvm1","type":"Routing","uuid":"f381eed2-bc93-43a1-9a8a-d439d804b40a"} state determined is Down

2026-07-06 11:31:19,840 WARN [c.c.a.AlertManagerImpl] (AgentTaskPool-4:[ctx-e65f658b]) (logid:2e73eea3) No recipients set in global setting 'alert.email.addresses', skipping sending alert with subject [Host is down, name: ref-trl-11971-k-Mol8-kiran-chavala-kvm1 (id:1), availability zone: ref-trl-11971-k-Mol8-kiran-chavala, pod: Pod1] and content [Host [name: ref-trl-11971-k-Mol8-kiran-chavala-kvm1 (id:1), availability zone: ref-trl-11971-k-Mol8-kiran-chavala, pod: Pod1] is down. Starting HA on the following VMs: test-vmha].
2026-07-06 11:31:19,841 DEBUG [c.c.h.HighAvailabilityManagerExtImpl] (AgentTaskPool-4:[ctx-e65f658b]) (logid:2e73eea3) Notifying HA Mgr of to restart Instance VM instance {"id":44,"instanceName":"i-2-44-VM","state":"Running","type":"User","uuid":"d808e241-5ade-4465-bd3d-75c700fee5a4"}
2026-07-06 11:31:19,843 DEBUG [c.c.h.HighAvailabilityManagerExtImpl] (AgentTaskPool-4:[ctx-e65f658b]) (logid:2e73eea3) HA schedule restart
2026-07-06 11:31:19,847 INFO [c.c.h.HighAvailabilityManagerExtImpl] (AgentTaskPool-4:[ctx-e65f658b]) (logid:2e73eea3) Schedule vm for HA: VM instance {"id":44,"instanceName":"i-2-44-VM","state":"Running","type":"User","uuid":"d808e241-5ade-4465-bd3d-75c700fee5a4"}

Copy link
Copy Markdown
Member

thanks @kiranchavala

merging

weizhouapache merged commit 4262c02 into apache:4.22 Jul 6, 2026
41 of 43 checks passed
weizhouapache deleted the ha-checkonhostanswer-fix branch July 6, 2026 11:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VM HA is broken in CloudStack 4.22.1.0

8 participants


Back | FazBrowse Home | New Git URL