Merge feature/uefi_expiry to master#7073
Merged
Merged
Conversation
Add a new DynamicRO field to track Secure Boot certificate status per VM. The field indicates whether UEFI Secure Boot certificates need updating. - Define enum (ok, update_available, update_on_boot) and field in datamodel - Check certificate state via varstore-nvram-certcheck on import and DB upgrade for UEFI Secure Boot VMs - Skip control domains, default templates, and non-Secure Boot VMs in the DB upgrade rule Signed-off-by: Stephen Cheng <stephen.cheng@citrix.com>
…eter Add a new versioned parameter 'update' to VM.set_NVRAM_EFI_variables, allowing varstored to indicate whether Secure Boot certificates were changed during an NVRAM write. This enables xapi to maintain the VM.secureboot_certificates_state field accurately. The 'update' parameter is an enum with three values: - 'yes': certificates were updated, set state to 'ok' - 'no': certificates unchanged, keep current state as-is - 'unspecified': (default for v1 callers) run certcheck to determine state Signed-off-by: Stephen Cheng <stephen.cheng@citrix.com>
Signed-off-by: Chunjie Zhu <chunjie.zhu@cloud.com>
Also fix other comments during review Signed-off-by: Stephen Cheng <stephen.cheng@citrix.com>
…ing (#7015) ## Background Microsoft Secure Boot certificates from 2011 are reaching end-of-life, and legacy VMs may still contain only the old certificate set. This PR implements the xapi side of the out-of-band mechanism to track and update per-VM UEFI Secure Boot variables safely, as described in the [design doc](#7006). ## Changes Sorry for the large PR, but the changes form a single feature. The two main commits are: ### 1. CP-311907: Add `VM.secureboot_certificates_state` field Add a new `DynamicRO` field to track Secure Boot certificate status per VM. The field indicates whether UEFI Secure Boot certificates need updating. - Invoke `varstore-nvram-certcheck` to determine certificate state from the NVRAM EFI-variables blob - On DB upgrade: compute state for existing UEFI Secure Boot VMs, skipping control domains and default templates - On import: compute state for VMs imported - On clone/snapshot: copy the state to the new VM ### 2. CP-311908: Add versioned `update` parameter to `VM.set_NVRAM_EFI_variables` Add a versioned `update` parameter (enum: `yes`/`no`/`unspecified`) so varstored can report whether certificates were changed during an NVRAM write. This avoids invoking the certcheck binary on every NVRAM write. - `update=yes`: certificates were updated → set state to `ok` - `update=no`: certificates not changed → preserve current state - `update=unspecified` (default for legacy v1 callers): run certcheck to determine state - Register `set_NVRAM_v2` RPC in xapi-guard, mapping the string parameter to the enum ## Testing Tested the following scenarios with the updated varstored: - State transitions: `ok` → `update_available` → `update_on_boot` → `ok` verified correct - VM reboot with certificate update: varstored sends `update=yes`, state transitions to `ok` - VM reboot without certificate update: varstored sends `update=no`, state is preserved - Cross-host live migration (old host → new host, new host → new host): `secureboot_certificates_state` is correctly preserved
Signed-off-by: Chunjie Zhu <chunjie.zhu@cloud.com>
Signed-off-by: Chunjie Zhu <chunjie.zhu@cloud.com>
Signed-off-by: Chunjie Zhu <chunjie.zhu@cloud.com>
Signed-off-by: Chunjie Zhu <chunjie.zhu@cloud.com>
Admin marks a VM for update: update_available -> update_on_boot tgroup.opam update is to fix "make test" failure
Sync with the latest master branch
Signed-off-by: Chunjie Zhu <chunjie.zhu@citrix.com>
According to design doc, we treat non-secure-boot VM same as secure-boot VM, that is to say, the certificate and certificate state should be updated for non-secure-boot VM.
Signed-off-by: Chunjie Zhu <chunjie.zhu@citrix.com>
stephenchengCloud
approved these changes
May 15, 2026
changlei-li
approved these changes
May 18, 2026
minglumlu
approved these changes
May 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This feature does,