Report eBPF service statuses instead of checking installation#334
Merged
srikrishnaveturi merged 3 commits intoAzure:devfrom Apr 13, 2026
Merged
Report eBPF service statuses instead of checking installation#334srikrishnaveturi merged 3 commits intoAzure:devfrom
srikrishnaveturi merged 3 commits intoAzure:devfrom
Conversation
Changed error case log messages to use the same 'EbpfCore: {summary}, NetEbpfExt: {summary}' format
huiminyan2017
approved these changes
Apr 13, 2026
ZhidongPeng
added a commit
that referenced
this pull request
Apr 27, 2026
* Report eBPF service statuses instead of checking installation (#334) * Report eBPF service statuses instead of checking installation --------- Co-authored-by: Srikrishna Veturi <sveturi@microsoft.com> * Fix clippy::unnecessary_sort_by (#336) * Bump rand from 0.8.5 to 0.8.6 (#339) Bumps [rand](https://github.com/rust-random/rand) from 0.8.5 to 0.8.6. - [Release notes](https://github.com/rust-random/rand/releases) - [Changelog](https://github.com/rust-random/rand/blob/0.8.6/CHANGELOG.md) - [Commits](rust-random/rand@0.8.5...0.8.6) --- updated-dependencies: - dependency-name: rand dependency-version: 0.8.6 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump openssl from 0.10.73 to 0.10.78 (#338) Bumps [openssl](https://github.com/rust-openssl/rust-openssl) from 0.10.73 to 0.10.78. - [Release notes](https://github.com/rust-openssl/rust-openssl/releases) - [Commits](rust-openssl/rust-openssl@openssl-v0.10.73...openssl-v0.10.78) --- updated-dependencies: - dependency-name: openssl dependency-version: 0.10.78 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Zhidong Peng <zpeng@microsoft.com> * GPA service to use host-date-time for signed http requests (#335) * GPA service to use host-date-time for signed http requests * add logging * fix typo * Bump rand from 0.8.5 to 0.8.6 (#339) Bumps [rand](https://github.com/rust-random/rand) from 0.8.5 to 0.8.6. - [Release notes](https://github.com/rust-random/rand/releases) - [Changelog](https://github.com/rust-random/rand/blob/0.8.6/CHANGELOG.md) - [Commits](rust-random/rand@0.8.5...0.8.6) --- updated-dependencies: - dependency-name: rand dependency-version: 0.8.6 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump openssl from 0.10.73 to 0.10.78 (#338) Bumps [openssl](https://github.com/rust-openssl/rust-openssl) from 0.10.73 to 0.10.78. - [Release notes](https://github.com/rust-openssl/rust-openssl/releases) - [Commits](rust-openssl/rust-openssl@openssl-v0.10.73...openssl-v0.10.78) --- updated-dependencies: - dependency-name: openssl dependency-version: 0.10.78 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Zhidong Peng <zpeng@microsoft.com> * resolve comments Co-authored-by: Copilot <copilot@github.com> * fix spelling --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Zhidong Peng <zpeng@micrsoft.com> Co-authored-by: Copilot <copilot@github.com> * Add local file-based access-control rule support. (#329) * Add local file-based access-control rule support. * formatting * resolve comments and validate the parsed local rules. * fix formatting. * fix case-insensitive match * prefix_local_rule_names Co-authored-by: Copilot <copilot@github.com> * Display useLocalFileRules. * update log level at attemptting Co-authored-by: Copilot <copilot@github.com> * fix formatting --------- Co-authored-by: Zhidong Peng <zpeng@micrsoft.com> Co-authored-by: Copilot <copilot@github.com> * cmdline to take the first 4 arguments (#340) * cmdline to take the first 4 arguments * fix in common code path * Update version to 1.0.43 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Srikrishna Veturi <veturi.srikrishna@gmail.com> Co-authored-by: Srikrishna Veturi <sveturi@microsoft.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Zhidong Peng <zpeng@micrsoft.com> Co-authored-by: Copilot <copilot@github.com>
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR improves the eBPF service status reporting in the GuestProxy Agent VM Extension. Previously, the eBPF substatus only reported whether the EbpfCore and NetEbpfExt driver services were installed. This meant the status could show
Successeven when one or both services were stopped or in a degraded state.The change updates eBPF status reporting to query the runtime state (e.g., Running, Stopped) and start type (e.g., AutoStart, Disabled) of each eBPF driver service. The substatus now reports
Successonly when both services are confirmed running, andErrorotherwise — providing more accurate and actionable health information. Each error case also includes the state of the other service in the message for full context.The implementation is also refactored to use a dedicated
ServiceStatusInfostruct (replacing a raw tuple return) and a purebuild_ebpf_substatushelper function that isolates the substatus decision logic from I/O, enabling deterministic unit testing without mocking.High Level Code Changes
proxy_agent_shared/src/service/windows_service.rsServiceStatusInfostruct to hold the runtime status of a Windows service, with fields forservice_name,state: Option<ServiceState>, andstart_type.summary()andmessage()methods onServiceStatusInfo.summary()produces a human-readable string (e.g.,"Running, AutoStart"or"NotInstalled");message()produces a log-friendly string using the service name and summary — thecheck_service_status:prefix is prepended by callers when logging.query_service_statuspublic so it can be consumed by the new status-check logic.ServiceStateas a public type for callers to pattern-match on.ServiceStatusInfo::summary()andServiceStatusInfo::message()covering not-installed, running, and stopped states.proxy_agent_shared/src/service.rscheck_service_status()which returns aServiceStatusInfostruct. Callers determine whether a service is installed by checkingstate.is_some()— the previous redundantis_installedboolean and prebuilt message string have been removed.ServiceStatusInfoandServiceStatefrom the module for use by callers.test_check_service_status) that validates the function against both a non-existent service and a freshly installed test service.proxy_agent_extension/src/service_main.rsbuild_ebpf_substatus(core, ext)helper function that takes twoServiceStatusInfovalues and returns theSubStatusto report. This isolates all substatus decision logic from the I/O inreport_ebpf_status.report_ebpf_status()to callcheck_service_statusfor both services as two independent (non-nested) calls, so both services are always queried and logged regardless of the other's state.Success/STATUS_CODE_OKonly when both EbpfCore and NetEbpfExt areRunning; otherwise reportsError/STATUS_CODE_NOT_OK.test_build_ebpf_substatusunit test covering all 7 meaningful state combinations: both not installed, one missing with the other running, both running (success), and partial/both-stopped error cases.Testing
Manually replaced the built ProxyAgentExt.exe in a VM and tested the following cases: