Skip to content

Storage passthrough: add safe NVMe FIO tests - #4686

Open
Ajay R (AjayMsft9) wants to merge 7 commits into
microsoft:mainfrom
AjayMsft9:v-aratakonda/nvme-passthrough-fio
Open

Storage passthrough: add safe NVMe FIO tests#4686
Ajay R (AjayMsft9) wants to merge 7 commits into
microsoft:mainfrom
AjayMsft9:v-aratakonda/nvme-passthrough-fio

Conversation

@AjayMsft9

@AjayMsft9 Ajay R (AjayMsft9) commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Description

Summary

This change adds three focused tests for NVMe disk passthrough on Cloud Hypervisor:

  1. verify_storage_passthrough_nvme_visible
  2. perf_storage_passthrough_fio_randread
  3. perf_storage_passthrough_fio_randwrite

The tests ensure that FIO runs only on the NVMe disk assigned to the guest and never on the boot disk or another unrelated disk.

What the tests do

Verify NVMe visibility

verify_storage_passthrough_nvme_visible

  • Gets the assigned NVMe PCI device from the host.
  • Finds the matching PCI device inside the guest.
  • Maps it to the exact NVMe namespace visible in the guest.
  • Stops safely if the device cannot be identified uniquely.
  • Uses PCI vendor and device IDs as a unique fallback when the guest PCI address is missing from the domain XML.
  • Supports standard and controller-specific Linux NVMe namespace names.

Random-read FIO

perf_storage_passthrough_fio_randread

  • Confirms the exact passed-through NVMe namespace.
  • Verifies that the target is not the boot disk, mounted, or already in use.
  • Runs a bounded random-read FIO workload.
  • Publishes IOPS and latency results.

Random-write FIO

perf_storage_passthrough_fio_randwrite

  • Repeats the device identity and safety checks.
  • Runs a bounded random-write FIO workload.
  • Publishes IOPS and latency results.
  • Removes test-created files and mounts after the test.

Default FIO settings

  • I/O engine: libaio
  • Block size: 4 KB
  • Test data size: 512 MB
  • Runtime: 60 seconds
  • Queue depths: 1, 2, and 4

Safety checks

The tests do not select the first /dev/nvme* disk.

Before running FIO, they:

  • Match the assigned host PCI device to the exact guest NVMe controller and namespace.
  • Require exactly one assigned host device, one guest controller, and one guest namespace.
  • Use a unique PCI vendor and device ID match when the guest PCI address is unavailable.
  • Resolve standard and controller-specific NVMe namespace names, including Linux NVMe multipath naming.
  • Reject the root or boot disk.
  • Reject mounted disks.
  • Reject swap, RAID, LVM, device-mapper, multipath, held, and other in-use disks.
  • Stop safely when the device mapping is missing or ambiguous.
  • Format and mount only the positively identified passthrough namespace after all safety checks pass.
  • Clean up FIO processes, test files, mounts, and temporary directories.

Other changes

The shared FIO helper now accepts an optional list of workload modes. Existing callers continue to run the same modes as before when no mode list is provided.

Validation

  • 19 focused storage passthrough self-tests passed.
  • 303 Python 3.9 self-tests passed.
  • All 27 PR checks passed.
  • Black, Flake8, Pylint, Mypy, Python compilation, and git diff --check passed.
  • End-to-end validation completed on both Core Scheduler and Root Scheduler BareMetal environments.
  • All three NVMe passthrough tests passed in both environments.
  • Guest device mapping, bounded FIO, result publishing, cleanup, and host NVMe re-detection completed successfully.

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
  • Tests executed and results posted below

Test Validation

Key Test Cases:
verify_storage_passthrough_nvme_visible|perf_storage_passthrough_fio_randread|perf_storage_passthrough_fio_randwrite

Impacted LISA Features:
Nvme

Tested Azure Marketplace Images:

  • N/A - validated on BareMetal Cloud Hypervisor environments using an Ubuntu 22.04 guest image.

Test Results

Image VM Size Result
Ubuntu 22.04, Core Scheduler BareMetal guest N/A PASSED (3/3)
Ubuntu 22.04, Root Scheduler BareMetal guest N/A PASSED (3/3)

Copilot AI lite review requested due to automatic review settings August 20, 2026 10:51

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.

Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.

@AjayMsft9 Ajay R (AjayMsft9) changed the title [AI Generated] storage passthrough: add safe NVMe FIO tests Storage passthrough: add safe NVMe FIO tests Aug 20, 2026
Copilot AI review requested due to automatic review settings August 20, 2026 11:53

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.

Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.

Copilot AI review requested due to automatic review settings August 20, 2026 13:03

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.

Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.

Copilot AI review requested due to automatic review settings August 25, 2026 13: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.

Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.

Copilot AI review requested due to automatic review settings August 31, 2026 10:49

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.

Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.

Copilot AI review requested due to automatic review settings August 31, 2026 11:15

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.

Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.

Copilot AI review requested due to automatic review settings August 31, 2026 14:40

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.

Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.

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.

Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.

@AjayMsft9

Copy link
Copy Markdown
Contributor Author

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