Repository navigation
vm-repair: add read-only guest MANA driver probe helper - #10587
Open
Edwin Bernal Microsoft (EdwinBernal1) wants to merge 2 commits into
Open
Edwin Bernal Microsoft (EdwinBernal1) wants to merge 2 commits into
Edwin Bernal Microsoft (EdwinBernal1) wants to merge 2 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
Ship packaged, parameterless Linux and Windows probe scripts and an internal _check_guest_mana_driver helper that runs the OS-appropriate probe through Run Command. It reports the accelerated-networking device (mana, mellanox, none, unknown) and MANA driver availability (present, missing, unknown). Any run or parse failure returns unknown, never missing. No command calls the helper yet. Bump version to 2.5.1. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Edwin Bernal Microsoft (EdwinBernal1)
force-pushed
the
vmrepair/mana-guest-driver-probe
branch
from
November 17, 2026 17:50
600e400 to
d802c53
Compare
Edwin Bernal Microsoft (EdwinBernal1)
marked this pull request as ready for review
November 17, 2026 17:52
Copilot started reviewing on behalf of
Edwin Bernal Microsoft (EdwinBernal1)
November 17, 2026 17:53
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unhandled launcher and response-shape errors violate the helper’s unknown-on-failure contract, while probe read and search failures can incorrectly report hardware or drivers as absent.
3 open issues
What changed in this PR
Adds an internal, read-only MANA guest probe to vm-repair, building on the reset-NIC telemetry groundwork. No command invokes the helper yet, so public command behavior remains unchanged.
Changes:
- Adds Linux and Windows scripts to detect MANA/Mellanox hardware and report MANA driver status.
- Adds marker parsing, an OS-specific Run Command helper, and regression coverage.
- Packages both scripts, documents their limitations, and bumps the extension to 2.5.1.
| File | Description |
|---|---|
src/vm-repair/setup.py |
Packages both probes and updates the version. |
src/vm-repair/README.md |
Documents probe results, constraints, and command isolation. |
src/vm-repair/HISTORY.rst |
Adds the 2.5.1 release entry. |
src/vm-repair/azext_vm_repair/tests/latest/test_mana_guest_probe.py |
Tests parsing, helper behavior, packaging, and script restrictions. |
src/vm-repair/azext_vm_repair/scripts/win-mana-driver-probe.ps1 |
Adds Windows PCI and network-adapter detection. |
src/vm-repair/azext_vm_repair/scripts/linux-mana-driver-probe.sh |
Adds Linux PCI and kernel-module detection. |
src/vm-repair/azext_vm_repair/repair_utils.py |
Adds the marker parser and guest-probe helper. |
Review effort: Balanced
Address review feedback. The helper now also maps launcher failures (OSError) and unexpected run-command response shapes (AttributeError, non-string output) to unknown instead of raising. The Linux probe reports hardware=none only after reading every PCI entry, and driver=missing only when both the built-in list and the module tree were read without error; otherwise it reports unknown. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
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.

🤖 PR Validation — ️✔️ All clear
Summary
Add a read-only guest probe that reports whether a VM has a MANA or Mellanox accelerated-networking device and whether its operating system has the MANA network driver. This is groundwork for MANA migration diagnostics and builds on the reset-NIC telemetry schema from #10576 (merged). No command calls it yet; command behavior, parameters, and output are unchanged.
Requested by / source
Type
Changes
src/vm-repair/azext_vm_repair/scripts/linux-mana-driver-probe.sh(new, POSIXsh): PCI vendor/device1414:00bais MANA, vendor15b3is Mellanox; the driver ispresentwhenmanais loaded, built in, or present as a module file for the running kernel.src/vm-repair/azext_vm_repair/scripts/win-mana-driver-probe.ps1(new, Windows PowerShell 5.1): present PCI deviceVEN_1414&DEV_00BAis MANA,VEN_15B3is Mellanox; on MANA hardware the driver ispresentwhen aMicrosoft Azure Network Adapternetwork adapter exists, otherwisemissing. Off MANA hardware the driver isunknown.src/vm-repair/azext_vm_repair/repair_utils.py:_parse_mana_probe_output()strictly parses exactly one marker line;_check_guest_mana_driver()runs the OS-appropriate probe through the existing_invoke_run_commandand returns{hardware, driver, source}.src/vm-repair/setup.py: package both probe scripts; version 2.5.1.src/vm-repair/HISTORY.rst,src/vm-repair/README.md: changelog entry and internal-probe documentation.src/vm-repair/azext_vm_repair/tests/latest/test_mana_guest_probe.py(new): regression coverage.Detection logic follows the Microsoft Learn MANA guidance for Windows and Linux.
Design notes
unknownis never reported asmissing. Any Run Command failure, unready VM agent, validation rejection, malformed response, or unrecognized output returnsunknown. The helper never raises.{present: bool, versionOrDriver, source}. A Boolean cannot represent "not determined," so the helper returns string enums instead, consistent with theunknownconvention established in vm-repair: prepare MANA reset-NIC telemetry schema #10576.reset-nic, deliberately. Run Command needs a ready VM agent and outbound guest connectivity to return results, cannot be canceled, and can run for up to 90 minutes (Run Command restrictions).reset-nictargets VMs whose guest networking is broken, so a blocking preflight would be least reliable when it matters most. How, and whether, to call it is a separate decision.Version & changelog
mainis 2.5.0 after vm-repair: prepare MANA reset-NIC telemetry schema #10576).Testing
mainafter vm-repair: prepare MANA reset-NIC telemetry schema #10576 merged; the PR now contains a single commit.unknown, packaging, and static read-only/no-input checks on both scripts.dashandbash(WSL Ubuntu); itsdriver=missingresult on that kernel was independently confirmed.mana_ib, Mellanox with and without the MANA module, no virtual function, and a non-MANA Microsoft PCI device.--previewplaceholder-URL finding, untouched here.Cross-repo impact (repair-script-library)
Backward compatibility
Follow-up (outside this PR)
reset-nic's critical path, or after connectivity is restored, rather than a blocking preflight.sourceVfVendorandguestManaPresenttelemetry fields once a command calls it.