diff options
author | Christian Breunig <christian@breunig.cc> | 2025-04-18 19:59:55 +0200 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2025-05-17 16:05:38 +0200 |
commit | d7ff642a389e47a4f38fa7c2fabbe71fbbb05f21 (patch) | |
tree | 50b9373e41bdaaa66d985a4f1d6df74f813b7b35 /src/op_mode | |
parent | 74d848a981e25a5a3f563e355ba658ce70acf626 (diff) | |
download | vyos-1x-d7ff642a389e47a4f38fa7c2fabbe71fbbb05f21.tar.gz vyos-1x-d7ff642a389e47a4f38fa7c2fabbe71fbbb05f21.zip |
T1771: automatic reboot of system into previous image
If any part of the system boot fails, we set overall_status=1 in the vyos-router
startup script. When an error during the image upgrade is detected, the system
will automatically revert the default boot image to the previously used version,
if the CLI option "system option reboot-on-upgrade-failure" is set.
The user is informed via console messages:
Booting failed, reverting to previous image
Automatic reboot in 5 minutes
Use "reboot cancel" to cancel
The user has time to log in and run reboot cancel to remain in the faulty image
for troubleshooting. Reboot timeout is defined by CLI: "system option
reboot-on-upgrade-failure"
Once the system boots into the previous image, the MOTD will display a
persistent warning message - cleared during next reboot.
WARNING: Image update to "VyOS 1.5.xxxx" failed
Please check the logs:
/usr/lib/live/mount/persistence/boot/NAME/rw/var/log
Message is cleared on next reboot!
Upgrade failure can be synthetically injected by booting with Kernel command
line option: vyos-fail-migration
Diffstat (limited to 'src/op_mode')
-rwxr-xr-x | src/op_mode/image_info.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/op_mode/image_info.py b/src/op_mode/image_info.py index 56aefcd6e..0ec930543 100755 --- a/src/op_mode/image_info.py +++ b/src/op_mode/image_info.py @@ -72,6 +72,14 @@ def _format_show_images_details( return tabulated +def show_images_current(raw: bool) -> Union[image.BootDetails, str]: + + images_summary = show_images_summary(raw=True) + if raw: + return {'image_running' : images_summary['image_running']} + else: + return images_summary['image_running'] + def show_images_summary(raw: bool) -> Union[image.BootDetails, str]: images_available: list[str] = grub.version_list() |