Skip to content

Harden OpenVMM Azure guest orchestration#4420

Open
vyadavmsft wants to merge 5 commits intomainfrom
vyadav_openvmm_test
Open

Harden OpenVMM Azure guest orchestration#4420
vyadavmsft wants to merge 5 commits intomainfrom
vyadav_openvmm_test

Conversation

@vyadavmsft
Copy link
Copy Markdown
Collaborator

@vyadavmsft vyadavmsft commented Apr 16, 2026

Description

  • add cloud-init-based provisioning for OpenVMM guests
  • make detached OpenVMM launches more robust and avoid requiring pycdlib at module import time
  • add TAP networking support, guest address resolution, and host-side SSH forwarding
  • improve OpenVMM failure diagnostics for process, network, dnsmasq, and log collection paths
  • harden host working directory and artifact path handling for guest assets
  • add Azure smoke runbook coverage for OpenVMM guest boot, restart, and stop/start scenarios
  • update runner and Azure guest plumbing needed to deploy and initialize OpenVMM guests cleanly
  • extend selftest coverage for launch cwd handling, stop timeout behavior, artifact staging, and schema validation

For Lisa-runner:
schedule guest initialization after host deploy
initialize guest nodes after host connect
allow guest runs to match Deployed against outer Connected
avoid eager delete before retry in guest flow

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-04-15 23:32:50.931[140036611700544][INFO] lisa.RootRunner ________________________________________
2026-04-15 23:32:50.932[140036611700544][INFO] lisa.RootRunner OpenVmmPlatform.verify_openvmm_guest_boot: PASSED
2026-04-15 23:32:50.932[140036611700544][INFO] lisa.RootRunner OpenVmmPlatform.verify_openvmm_restart_via_platform: PASSED

Image VM Size Result
PASSED

Copilot AI review requested due to automatic review settings April 16, 2026 19:29
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 hardens the OpenVMM guest orchestrator flow when used as an Azure “guest-enabled” environment, adding cloud-init provisioning support, TAP networking/SSH forwarding, richer diagnostics, and smoke coverage to validate guest lifecycle operations.

Changes:

  • Add cloud-init ISO generation and provisioning plumbing for OpenVMM guests, with improved failure-context capture.
  • Add TAP networking support (dnsmasq DHCP, guest address resolution, host-side SSH port forwarding) and teardown/cleanup paths.
  • Update runner/Azure plumbing to better handle guest-enabled environments, plus OpenVMM smoke suite + Azure runbook, and extend selftests.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
selftests/test_openvmm_node.py Updates selftests for stop-timeout behavior and logging expectations.
lisa/tools/openvmm.py Improves detached launch robustness (TTY wrapper) and PID failure diagnostics.
lisa/sut_orchestrator/openvmm/schema.py Extends OpenVMM guest/network schema for cloud-init + TAP/forwarding settings.
lisa/sut_orchestrator/openvmm/node.py Implements TAP networking, cloud-init ISO creation, forwarding, diagnostics, artifact cleanup.
lisa/sut_orchestrator/azure/platform_.py Avoids feature access for guest nodes unless the feature is supported.
lisa/runners/lisa_runner.py Adds guest-environment initialization and environment-status matching for guest-enabled runs.
lisa/node.py Ensures host nodes clean up/close guest nodes; relaxes connection test when shell is missing.
lisa/microsoft/testsuites/openvmm/openvmm.py Adds OpenVMM Azure smoke coverage for boot/restart/stop-start scenarios.
lisa/microsoft/runbook/openvmm/openvmm-azure-smoke.yml New Azure smoke runbook for OpenVMM guest validation with TAP+forwarding.

Comment thread lisa/sut_orchestrator/openvmm/node.py
Comment thread lisa/sut_orchestrator/openvmm/node.py Outdated
Comment thread lisa/sut_orchestrator/openvmm/node.py Outdated
Comment thread lisa/sut_orchestrator/openvmm/node.py Outdated
Comment thread lisa/sut_orchestrator/openvmm/node.py Outdated
Comment thread lisa/tools/openvmm.py
Comment thread lisa/node.py
Comment thread lisa/microsoft/testsuites/openvmm/openvmm.py Outdated
@github-actions
Copy link
Copy Markdown

✅ AI Test Selection — PASSED

5 test case(s) selected (view run)

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

Count
✅ Passed 5
❌ Failed 0
⏭️ Skipped 0
Total 5
Test case details
Test Case Status Time (s) Message
verify_serial_console (lisa_0_0) ✅ PASSED 39.223
verify_stop_start_in_platform (lisa_0_2) ✅ PASSED 109.779
verify_reboot_in_platform (lisa_0_1) ✅ PASSED 45.190
verify_openvmm_restart_via_platform (lisa_0_3) ✅ PASSED 48.123
verify_openvmm_stop_start_in_platform (lisa_0_4) ✅ PASSED 79.704

@vyadavmsft vyadavmsft force-pushed the vyadav_openvmm_test branch from 6dc110d to 08cd8b1 Compare April 16, 2026 19:56
@github-actions
Copy link
Copy Markdown

✅ AI Test Selection — PASSED

5 test case(s) selected (view run)

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

Count
✅ Passed 5
❌ Failed 0
⏭️ Skipped 0
Total 5
Test case details
Test Case Status Time (s) Message
verify_reboot_in_platform (lisa_0_1) ✅ PASSED 43.708
verify_stop_start_in_platform (lisa_0_2) ✅ PASSED 78.755
verify_openvmm_restart_via_platform (lisa_0_3) ✅ PASSED 47.626
verify_openvmm_stop_start_in_platform (lisa_0_4) ✅ PASSED 321.686
verify_serial_console (lisa_0_0) ✅ PASSED 49.183

Copilot AI review requested due to automatic review settings April 16, 2026 20:18
@vyadavmsft vyadavmsft force-pushed the vyadav_openvmm_test branch from 08cd8b1 to 9d5c64b Compare April 16, 2026 20:18
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 9 out of 9 changed files in this pull request and generated 3 comments.

Comment thread lisa/tools/openvmm.py Outdated
Comment thread lisa/sut_orchestrator/openvmm/node.py Outdated
Comment thread lisa/sut_orchestrator/openvmm/node.py
@github-actions
Copy link
Copy Markdown

✅ AI Test Selection — PASSED

5 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 2
Total 5
Test case details
Test Case Status Time (s) Message
verify_openvmm_restart_via_platform (lisa_0_3) ⏭️ SKIPPED 5.163 before_case skipped: This suite only applies to OpenVMM guest nodes. Actual node type: RemoteNode.
verify_openvmm_stop_start_in_platform (lisa_0_4) ⏭️ SKIPPED 5.220 before_case skipped: This suite only applies to OpenVMM guest nodes. Actual node type: RemoteNode.
verify_stop_start_in_platform (lisa_0_2) ✅ PASSED 94.921
verify_reboot_in_platform (lisa_0_1) ✅ PASSED 197.354
verify_serial_console (lisa_0_0) ✅ PASSED 42.420

Copilot AI review requested due to automatic review settings April 16, 2026 20:41
@github-actions
Copy link
Copy Markdown

✅ AI Test Selection — PASSED

5 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 2
Total 5
Test case details
Test Case Status Time (s) Message
verify_openvmm_stop_start_in_platform (lisa_0_4) ⏭️ SKIPPED 3.951 before_case skipped: This suite only applies to OpenVMM guest nodes. Actual node type: RemoteNode.
verify_openvmm_restart_via_platform (lisa_0_3) ⏭️ SKIPPED 4.602 before_case skipped: This suite only applies to OpenVMM guest nodes. Actual node type: RemoteNode.
verify_reboot_in_platform (lisa_0_1) ✅ PASSED 45.059
verify_stop_start_in_platform (lisa_0_2) ✅ PASSED 81.295
verify_serial_console (lisa_0_0) ✅ PASSED 39.162

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

Comment thread lisa/node.py Outdated
Comment thread lisa/node.py
Comment thread lisa/sut_orchestrator/openvmm/node.py
Comment thread lisa/sut_orchestrator/openvmm/node.py Outdated
Comment thread lisa/sut_orchestrator/openvmm/node.py Outdated
Comment thread lisa/sut_orchestrator/openvmm/node.py Outdated
Comment thread lisa/sut_orchestrator/openvmm/node.py Outdated
@vyadavmsft vyadavmsft force-pushed the vyadav_openvmm_test branch 2 times, most recently from 6f94f54 to c2a279c Compare April 16, 2026 21:00
@github-actions
Copy link
Copy Markdown

⏭️ AI Test Selection — SKIPPED

5 test case(s) selected (view run)

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

Selected test cases
verify_openvmm_restart_via_platform
verify_openvmm_stop_start_in_platform
verify_serial_console
verify_reboot_in_platform
verify_stop_start_in_platform

@github-actions
Copy link
Copy Markdown

✅ AI Test Selection — PASSED

5 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 2
Total 5
Test case details
Test Case Status Time (s) Message
verify_openvmm_stop_start_in_platform (lisa_0_4) ⏭️ SKIPPED 3.685 before_case skipped: This suite only applies to OpenVMM guest nodes. Actual node type: RemoteNode.
verify_openvmm_restart_via_platform (lisa_0_3) ⏭️ SKIPPED 5.537 before_case skipped: This suite only applies to OpenVMM guest nodes. Actual node type: RemoteNode.
verify_serial_console (lisa_0_0) ✅ PASSED 49.632
verify_reboot_in_platform (lisa_0_1) ✅ PASSED 46.117
verify_stop_start_in_platform (lisa_0_2) ✅ PASSED 79.773

Copilot AI review requested due to automatic review settings April 16, 2026 21:42
@vyadavmsft vyadavmsft force-pushed the vyadav_openvmm_test branch from c2a279c to 1f2096c Compare April 16, 2026 21:42
@github-actions
Copy link
Copy Markdown

✅ AI Test Selection — PASSED

5 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 2
Total 5
Test case details
Test Case Status Time (s) Message
verify_reboot_in_platform (lisa_0_1) ✅ PASSED 46.732
verify_stop_start_in_platform (lisa_0_2) ✅ PASSED 86.359
verify_openvmm_stop_start_in_platform (lisa_0_4) ⏭️ SKIPPED 5.302 before_case skipped: This suite only applies to OpenVMM guest nodes. Actual node type: RemoteNode.
verify_openvmm_restart_via_platform (lisa_0_3) ⏭️ SKIPPED 5.109 before_case skipped: This suite only applies to OpenVMM guest nodes. Actual node type: RemoteNode.
verify_serial_console (lisa_0_0) ✅ PASSED 44.375

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

Comment thread lisa/sut_orchestrator/openvmm/node.py Outdated
Comment thread lisa/sut_orchestrator/openvmm/node.py
Comment thread lisa/sut_orchestrator/openvmm/context.py
Comment thread lisa/tools/dnsmasq.py Outdated
Comment thread lisa/sut_orchestrator/openvmm/node.py Outdated
@LiliDeng LiliDeng requested a review from anirudhrb April 17, 2026 05:03
@LiliDeng LiliDeng requested a review from pupacha April 17, 2026 05:03
@vyadavmsft vyadavmsft force-pushed the vyadav_openvmm_test branch from 1f2096c to 12687a4 Compare April 17, 2026 22:42
@github-actions
Copy link
Copy Markdown

✅ 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 6.086 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.309 before_case skipped: This suite only applies to OpenVMM guest nodes. Actual node type: RemoteNode.
verify_serial_console (lisa_0_0) ✅ PASSED 42.755

Copy link
Copy Markdown
Collaborator

@anirudhrb anirudhrb left a comment

Choose a reason for hiding this comment

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

I haven't been able to go through the whole code yet. Here are some comments from the first pass. I'll do another pass tomorrow.

Comment thread lisa/microsoft/testsuites/openvmm/openvmm.py Outdated
class OpenVmmPlatform(TestSuite):
def before_case(self, log: Logger, **kwargs: Any) -> None:
node = kwargs["node"]
if not isinstance(node, OpenVmmGuestNode):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I believe the right way to ensure this is to add supported_platform_type in the TestSuiteMetadata. That will make sure these tests will only run on openvmm platform.

Copy link
Copy Markdown
Collaborator Author

@vyadavmsft vyadavmsft Apr 20, 2026

Choose a reason for hiding this comment

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

I don’t think supported_platform_type is the right check here, because it filters the LISA platform/orchestrator rather than the guest node type. These cases run on Azure-backed host environments but target OpenVmmGuestNode guests, so supported_platform_type=[OPENVMM] ended up skipping them.

The before_case() node-type check is the right gate for this suite. i did try but it doesnt work and test get skipped.

Copy link
Copy Markdown
Collaborator

@anirudhrb anirudhrb Apr 21, 2026

Choose a reason for hiding this comment

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

But how do OpenVmmGuestNodes get created? Isn't openvmm platform the only way to create them? So, if we filter via LISA platform openvmm it should be guaranteed that the nodes created are OpenVmmGuestNode right?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It is a guest node type loaded from platform.guests, and guest nodes are initialized by the generic platform layer when guest_enabled: true

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ahh I got it now. We're not using the OpenVMM platform directly. Instead, we're using Azure platform and defining this guests property. I was confused as to what was going on because I didn't know that this guests property existed.

Comment thread lisa/microsoft/testsuites/openvmm/openvmm.py Outdated
Comment thread lisa/microsoft/testsuites/openvmm/openvmm.py Outdated
Comment thread lisa/sut_orchestrator/openvmm/node.py Outdated
Comment thread lisa/sut_orchestrator/openvmm/node.py Outdated
Comment thread lisa/sut_orchestrator/openvmm/node.py Outdated
Comment thread lisa/sut_orchestrator/openvmm/node.py Outdated
Comment thread lisa/sut_orchestrator/openvmm/node.py Outdated
Comment thread lisa/sut_orchestrator/openvmm/node.py Outdated
Copilot AI review requested due to automatic review settings April 20, 2026 21:03
@vyadavmsft vyadavmsft force-pushed the vyadav_openvmm_test branch from 12687a4 to 4ad8f7c Compare April 20, 2026 21:03
@github-actions
Copy link
Copy Markdown

✅ 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_restart_via_platform (lisa_0_1) ⏭️ SKIPPED 0.000 capability cannot support some of requirements, requirement: 'allowed:True,items:[azure]'capability: 'allowed:True,items
verify_openvmm_stop_start_in_platform (lisa_0_2) ⏭️ SKIPPED 0.000 capability cannot support some of requirements, requirement: 'allowed:True,items:[azure]'capability: 'allowed:True,items
verify_serial_console (lisa_0_0) ✅ PASSED 46.129

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

Comment thread lisa/sut_orchestrator/openvmm/node.py Outdated
Comment on lines +191 to +195
user: dict[str, Any] = {
"name": runbook.username,
"shell": "/bin/bash",
"sudo": ["ALL=(ALL) NOPASSWD:ALL"],
"groups": ["sudo"],
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

This module uses PEP 585 built-in generics in annotations (e.g. dict[str, Any] here, plus list[str]/tuple[str, str] later). The repo targets Python 3.8 (pyproject.toml), so these annotations will raise at import time unless from __future__ import annotations is enabled. Please add the future import at the top of this module or switch these annotations back to Dict/List/Tuple from typing to keep Python 3.8 compatibility.

Copilot uses AI. Check for mistakes.
@vyadavmsft vyadavmsft force-pushed the vyadav_openvmm_test branch from 4ad8f7c to fd3f118 Compare April 20, 2026 21:16
@github-actions
Copy link
Copy Markdown

✅ 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_restart_via_platform (lisa_0_1) ⏭️ SKIPPED 0.000 capability cannot support some of requirements, requirement: 'allowed:True,items:[azure]'capability: 'allowed:True,items
verify_openvmm_stop_start_in_platform (lisa_0_2) ⏭️ SKIPPED 0.000 capability cannot support some of requirements, requirement: 'allowed:True,items:[azure]'capability: 'allowed:True,items
verify_serial_console (lisa_0_0) ✅ PASSED 47.183

Copilot AI review requested due to automatic review settings April 21, 2026 00:32
@vyadavmsft vyadavmsft force-pushed the vyadav_openvmm_test branch from fd3f118 to 51d33c6 Compare April 21, 2026 00:32
@github-actions
Copy link
Copy Markdown

✅ 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_restart_via_platform (lisa_0_1) ⏭️ SKIPPED 5.013 before_case skipped: This suite only applies to OpenVMM guest nodes. Actual node type: RemoteNode.
verify_openvmm_stop_start_in_platform (lisa_0_2) ⏭️ SKIPPED 5.447 before_case skipped: This suite only applies to OpenVMM guest nodes. Actual node type: RemoteNode.
verify_serial_console (lisa_0_0) ✅ PASSED 71.185

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

Comment thread lisa/tools/openvmm.py
Comment on lines +190 to +196
"attempt=0; "
"while [ $attempt -lt 100 ]; do "
f"if [ -s {pid_path} ]; then cat {pid_path}; exit 0; fi; "
"if ! kill -0 $wrapper_pid >/dev/null 2>&1; then break; fi; "
"attempt=$((attempt + 1)); "
"sleep 0.1; "
"done; "
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

The retry loop uses magic numbers (100 attempts and sleep 0.1), which effectively encode a ~10s wait. Please replace them with named constants (or derive from a single timeout) and add a short inline note explaining the chosen duration so future changes don’t accidentally make launches slower/flakier.

Copilot uses AI. Check for mistakes.
Comment on lines +190 to +203
user: dict[str, Any] = {
"name": runbook.username,
"shell": "/bin/bash",
"sudo": ["ALL=(ALL) NOPASSWD:ALL"],
"groups": ["sudo"],
}
if runbook.private_key_file:
user["ssh_authorized_keys"] = [
get_public_key_data(runbook.private_key_file)
]

user_data: dict[str, Any] = {
"users": ["default", user],
}
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

This file uses PEP 585 built-in generics (e.g., dict[str, Any]) which are not supported at runtime on Python 3.8 unless from __future__ import annotations is enabled (repo targets py38). Please either add the future import at the top of the module or replace these annotations with typing.Dict[...]/typing.List[...] etc. to keep py38 compatibility.

Copilot uses AI. Check for mistakes.
Comment on lines +248 to +249
def _create_iso(self, file_path: str, files: List[tuple[str, str]]) -> None:
import pycdlib
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

List[tuple[str, str]] uses PEP 585 tuple[...], which is not valid on Python 3.8 at runtime without from __future__ import annotations. Use typing.Tuple[str, str] (and/or the future import) to keep the orchestrator compatible with the repo's py38 target.

Copilot uses AI. Check for mistakes.
tmp_dir.cleanup()

def _create_iso(self, file_path: str, files: List[tuple[str, str]]) -> None:
import pycdlib
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

Importing pycdlib here will raise a raw ImportError/ModuleNotFoundError if the optional dependency isn't installed, which is hard to diagnose for users enabling cloud_init. Consider catching ImportError and raising a LisaException with clear guidance (e.g., install the appropriate extra / package) so failures are actionable.

Suggested change
import pycdlib
try:
import pycdlib
except ImportError as identifier:
raise LisaException(
"Failed to create the OpenVMM cloud-init ISO because the optional "
"'pycdlib' package is not installed. Install 'pycdlib' in the LISA "
"controller environment, then retry the run with cloud_init enabled."
) from identifier

Copilot uses AI. Check for mistakes.
Comment thread lisa/sut_orchestrator/openvmm/node.py
Comment thread lisa/sut_orchestrator/openvmm/node.py
Comment thread lisa/runners/lisa_runner.py
Comment thread lisa/sut_orchestrator/openvmm/schema.py Outdated
Comment thread lisa/sut_orchestrator/openvmm/schema.py
@vyadavmsft vyadavmsft force-pushed the vyadav_openvmm_test branch from 51d33c6 to 362a68d Compare April 22, 2026 01:15
@github-actions
Copy link
Copy Markdown

✅ AI Test Selection — PASSED

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

vyadavmsft and others added 2 commits April 21, 2026 18:39
Add an Azure smoke runbook and OpenVMM smoke suite that exercise guest boot,
restart, and stop/start on a prepared host.

Describe the LisaRunner guest-enabled flow explicitly:
- schedule environment initialization when the outer environment reaches Deployed
- initialize guest nodes after the outer environment connects
- allow guest-targeted tests that require Deployed to run once the outer host is Connected
- keep retry on the runner redeploy path instead of eagerly deleting the environment

Also wire the Azure/OpenVMM guest handling, schema updates, diagnostics, and
selftest coverage needed for this flow.

(cherry picked from commit ac4c15c)
Make guest teardown best-effort so parent node cleanup and close continue even when a guest cleanup path fails.

Tighten OpenVMM host-side handling by using host-native paths for copied artifacts, validating whoami before TAP creation, guarding working directory deletion, scoping dnsmasq state to the OpenVMM interface, and restoring the original ip_forward state when SSH forwarding is torn down.

Also update the launcher wrapper to return the real OpenVMM PID so later liveness checks and forced cleanup target the VM process rather than the wrapper shell.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@vyadavmsft vyadavmsft force-pushed the vyadav_openvmm_test branch from 362a68d to 90912f1 Compare April 22, 2026 01:41
@github-actions
Copy link
Copy Markdown

✅ AI Test Selection — PASSED

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

@vyadavmsft vyadavmsft requested a review from anirudhrb April 22, 2026 21:34
can_run_results = [x for x in can_run_results if x.can_run]
if environment.status == EnvironmentStatus.Deployed and can_run_results:
if self._guest_enabled:
return self._generate_task(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In this function we're just about to run the tests (_dispatch_test_result()). Guest initialization should've have been done much before this. Feels like this is not the right place to do it. But also I'm not too familiar with this lisa_runner code. @LiliDeng could you please suggest?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think this is the right place if we distinguish guest creation from guest initialization.
Guest nodes are created earlier during platform deploy, but they are not initialized there. In LisaRunner, this is still part of the environment state transition, not the actual test execution path. For guest_enabled, a parent environment at Deployed is not yet ready to run tests on the guest, so the next scheduled task needs to be _initialize_environment_task, which runs the normal connected-phase init and then initializes guest_environment.nodes.

So I think the placement is okay, though a small clarifying comment here would help.

class OpenVmmPlatform(TestSuite):
def before_case(self, log: Logger, **kwargs: Any) -> None:
node = kwargs["node"]
if not isinstance(node, OpenVmmGuestNode):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ahh I got it now. We're not using the OpenVMM platform directly. Instead, we're using Azure platform and defining this guests property. I was confused as to what was going on because I didn't know that this guests property existed.

Copy link
Copy Markdown
Collaborator

@anirudhrb anirudhrb left a comment

Choose a reason for hiding this comment

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

LGTM minus the lisa_runner.py and azure platform changes. I don't know enough about those.

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.

3 participants