Skip to content

petri: physical nvme test plumbing#3504

Open
babayet2 wants to merge 6 commits into
microsoft:mainfrom
babayet2:physical_nvme
Open

petri: physical nvme test plumbing#3504
babayet2 wants to merge 6 commits into
microsoft:mainfrom
babayet2:physical_nvme

Conversation

@babayet2
Copy link
Copy Markdown
Collaborator

Adds petri plumbing to support closed source testing of physical nvme devices

@babayet2 babayet2 requested review from Copilot and tjones60 May 18, 2026 05:09
@babayet2 babayet2 requested a review from a team as a code owner May 18, 2026 05:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Petri plumbing for Hyper-V-backed closed-source testing with physical NVMe devices.

Changes:

  • Adds PhysicalNvmeDevice configuration and builder support in Petri.
  • Threads physical NVMe devices through Hyper-V VM creation PowerShell plumbing.
  • Refactors shared Hyper-V CIM helpers into a separate PowerShell module.

Reviewed changes

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

Show a summary per file
File Description
vmm_tests/vmm_tests/tests/tests/x86_64/storage.rs Formatting-only blank line change.
petri/src/vm/openvmm/construct.rs Rejects physical NVMe devices for the OpenVMM backend.
petri/src/vm/mod.rs Adds physical NVMe device config and builder API.
petri/src/vm/hyperv/Utilities.psm1 Adds shared CIM/VMMS PowerShell helpers split out from hyperv.psm1.
petri/src/vm/hyperv/powershell.rs Serializes physical NVMe settings and adds a request helper.
petri/src/vm/hyperv/mod.rs Formatting-only whitespace change.
petri/src/vm/hyperv/hyperv.psm1 Imports utility helpers and invokes physical NVMe assignment during VM creation.

Comment thread petri/src/vm/hyperv/hyperv.psm1 Outdated
Comment thread petri/src/vm/hyperv/hyperv.psm1 Outdated
Comment on lines +392 to +399
# Assign physical NVMe devices via PhysicalNvme module
if ($PhysicalNvmeControllers) {
Import-Module PhysicalNvme
foreach ($entry in $PhysicalNvmeControllers.GetEnumerator()) {
$vsid = $entry.Name
$targetVtl = $entry.Value["Vtl"]
$nsid = $entry.Value["Nsid"]
Add-PhysicalNvmeDeviceToVm -VmName $VMName -Vsid $vsid -Nsid $nsid -TargetVtl $targetVtl | Out-Null
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.

We could probably address this with some sort of try catch, but that can be best addressed in a separate PR.

@github-actions
Copy link
Copy Markdown

@chris-oo
Copy link
Copy Markdown
Member

Is this just the first set of changes to add some plumbing, to be used later?

@babayet2
Copy link
Copy Markdown
Collaborator Author

Is this just the first set of changes to add some plumbing, to be used later?

@chris-oo yep yep. the usage of this plumbing will be out-of-repo, there will not be follow-on changes in openvmm

@github-actions
Copy link
Copy Markdown

Comment thread petri/src/vm/hyperv/hyperv.psm1 Outdated
Comment thread petri/src/vm/hyperv/hyperv.psm1 Outdated
Comment thread petri/src/vm/hyperv/hyperv.psm1 Outdated
Comment thread petri/src/vm/hyperv/powershell.rs Outdated
Comment thread petri/src/vm/mod.rs
Copilot AI review requested due to automatic review settings May 21, 2026 07:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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

Comment thread petri/src/vm/hyperv/mod.rs Outdated
Comment thread petri/src/vm/hyperv/hyperv.psm1 Outdated
@github-actions
Copy link
Copy Markdown

Copilot AI review requested due to automatic review settings May 22, 2026 01:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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

Comment on lines +839 to +840
let nsid: u32 =
serde_json::from_str(&output).context("failed to parse PhysicalNvme discovery output")?;

if ($shouldProcess) {
$caption = if ($job.Caption) { $job.Caption } else { "Job in progress (no caption available)" }
$jobStatus = if ($job.JobStatus) { $job.JobState } else { "No job status available" }
@github-actions
Copy link
Copy Markdown

@babayet2 babayet2 enabled auto-merge (squash) May 22, 2026 17:23
@babayet2 babayet2 requested a review from tjones60 May 22, 2026 19:14
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