Skip to content

Support soft reboot - #151

Merged
HarshwardhanPatil07 merged 9 commits into
bootc-dev:mainfrom
HarshwardhanPatil07:soft-reboot
Oct 9, 2026
Merged

HarshwardhanPatil07 merged 9 commits into
bootc-dev:mainfrom
HarshwardhanPatil07:soft-reboot

Conversation

@HarshwardhanPatil07

Copy link
Copy Markdown
Member

More info below:

What I confirmed?

Aug 25 11:57:33 worker1 systemd[1]: Stopped run-p2811-i2812.service - [systemd-run] /usr/bin/systemctl reboot "--message=Initiated by bootc".
Aug 25 11:57:37 worker1 systemd[1]: systemd-soft-reboot.service: Deactivated successfully.
Aug 25 11:57:37 worker1 systemd[1]: Finished systemd-soft-reboot.service - Reboot System Userspace.
Aug 25 11:57:37 worker1 systemd[1]: Reached target soft-reboot.target - Reboot System Userspace.
Aug 25 11:57:37 worker1 systemd[1]: Stopped target soft-reboot.target - Reboot System Userspace.

Also

Boot ID BEFORE: 2ee4c375-c4eb-4ffc-998d-112ad41e7f1f
Boot ID AFTER:  2ee4c375-c4eb-4ffc-998d-112ad41e7f1f

Also
bn.spec.rebootPolicy: AllowSoftReboot was set on the BootcNode by the controller

Full reboot verification(different)

Aug 25 12:36:54 worker2 systemd[1]: Reload requested from client PID 1044 ('systemctl') (unit cloud-init-main.service)...
Aug 25 12:37:03 worker2 systemd[1]: Reload requested from client PID 1239 ('systemctl') (unit session-4.scope)...
Aug 25 12:38:11 worker2 systemd[1]: Shutting down.
Aug 25 12:38:20 worker2 kernel: ISO 9660 Extensions: Microsoft Joliet Level 3

Also

Boot ID BEFORE: 6a9276a4-c6d7-4353-bb47-286c14b87df0
Boot ID AFTER:  46decf0b-f5b8-4a6e-90bb-6a4dc55986a8

Closes #117

@HarshwardhanPatil07

Copy link
Copy Markdown
Member Author

Comment thread internal/bootc/executor.go Outdated
Comment thread internal/bootc/executor.go Outdated
Comment thread internal/bootc/executor.go Outdated
Comment thread internal/daemon/reconciler.go Outdated
Comment thread internal/bootc/executor.go Outdated
Comment thread test/e2e/bootcnode_test.go
@HarshwardhanPatil07

Copy link
Copy Markdown
Member Author

Addressed

@HarshwardhanPatil07

Copy link
Copy Markdown
Member Author

FYI if you see ci failing, its because changed the cmd to bootc switch instead of bootc upgrade

bootc-dev/bootc:2342 pr will land shortly in rpm

The daemon needs to know the pool's reboot policy to decide between
a full reboot and a soft reboot. Add a RebootPolicy field to
BootcNodeSpec, reusing the existing type from bootcnodepool_types.go.

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
Add Apply(ctx, softReboot) to the Executor interface. When softReboot
is true, it runs bootc upgrade --from-downloaded --apply --soft-reboot=auto
via nsenter, which performs a userspace-only restart when the kernel
hasn't changed.

Uses bootc upgrade (not switch) because current bink images predate
bootc#2342 which adds --from-downloaded to switch.

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
Copy the pool's disruption.rebootPolicy to each BootcNode's spec on
creation and on sync, following the same pattern as pullSecretRef
propagation. Defaults to RebootOnly when the pool has no disruption
spec.

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
When the BootcNode's rebootPolicy is AllowSoftReboot, use
Executor.Apply(ctx, true) instead of Executor.Reboot(ctx). This calls
bootc with --soft-reboot=auto, which performs a userspace-only restart
when the kernel hasn't changed, avoiding a full hardware reboot.

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
Verify the full soft reboot lifecycle: create a pool with
AllowSoftReboot, trigger an update, and confirm the node comes back
with the same boot ID (kernel stayed up, only userspace restarted).

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
Rename Apply to ApplyUpdate for clarity per review feedback. Extract
bootc command construction into builder functions (bootcStatusArgs,
bootcSwitchArgs, bootcApplyUpdateArgs, systemctlRebootArgs) so all
bootc invocations are defined in one place.

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
@HarshwardhanPatil07
HarshwardhanPatil07 force-pushed the soft-reboot branch 2 times, most recently from fa3bd9c to 948d3ca Compare October 9, 2026 05:56
Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
Include pullSecretHash in the generated CRD so the published schema matches the BootcNode API type.

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
The rebase picked up an older local commit that used bootc upgrade. Restore the switch command used by the PR before the rebase.

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
@HarshwardhanPatil07
HarshwardhanPatil07 enabled auto-merge (rebase) October 9, 2026 07:16
@HarshwardhanPatil07

Copy link
Copy Markdown
Member Author

@Johan-Liebert1 @ptalgulk01 this one is safe to merge

@HarshwardhanPatil07
HarshwardhanPatil07 merged commit f6a6270 into bootc-dev:main Oct 9, 2026
21 of 22 checks passed
@HarshwardhanPatil07

Copy link
Copy Markdown
Member Author

@alicefr should we backport this?

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.

Support soft reboot

4 participants