Skip to content

Support guest health reporting#73

Open
aditigaur4 wants to merge 2 commits into
mainfrom
ghr
Open

Support guest health reporting#73
aditigaur4 wants to merge 2 commits into
mainfrom
ghr

Conversation

@aditigaur4

@aditigaur4 aditigaur4 commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Add support for guest health reporting via Jetpack.

@aditigaur4
aditigaur4 requested a review from Copilot July 20, 2026 23:42
@aditigaur4
aditigaur4 marked this pull request as draft July 20, 2026 23:42

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.

Pull request overview

This PR adds support for Azure Guest Health Reporting (GHR) by introducing a GHR category taxonomy and plumbing it through health reports so Jetpack can publish the appropriate action/category metadata when reporting unhealthy states.

Changes:

  • Introduces GHRCategory enum and adds a ghr_category field to HealthReport.
  • Updates Reporter to gate GHR support by Jetpack version and to include --action-type GHR / --ghr-category when publishing non-OK conditions.
  • Adds initial GHR category resolution for network (InfiniBand port down) and GPU (missing GPU count, DCGM incidents/XIDs/diag errors), including DCGM error→GHR mappings.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
healthagent/reporter.py Adds ghr_category to reports and publishes GHR metadata via Jetpack when enabled/version-supported.
healthagent/network.py Sets ghr_category for InfiniBand port-down scenarios.
healthagent/gpu.py Sets ghr_category for missing GPU and for incident/XID/diag-derived GPU failures.
healthagent/ghr.py Adds the GHRCategory enum defining supported guest health categories.
healthagent/bindings.py Adds DCGM error/XID → GHRCategory mapping helpers and constants used by GPU reporting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread healthagent/bindings.py Outdated
Comment thread healthagent/reporter.py
Comment on lines +290 to +292
if self.enable_ghr:
if report.ghr_category is not None:
args.extend(['--action-type', 'GHR', '--ghr-category', report.ghr_category.value])
Comment thread healthagent/network.py Outdated
Comment on lines +220 to +228
# Resolve GHR for IB port down
for ni in interfaces:
if ni.type == NetDevType.INFINIBAND and ni.ib_device:
for port in ni.ib_device.ports.values():
if port.state and not port.state.startswith("4:"):
report.ghr_category = GHRCategory.IB_PORT_DOWN
break
if report.ghr_category:
break

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.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

healthagent/network.py:137

  • In the permanent-degraded path (max strikes exceeded), the report is escalated to ERROR but no GHR category is selected. Because ghr_error/ghr_any are reset on every run, subsequent runs after the strike limit will publish an ERROR without the GHR action metadata, even though the condition is still degraded. Set ghr_error here as well (when a mapping exists) before returning.
        def check_field(iface_name, field, check: 'ThresholdCheck', value, port_num=None, config_key=None):
            key = (iface_name, field, port_num)
            max_strikes = check.strikes

            # Permanently degraded — re-report error without re-evaluating

Comment thread healthagent/bindings.py

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.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread healthagent/ghr.py
Comment on lines +1 to +4
from enum import Enum

class GHRCategory(Enum):
# Operational
Comment thread healthagent/network.py
Comment on lines +237 to +238
report.ghr_category = ghr_error or ghr_any

Comment thread healthagent/reporter.py
Comment on lines +165 to +169
version = self._get_jetpack_version()
if version is None or version < self._parse_version(self.JETPACK_VERSION_MINIMUM):
self.publish_cc = False
self.enable_ghr = False
log.warning(f"Jetpack version too old or unknown, disabling CC publishing and GHR")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants