Skip to content

Add SerialConsole support for OpenVMM guests#4482

Merged
LiliDeng merged 5 commits into
mainfrom
vyadav_openvmm_serial
May 19, 2026
Merged

Add SerialConsole support for OpenVMM guests#4482
LiliDeng merged 5 commits into
mainfrom
vyadav_openvmm_serial

Conversation

@vyadavmsft
Copy link
Copy Markdown
Collaborator

@vyadavmsft vyadavmsft commented May 14, 2026

Kdump and reboot diagnostics call node.features[SerialConsole].check_panic() to inspect the guest serial log. OpenVMM guests already launch with COM1 wired to an OpenVMM-managed log path, but the OpenVMM controller only advertised StartStop, so tests that require SerialConsole failed during feature lookup with 'feature [SerialConsole] isn't supported on platform [openvmm]'.

Add an OpenVMM SerialConsole feature that reads the guest console from the parent host, because the COM1 file is host-side state rather than a file inside the guest. The implementation reads the configured file serial log by default, falls back to the launcher stderr log when the runbook uses serial.mode=stderr, and strips ANSI control sequences before the common panic scanner processes the content.

Register SerialConsole in OpenVMM supported_features and add selftests for feature registration, file-backed console collection, stderr-backed console collection, and ANSI cleanup.

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

2026-05-11 18:56:39.624[140297817466688][INFO] lisa.RootRunner ________________________________________
2026-05-11 18:56:39.624[140297817466688][INFO] lisa.RootRunner OpenVmmPlatformSuite.verify_openvmm_guest_boot: PASSED
2026-05-11 18:56:39.624[140297817466688][INFO] lisa.RootRunner OpenVmmPlatformSuite.verify_openvmm_restart_via_platform: PASSED
2026-05-11 18:56:39.625[140297817466688][INFO] lisa.RootRunner CPU.verify_cpu_count: PASSED
2026-05-11 18:56:39.625[140297817466688][INFO] lisa.RootRunner KdumpCrash.verify_kdumpcrash_on_random_cpu: PASSED

Kdump and reboot diagnostics call node.features[SerialConsole].check_panic() to inspect the guest serial log. OpenVMM guests already launch with COM1 wired to an OpenVMM-managed log path, but the OpenVMM controller only advertised StartStop, so tests that require SerialConsole failed during feature lookup with 'feature [SerialConsole] isn't supported on platform [openvmm]'.

Add an OpenVMM SerialConsole feature that reads the guest console from the parent host, because the COM1 file is host-side state rather than a file inside the guest. The implementation reads the configured file serial log by default, falls back to the launcher stderr log when the runbook uses serial.mode=stderr, and strips ANSI control sequences before the common panic scanner processes the content.

Register SerialConsole in OpenVMM supported_features and add selftests for feature registration, file-backed console collection, stderr-backed console collection, and ANSI cleanup.
Copilot AI review requested due to automatic review settings May 14, 2026 13:43
@github-actions
Copy link
Copy Markdown

ghost commented May 14, 2026

✅ AI Test Selection — PASSED

4 test case(s) selected (view run)

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

Count
✅ Passed 2
❌ Failed 0
⏭️ Skipped 2
Total 4
Test case details
Test Case Status Time (s) Message
verify_openvmm_restart_via_platform (lisa_0_2) ⏭️ SKIPPED 5.365 before_case skipped: This suite only applies to OpenVMM guest nodes. Actual node type: RemoteNode.
verify_openvmm_stop_start_in_platform (lisa_0_3) ⏭️ SKIPPED 5.960 before_case skipped: This suite only applies to OpenVMM guest nodes. Actual node type: RemoteNode.
verify_reboot_in_platform (lisa_0_0) ✅ PASSED 48.128
verify_stop_start_in_platform (lisa_0_1) ✅ PASSED 86.590

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

This PR adds OpenVMM support for the common SerialConsole feature so diagnostics like panic checks can read guest serial logs from the OpenVMM host.

Changes:

  • Adds an OpenVMM SerialConsole implementation that reads file-backed or stderr-backed host logs.
  • Registers SerialConsole in OpenVMM supported features.
  • Adds selftests for feature registration and console log collection paths.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
lisa/sut_orchestrator/openvmm/serial_console.py Implements host-side serial console log retrieval for OpenVMM guests.
lisa/sut_orchestrator/openvmm/node.py Registers OpenVMM SerialConsole support.
selftests/test_openvmm_node.py Adds selftests for OpenVMM serial console behavior.

Comment thread lisa/sut_orchestrator/openvmm/serial_console.py
@vyadavmsft
Copy link
Copy Markdown
Collaborator Author

@copilot apply changes based on the comments in this thread

and fix check errors

Copilot AI and others added 2 commits May 14, 2026 14:58
Copilot AI review requested due to automatic review settings May 14, 2026 15:00
@vyadavmsft vyadavmsft review requested due to automatic review settings May 14, 2026 15:00
Agent-Logs-Url: https://github.com/microsoft/lisa/sessions/85cafcf1-fe1e-45e8-935e-acc2aeb32458

Co-authored-by: vyadavmsft <1424753+vyadavmsft@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 14, 2026 15:01
@vyadavmsft vyadavmsft review requested due to automatic review settings May 14, 2026 15:01
Copy link
Copy Markdown
Contributor

Copilot AI commented May 14, 2026

@copilot apply changes based on the comments in this thread

and fix check errors

Implemented the requested updates from the review thread and fixed the failing checks in commit 3b6b26f.

  • OpenVMM SerialConsole now reads host-side console logs with sudo (handles TAP/root-owned log files).
  • Updated related selftests for sudo-based log reads.
  • Fixed branch check failures by restoring ensure_minimum_raw_disk_size and aligning SSH forwarding assertions with current command behavior.
  • Verified with python -m unittest discover (222 tests, passing).

@github-actions
Copy link
Copy Markdown

ghost commented May 14, 2026

✅ AI Test Selection — PASSED

3 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 2
Total 3
Test case details
Test Case Status Time (s) Message
verify_openvmm_stop_start_in_platform (lisa_0_2) ⏭️ SKIPPED 5.490 before_case skipped: This suite only applies to OpenVMM guest nodes. Actual node type: RemoteNode.
verify_openvmm_restart_via_platform (lisa_0_1) ⏭️ SKIPPED 5.845 before_case skipped: This suite only applies to OpenVMM guest nodes. Actual node type: RemoteNode.
verify_stop_start_in_platform (lisa_0_0) ✅ PASSED 83.854

@LiliDeng
Copy link
Copy Markdown
Collaborator

@anirudhrb @pupacha please review, @vyadavmsft please paste results in description, thanks!

@vyadavmsft
Copy link
Copy Markdown
Collaborator Author

@copilot fix check error .

Agent-Logs-Url: https://github.com/microsoft/lisa/sessions/09297a6a-8cf9-436c-9607-328c73e860e3

Co-authored-by: vyadavmsft <1424753+vyadavmsft@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 15, 2026 03:39
@vyadavmsft vyadavmsft review requested due to automatic review settings May 15, 2026 03:39
Copy link
Copy Markdown
Contributor

Copilot AI commented May 15, 2026

@copilot fix check error .

Fixed the check error in commit f65866e. Root cause was flake8-black (BLK100) on lisa/sut_orchestrator/openvmm/node.py; I applied black-compliant formatting only and revalidated with targeted tests plus final validation.

@github-actions
Copy link
Copy Markdown

ghost commented May 15, 2026

✅ AI Test Selection — PASSED

4 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
verify_openvmm_stop_start_in_platform (lisa_0_3) ⏭️ SKIPPED 5.489 before_case skipped: This suite only applies to OpenVMM guest nodes. Actual node type: RemoteNode.
verify_stop_start_in_platform (lisa_0_0) ✅ PASSED 103.662
verify_vm_resize_decrease (lisa_0_2) ✅ PASSED 301.930
verify_vm_resize_increase (lisa_0_1) ✅ PASSED 309.489

@LiliDeng LiliDeng merged commit b9ef16c into main May 19, 2026
61 checks passed
@LiliDeng LiliDeng deleted the vyadav_openvmm_serial branch May 19, 2026 01:56
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