Skip to content

Conversation

@ndubchak
Copy link
Contributor

@ndubchak ndubchak commented Jan 16, 2026

🔍 Description

This PR enables running A/B manual rollback on hosts that are using PCR encryption.

🤔 Rationale

This PR is a follow up to the recent commit to enable manual rollback in Trident. This PR allows the users to perform a manual rollback that requires a reboot on a host that has PCR encryption enabled.

Fundamentally, manual rollback x encryption would fail because systemd-cryptsetup would be unable to decrypt the encrypted volumes at boot, as the pcrlock JSON in the rollback OS would not correspond to the actual TPM 2.0 access policy. This would happen because the (A or B) (in the servicing OS) and (B or A) (in the rollback OS) pcrlock JSONs are not equivalent. This PR solves this problem by modifying logic related to how .pcrlock files are generated. In particular, we now always sort the lists of UKI and bootloader binaries to: AZLA, then AZLB. This means that when systemd-pcrlock parses the directory searching for .pcrlock files, it will include first AZLA, and then AZLB into the pcrlock policy. As a result, the servicing OS and the rollback OS will now have an identical pcrlock JSON (A or B), so that the encrypted volumes can be decrypted when the host is booting into the rollback OS.

Logic for manual rollback testing as a storm scenario was taken from a commit by @bfjelds .

Copilot AI review requested due to automatic review settings January 16, 2026 20:51
@ndubchak ndubchak requested a review from a team as a code owner January 16, 2026 20:51
Copy link
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 enables manual rollback functionality for hosts using PCR encryption by:

  • Updating pcrlock policy generation to support rollback scenarios with encrypted volumes
  • Adding binary path ordering by volume label (AZLA/AZLB) for consistent pcrlock generation
  • Creating a new manual rollback helper for testing rollback with encryption
  • Removing the restriction that prevented manual rollback with encryption

Changes:

  • Enabled encryption support for manual A/B rollbacks by regenerating pcrlock policies with both current and rollback boot binaries
  • Added a new manual-rollback storm helper to test manual rollback flows, including artifact collection
  • Updated binary path sorting to ensure consistent ordering by volume label for deterministic pcrlock generation

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
crates/trident/src/engine/storage/encryption.rs Added volume label-based sorting for UKI and bootloader binaries; enhanced get_uki_paths and get_bootloader_paths to handle rollback scenarios
crates/trident/src/engine/manual_rollback/mod.rs Uncommented and enabled pcrlock policy regeneration during manual rollback staging
crates/trident/src/engine/manual_rollback/utils.rs Removed encryption with volume change restriction and updated logging with consistent quote formatting
tools/storm/utils/ssh/sftp/sftp.go Added DownloadRemoteFile function to download remote files via SFTP with sudo privileges
tools/storm/helpers/manual_rollback.go New helper to test manual rollback, including artifact collection and rollback validation
tools/storm/helpers/init.go Added ManualRollbackHelper and alphabetically sorted helper list
.pipelines/templates/stages/testing_common/e2e-test-run.yml Added pipeline steps to test manual rollback with encryption in combined configuration

@ndubchak ndubchak marked this pull request as ready for review January 17, 2026 01:53
Copilot AI review requested due to automatic review settings January 17, 2026 01:53
Copy link
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.

@bfjelds
Copy link
Member

bfjelds commented Jan 17, 2026

remove > Note: we currently do not support A/B update rollbacks when using PCR-based encryption. in docs/Explanation/Manual-Rollback.md

Copilot AI review requested due to automatic review settings January 17, 2026 02:16
Copy link
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 10 out of 10 changed files in this pull request and generated 5 comments.

bfjelds
bfjelds previously approved these changes Jan 17, 2026
Copilot AI review requested due to automatic review settings January 17, 2026 08:44
@ndubchak ndubchak changed the title engineering: Enable encryption x manual rollback flow feature: Enable encryption x manual rollback flow Jan 17, 2026
Copy link
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 10 out of 10 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings January 17, 2026 10:25
Copy link
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 10 out of 10 changed files in this pull request and generated 2 comments.

@ndubchak
Copy link
Contributor Author

/AzurePipelines run [GITHUB]-trident-pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@ayaegashi ayaegashi left a comment

Choose a reason for hiding this comment

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

lgtm as long as pr-e2e passes

@ndubchak ndubchak merged commit 386ca09 into main Jan 17, 2026
77 of 82 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.

4 participants