Skip to content

Add dual NIC passthrough validation - #4579

Merged
vyadavmsft merged 2 commits into
mainfrom
users/vyadav/dual-nic-passthrough
Jul 15, 2026
Merged

Add dual NIC passthrough validation#4579
vyadavmsft merged 2 commits into
mainfrom
users/vyadav/dual-nic-passthrough

Conversation

@vyadavmsft

@vyadavmsft vyadavmsft commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator
  • Record the requested runbook count in the runtime passthrough context for:
    • Cloud Hypervisor/libvirt
    • Hyper-V
    • OpenVMM
  • Validate that each passthrough request has a positive device count.
  • Reject invalid libvirt and Hyper-V counts before allocating devices or modifying the VM.
  • Fail the functional test when fewer devices are assigned than requested.
  • Allow additional assigned devices when a complete IOMMU group must be passed through.
  • Verify that every assigned vendor/device ID is visible in the guest.
  • Aggregate identical vendor/device IDs globally so one guest device cannot satisfy multiple assigned entries.
  • Report requested, assigned, and verified counts by pool type in passed console and HTML results.

Example:

Passthrough devices tested: pci_net: requested=2, assigned=2, verified=2

Existing resource-exhaustion behavior is preserved, and this change does not modify two-guest performance tests or runner requirement precedence.

Description

Related Issue

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Documentation update

Checklist

  • Description is filled in above
  • No credentials, secrets, or internal details are included
  • Peer review requested (if not, add required peer reviewers after raising PR)
  • Tests executed and results posted below

Test Validation

Key Test Cases:

Impacted LISA Features:

Tested Azure Marketplace Images:

Test Results

Image VM Size Result
PASSED / FAILED / SKIPPED

Copilot AI review requested due to automatic review settings July 6, 2026 06:04

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 extends the device passthrough test coverage by adding a functional validation for dual PCI NIC passthrough on a single guest, and adjusts requirement/merging behavior so runbook-provided platform defaults remain intact while test cases can narrow specific passthrough requirements (e.g., per-node device counts).

Changes:

  • Adjust platform-vs-case extended schema merging so platform schemas act as defaults and case requirements can narrow/override specific fields.
  • Add a functional test case that validates two pci_net passthrough devices are assigned and visible in-guest (via vendor/device ID checks with lspci).
  • Refactor two-guest passthrough perf cases to use an explicit “one PCI NIC per node” requirement (to avoid dual-NIC functional runbooks impacting two-node perf topology).

Reviewed changes

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

File Description
lisa/runners/lisa_runner.py Changes extended schema merge order so platform schemas provide defaults and test requirements can override/narrow specific fields.
lisa/microsoft/testsuites/performance/networkperf_passthrough.py Introduces a shared two-guest passthrough requirement with explicit per-node PCI NIC passthrough config.
lisa/microsoft/testsuites/device_passthrough/functional_tests.py Adds a dual-NIC passthrough functional validation and refactors passthrough-context parsing into reusable helpers.

Comment thread lisa/microsoft/testsuites/performance/networkperf_passthrough.py Outdated
Comment thread lisa/microsoft/testsuites/device_passthrough/functional_tests.py Outdated
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

⚠️ AI Test Selection — cancelled

53 test case(s) selected (view run)

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Count
✅ Passed 12
❌ Failed 0
⏭️ Skipped 3
Total 15
Test case details
Test Case Status Time (s) Message
perf_nested_hyperv_storage_singledisk (lisa_0_4) ⏭️ SKIPPED 0.000 check skipped: OS type mismatch: ["requires [<class 'lisa.operating_system.Windows'>] but VM supports [<class 'lisa.oper
perf_nested_kvm_storage_singledisk (lisa_0_2) ✅ PASSED 5475.946
perf_nested_hyperv_storage_multidisk (lisa_0_5) ⏭️ SKIPPED 0.000 check skipped: OS type mismatch: ["requires [<class 'lisa.operating_system.Windows'>] but VM supports [<class 'lisa.oper
perf_nested_hyperv_ntttcp_different_l1_nat (lisa_0_8) ⏭️ SKIPPED 0.000 check skipped: OS type mismatch: ["requires [<class 'lisa.operating_system.Windows'>] but VM supports [<class 'lisa.oper
perf_epoll (lisa_0_11) ✅ PASSED 184.135
perf_messaging (lisa_0_10) ✅ PASSED 1992.615
perf_nvme_io_uring (lisa_0_1) ✅ PASSED 5343.001
perf_resource_disk_1024k (lisa_0_43) ✅ PASSED 1626.208
perf_resource_disk_4k (lisa_0_44) ✅ PASSED 4416.958
perf_ultra_datadisks_1024k (lisa_0_36) ✅ PASSED 1053.806
perf_storage_generic_fio_test (lisa_0_52) ✅ PASSED 4483.674
perf_ultra_datadisks_4k (lisa_0_35) ✅ PASSED 4368.976
perf_tcp_latency_sriov (lisa_0_13) ✅ PASSED 179.157
perf_tcp_single_pps_sriov (lisa_0_15) ✅ PASSED 167.819
perf_tcp_max_pps_sriov (lisa_0_17) ✅ PASSED 132.472

LiliDeng
LiliDeng previously approved these changes Jul 6, 2026
@vyadavmsft
vyadavmsft force-pushed the users/vyadav/dual-nic-passthrough branch from d0f7c9b to 714f8b0 Compare July 6, 2026 17:15
Copilot AI review requested due to automatic review settings July 6, 2026 18:34
@vyadavmsft
vyadavmsft force-pushed the users/vyadav/dual-nic-passthrough branch from 714f8b0 to 6c206a3 Compare July 6, 2026 18:34
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

⚠️ AI Test Selection — cancelled

53 test case(s) selected (view run)

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Count
✅ Passed 3
❌ Failed 0
⏭️ Skipped 1
Total 4
Test case details
Test Case Status Time (s) Message
perf_nested_hyperv_storage_singledisk (lisa_0_4) ⏭️ SKIPPED 0.000 check skipped: OS type mismatch: ["requires [<class 'lisa.operating_system.Windows'>] but VM supports [<class 'lisa.oper
perf_epoll (lisa_0_11) ✅ PASSED 194.546
perf_messaging (lisa_0_10) ✅ PASSED 2049.443
perf_resource_disk_1024k (lisa_0_43) ✅ PASSED 1620.726

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 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread lisa/microsoft/testsuites/device_passthrough/functional_tests.py Outdated
Copilot AI review requested due to automatic review settings July 6, 2026 19:01
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

⚠️ AI Test Selection — cancelled

53 test case(s) selected (view run)

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Count
✅ Passed 1
❌ Failed 0
⏭️ Skipped 1
Total 2
Test case details
Test Case Status Time (s) Message
perf_nested_hyperv_storage_singledisk (lisa_0_4) ⏭️ SKIPPED 0.000 check skipped: OS type mismatch: ["requires [<class 'lisa.operating_system.Windows'>] but VM supports [<class 'lisa.oper
perf_epoll (lisa_0_11) ✅ PASSED 196.029

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 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread lisa/microsoft/testsuites/device_passthrough/functional_tests.py Outdated
Comment thread lisa/microsoft/testsuites/performance/networkperf_passthrough.py Outdated
@vyadavmsft
vyadavmsft force-pushed the users/vyadav/dual-nic-passthrough branch from 9ad3ee1 to 5957360 Compare July 6, 2026 19:10
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

⚠️ AI Test Selection — cancelled

53 test case(s) selected (view run)

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Count
✅ Passed 1
❌ Failed 0
⏭️ Skipped 1
Total 2
Test case details
Test Case Status Time (s) Message
perf_nested_hyperv_storage_singledisk (lisa_0_4) ⏭️ SKIPPED 0.000 check skipped: OS type mismatch: ["requires [<class 'lisa.operating_system.Windows'>] but VM supports [<class 'lisa.oper
perf_epoll (lisa_0_11) ✅ PASSED 195.208

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

⚠️ AI Test Selection — cancelled

53 test case(s) selected (view run)

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Count
✅ Passed 11
❌ Failed 1
⏭️ Skipped 3
Total 15
Test case details
Test Case Status Time (s) Message
perf_nested_hyperv_storage_singledisk (lisa_0_4) ⏭️ SKIPPED 0.000 check skipped: OS type mismatch: ["requires [<class 'lisa.operating_system.Windows'>] but VM supports [<class 'lisa.oper
perf_nested_kvm_storage_singledisk (lisa_0_2) ❌ FAILED 904.072 failed. LisaException: command '['sudo', 'sh', '-c', 'openssl passwd -6 #htOSL%7CU2pSY18']' timeout after 600 seconds.
perf_nested_hyperv_storage_multidisk (lisa_0_5) ⏭️ SKIPPED 0.000 check skipped: OS type mismatch: ["requires [<class 'lisa.operating_system.Windows'>] but VM supports [<class 'lisa.oper
perf_nested_hyperv_ntttcp_different_l1_nat (lisa_0_8) ⏭️ SKIPPED 0.000 check skipped: OS type mismatch: ["requires [<class 'lisa.operating_system.Windows'>] but VM supports [<class 'lisa.oper
perf_resource_disk_1024k (lisa_0_43) ✅ PASSED 1615.397
perf_ultra_datadisks_1024k (lisa_0_36) ✅ PASSED 1275.177
perf_storage_generic_fio_test (lisa_0_52) ✅ PASSED 3538.976
perf_resource_disk_4k (lisa_0_44) ✅ PASSED 4423.275
perf_ultra_datadisks_4k (lisa_0_35) ✅ PASSED 4379.816
perf_nvme_io_uring (lisa_0_1) ✅ PASSED 5346.926
perf_epoll (lisa_0_11) ✅ PASSED 194.933
perf_messaging (lisa_0_10) ✅ PASSED 2082.345
perf_tcp_latency_sriov (lisa_0_13) ✅ PASSED 350.964
perf_tcp_single_pps_sriov (lisa_0_15) ✅ PASSED 205.895
perf_tcp_max_pps_sriov (lisa_0_17) ✅ PASSED 143.893

@vyadavmsft
vyadavmsft requested a review from LiliDeng July 7, 2026 00:00
anirudhrb
anirudhrb previously approved these changes Jul 13, 2026
Copilot AI review requested due to automatic review settings July 13, 2026 16:32
@vyadavmsft
vyadavmsft force-pushed the users/vyadav/dual-nic-passthrough branch from 5957360 to 6e586e2 Compare July 13, 2026 16:32

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 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread lisa/microsoft/testsuites/performance/networkperf_passthrough.py Outdated
Comment thread lisa/microsoft/testsuites/performance/networkperf_passthrough.py Outdated
Copilot AI review requested due to automatic review settings July 13, 2026 21:37
@vyadavmsft
vyadavmsft force-pushed the users/vyadav/dual-nic-passthrough branch from 24f3454 to 62ae85b Compare July 13, 2026 21:37
@github-actions

Copy link
Copy Markdown

⚠️ AI Test Selection — cancelled

53 test case(s) selected (view run)

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Count
✅ Passed 3
❌ Failed 0
⏭️ Skipped 1
Total 4
Test case details
Test Case Status Time (s) Message
perf_nested_hyperv_storage_singledisk (lisa_0_4) ⏭️ SKIPPED 0.000 check skipped: OS type mismatch: ["requires [<class 'lisa.operating_system.Windows'>] but VM supports [<class 'lisa.oper
perf_epoll (lisa_0_11) ✅ PASSED 194.380
perf_messaging (lisa_0_10) ✅ PASSED 2030.686
perf_resource_disk_1024k (lisa_0_43) ✅ PASSED 1616.670

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 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread lisa/microsoft/testsuites/device_passthrough/functional_tests.py Outdated
@github-actions

Copy link
Copy Markdown

✅ AI Test Selection — PASSED

1 test case(s) selected (view run)

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Count
✅ Passed 1
❌ Failed 0
⏭️ Skipped 0
Total 1
Test case details
Test Case Status Time (s) Message
smoke_test (lisa_0_0) ✅ PASSED 39.935

Copilot AI review requested due to automatic review settings July 13, 2026 22:54
@vyadavmsft
vyadavmsft force-pushed the users/vyadav/dual-nic-passthrough branch from 62ae85b to 0bea911 Compare July 13, 2026 22:54

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 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread lisa/microsoft/testsuites/device_passthrough/functional_tests.py
@github-actions

Copy link
Copy Markdown

✅ AI Test Selection — PASSED

1 test case(s) selected (view run)

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Count
✅ Passed 0
❌ Failed 0
⏭️ Skipped 1
Total 1
Test case details
Test Case Status Time (s) Message
verify_device_passthrough_on_guest (lisa_0_0) ⏭️ SKIPPED 0.000 requires [azure] but VM supports [hyperv, openvmm, cloud-hypervisor]

Record each runbook-requested passthrough count in the Cloud Hypervisor, Hyper-V, and OpenVMM runtime device contexts.

Fail the generic guest validation if a runtime assignment contains fewer devices than requested, aggregate identical PCI IDs globally so one guest device cannot satisfy multiple assignments, and continue allowing whole-IOMMU-group over-allocation.

Report requested, assigned, and verified device totals per pool in the passed test result summary.
Copilot AI review requested due to automatic review settings July 13, 2026 23:17
@vyadavmsft
vyadavmsft force-pushed the users/vyadav/dual-nic-passthrough branch from 0bea911 to c9fd28c Compare July 13, 2026 23:17
@vyadavmsft
vyadavmsft requested a review from SRIKKANTH as a code owner July 13, 2026 23:17

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 7 out of 7 changed files in this pull request and generated 2 comments.

Comment thread lisa/sut_orchestrator/libvirt/libvirt_device_pool.py
Comment thread lisa/sut_orchestrator/hyperv/hyperv_device_pool.py
@github-actions

Copy link
Copy Markdown

✅ AI Test Selection — PASSED

1 test case(s) selected (view run)

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Count
✅ Passed 0
❌ Failed 0
⏭️ Skipped 1
Total 1
Test case details
Test Case Status Time (s) Message
verify_device_passthrough_on_guest (lisa_0_0) ⏭️ SKIPPED 0.000 requires [azure] but VM supports [hyperv, openvmm, cloud-hypervisor]

Validate every libvirt and Hyper-V passthrough request before allocating devices or enabling passthrough.

Fail with an actionable error when a runbook count is nonpositive, preventing partial allocation and deferred functional-test failures.
Copilot AI review requested due to automatic review settings July 14, 2026 03:06

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 7 out of 7 changed files in this pull request and generated no new comments.

@github-actions

Copy link
Copy Markdown

✅ AI Test Selection — PASSED

1 test case(s) selected (view run)

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Count
✅ Passed 0
❌ Failed 0
⏭️ Skipped 1
Total 1
Test case details
Test Case Status Time (s) Message
verify_device_passthrough_on_guest (lisa_0_0) ⏭️ SKIPPED 0.000 requires [azure] but VM supports [cloud-hypervisor, hyperv, openvmm]

@vyadavmsft
vyadavmsft requested a review from anirudhrb July 14, 2026 04:35
@vyadavmsft
vyadavmsft merged commit b2856c2 into main Jul 15, 2026
62 checks passed
@vyadavmsft
vyadavmsft deleted the users/vyadav/dual-nic-passthrough branch July 15, 2026 05:35
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.

4 participants