-
Notifications
You must be signed in to change notification settings - Fork 162
petri: Add the ability to collect crash dumps from guests #2394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This PR modifies files containing For more on why we check whole files, instead of just diffs, check out the Rustonomicon |
There was a problem hiding this comment.
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 adds support for collecting crash dumps from guest VMs in the petri testing framework. It creates a dedicated crash dump disk for Windows and Linux guests, configures the guests to use it for kernel dumps, and extracts the dump files as test artifacts after each test.
Key changes:
- Creates a 4 GiB dynamic VHDX for Hyper-V guests to store crash dumps
- Configures Windows via IMC to write kernel memory dumps to the crash disk
- Configures Linux via cloud-init to mount the crash dump disk
- Adds post-test hooks to extract crash dump files from the disk as test artifacts
Reviewed Changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| vmm_tests/vmm_tests/tests/tests/multiarch.rs | Adds kernel crash test that writes a test file and triggers a kernel crash |
| petri/src/vm/openvmm/mod.rs | Adds stub implementation of create_guest_dump_disk for OpenVMM (returns None) |
| petri/src/vm/openvmm/construct.rs | Attaches crash dump disk as read-only SCSI device to OpenVMM VMs |
| petri/src/vm/mod.rs | Core logic for creating crash disk and post-test extraction hook |
| petri/src/vm/hyperv/mod.rs | Creates and formats dynamic VHDX for crash dumps on Hyper-V |
| petri/src/test.rs | Removes Send requirement from PetriPostTestHook |
| petri/src/disk_image.rs | Makes FAT32 disk building utilities public for reuse |
| petri/make_imc_hive/src/windows/offreg.rs | Adds set_expand_sz method for registry editing |
| petri/make_imc_hive/src/windows/mod.rs | Configures Windows kernel crash dump settings via IMC |
| petri/guest-bootstrap/user-data | Adds cloud-init commands to mount crash dump disk on Linux |
| petri/guest-bootstrap/imc.hiv | Binary registry hive file update |
| petri/Cargo.toml | Adds disk_backend dependency |
| Cargo.lock | Updates dependency lock file |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
This is now reviewable. Assuming this latest run works I'll delete the test and then merge. There's no good way to have a fully automated test for this unfortunately, since the dump collection infra has to live outside the actual test in order to catch test failures. |
|
Filed #2403 to track remaining pieces |
This comment was marked as outdated.
This comment was marked as outdated.
cbb0dce to
c5af1a5
Compare
|
Ok, with the last hyper-v annoyance worked around this is now ready to go. |
|
Now we wait... |
In #2394 I added this new action to our log upload script, as if there are many crash dumps present during a test run the uploader can run out of disk space. However since this script only runs out of main I couldn't test the changes. Turns out the cleaner removes azure cli, which we kinda need. Fix that.
Create a dynamic VHDX when using Hyper-V, configure Windows (IMC/prep steps) and Linux (cloud-init) to mount it, configure Windows to put kernel dumps on it, and add a post test hook to artifact all files that end up on it. Wiring up Linux crashes, Windows user mode crashes, and the OpenVMM backend are left as future work.