Skip to content

Conversation

tjones60
Copy link
Contributor

@tjones60 tjones60 commented Oct 9, 2025

Adds a reprovisioned marker to the VMGS header to prevent the VMGS from repeatedly being reset when GuestStateLifetime is set to Reprovision. Adds HCL_DEFAULT_BOOT_ALWAYS_ATTEMPT, HCL_GUEST_STATE_LIFETIME, and HCL_STRICT_ENCRYPTION_POLICY so that these behaviors can be controlled on hosts without the required WMI properties. Refactors OPENHCL_DISABLE_UEFI_FRONTPAGE to be treated similarly. Adds Hyper-V tests for default boot and reprovision that are now possible with these changes.

@tjones60 tjones60 requested a review from a team as a code owner October 9, 2025 00:29
@Copilot Copilot AI review requested due to automatic review settings October 9, 2025 00:29
Copy link
Contributor

@Copilot 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 command line parameters to control guest state behaviors in OpenHCL environments, enabling configuration of boot policies, guest state lifetime, and encryption settings on hosts without WMI properties. It also refactors the existing UEFI frontpage disable functionality to use the same pattern.

Key changes:

  • Adds new command line options: HCL_DEFAULT_BOOT_ALWAYS_ATTEMPT, HCL_GUEST_STATE_LIFETIME, and HCL_STRICT_ENCRYPTION_POLICY
  • Refactors OPENHCL_DISABLE_UEFI_FRONTPAGE to use optional boolean pattern
  • Extends VMM tests to include Hyper-V test cases for default boot and reprovision scenarios

Reviewed Changes

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

Show a summary per file
File Description
vmm_tests/vmm_tests/tests/tests/multiarch/vmgs.rs Updates test configuration to support generic backends and adds Hyper-V test cases
petri/src/vm/openvmm/modify.rs Removes OpenVMM-specific default boot configuration method
petri/src/vm/openvmm/construct.rs Updates OpenVMM backend to use shared default boot configuration
petri/src/vm/mod.rs Adds shared default boot configuration method and UefiConfig field
petri/src/vm/hyperv/mod.rs Implements command line parameter passing for Hyper-V OpenHCL configurations
petri/src/vm/hyperv/hyperv.psm1 Adds error handling for VM system settings modification
openhcl/underhill_core/src/worker.rs Updates worker configuration to handle new optional parameters and DPS overrides
openhcl/underhill_core/src/options.rs Adds new command line option definitions and parsing logic
openhcl/underhill_core/src/loader/mod.rs Removes disable_uefi_frontpage parameter from loader configuration
openhcl/underhill_core/src/lib.rs Updates worker launch configuration with new parameters

Copy link

github-actions bot commented Oct 9, 2025

Copy link

github-actions bot commented Oct 9, 2025

@tjones60 tjones60 force-pushed the guest_state_cmdline branch from e3ab6e5 to 854bcce Compare October 10, 2025 00:45
Copy link

@tjones60 tjones60 changed the title underhill_core: add command line relating to guest state vmgs: reprovision marker and command line relating to guest state Oct 10, 2025
@tjones60 tjones60 changed the title vmgs: reprovision marker and command line relating to guest state vmgs: reprovision marker and guest state command line Oct 10, 2025
stunes-ms
stunes-ms previously approved these changes Oct 10, 2025
Copy link

impl FromStr for GuestStateLifetimeCli {
type Err = anyhow::Error;

fn from_str(s: &str) -> Result<GuestStateLifetimeCli, anyhow::Error> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need numeric options?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is a good question, probably not, unless there is some maximum length of the command line we might bump up against. Here, I was just following the pattern of the other enum.

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably fine as is then, at some point we should consider rewriting our underhill options parsers with some crate that keeps the binary size small (which is why this is currently hand-written and not using clap).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, also the other reason was to provide consistency with the WMI properties which have fixed enum values. I realized the TestScenarioConfig doesn't have numeric options, it's just the two I added.

@tjones60 tjones60 merged commit 478bf67 into microsoft:main Oct 14, 2025
50 of 52 checks passed
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