Skip to content

Commit 645bc35

Browse files
committed
Switch reboot default
In light of recent issues reported with soft reboot we are chaning the reboot method to a full reboot. This is intended to reduce the number of requests we receive to investigate boot issues.
1 parent 3b5507e commit 645bc35

4 files changed

Lines changed: 28 additions & 14 deletions

File tree

doc/adoc/user_guide.adoc

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -171,20 +171,24 @@ tux > sudo zypper in SLES15-Migration
171171
----
172172
+
173173
The `run_migration` uses `kexec` to boot into the kernel delivered with the
174-
upgrade image delivered by the SLES15-Migration package. Once this system
175-
is live after the `kexec` the distribution migration process is automatically
176-
started. However, `kexec` is not supported and does not function in certain
177-
conditions. For example, the `run_migration` utility does not work in Xen
178-
based environments or when kernel keys change.
174+
upgrade image delivered by the SLES{$VERSION}-Migration package.
179175
+
180-
If kexec causes a kernel panic this can cause the system to hang and the
181-
distribution migration to fail. In that case refer to this TID:
182-
https://www.suse.com/support/kb/doc/?id=000019733
183-
And set the "soft_reboot" customization option:
176+
On the s390x architecture this is the only package available and the
177+
the `run_migration` method is the only option to start the migration process.
178+
The migration process starts automatically once the `run_migration` command
179+
is issued.
180+
+
181+
On all other architectures the `kexec`, i.e. use of `run_migration` is not
182+
supported. This path does not work in certain conditions, for example
183+
on Xen based environments or when kernel keys change.
184+
+
185+
By default this method is disabled. Enabling soft reboot behavior via kexec
186+
requires an explicit configuration change on all architectures except s390x
187+
by setting the "soft_reboot" customization option:
184188
+
185189
[listing]
186190
----
187-
echo "soft_reboot: false" >> /etc/sle-migration-service.yml
191+
echo "soft_reboot: true" >> /etc/sle-migration-service.yml
188192
----
189193

190194
Option 2 - Trigger via reboot::
@@ -303,9 +307,10 @@ debug: true|false
303307
----
304308

305309
Configure Reboot Method::
306-
By default, the migration system uses `kexec` to boot back into the host
307-
system once migration is complete. If this is in any way problematic,
308-
a regular `reboot` can be requested by setting `soft_reboot: false`.
310+
By default, the migration system uses a full reboot to boot back into the
311+
host system once migration is complete. It is possible to configure the
312+
migration system to use `kexec`, i.e. use a soft reboot by setting
313+
`soft_reboot: true` in the configuration. A soft reboot may trigger issues.
309314
+
310315
[listing]
311316
----

suse_migration_services/migration_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def is_zypper_migration_plugin_requested(self):
180180
return self.config_data.get('use_zypper_migration', True)
181181

182182
def is_soft_reboot_requested(self):
183-
return self.config_data.get('soft_reboot', True)
183+
return self.config_data.get('soft_reboot', False)
184184

185185
def is_host_independent_initd_requested(self):
186186
return self.config_data.get('build_host_independent_initrd', False)

test/unit/units/kernel_load_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def test_get_cmd_line_extra_boot_partition(self, mock_path_exists, mock_logger_s
9494
@patch('shutil.copy')
9595
@patch('suse_migration_services.command.Command.run')
9696
@patch('suse_migration_services.units.kernel_load.KernelKexec._get_cmdline')
97+
@patch('suse_migration_services.migration_config.is_soft_reboot_requested')
9798
def test_main_raises_on_kernel_load(
9899
self,
99100
mock_get_cmdline,
@@ -102,12 +103,14 @@ def test_main_raises_on_kernel_load(
102103
mock_get_migration_config_file,
103104
mock_os_path_exists,
104105
mock_logger_setup,
106+
mock_soft_reboot_state,
105107
):
106108
cmd_line = (
107109
'root=UUID=ec7aaf92-30ea-4c07-991a-4700177ce1b8'
108110
+ 'splash root=UUID=ec7aaf92-30ea-4c07-991a-4700177ce1b8 rw'
109111
)
110112
mock_get_cmdline.return_value = cmd_line
113+
mock_soft_reboot_state.return_value = True
111114
mock_get_migration_config_file.return_value = '../data/migration-config.yml'
112115
mock_Command_run.side_effect = [None, Exception('error')]
113116
with self._caplog.at_level(logging.ERROR):
@@ -133,6 +136,7 @@ def test_main_raises_on_kernel_load(
133136
@patch('shutil.copy')
134137
@patch('suse_migration_services.command.Command.run')
135138
@patch('suse_migration_services.units.kernel_load.KernelKexec._get_cmdline')
139+
@patch('suse_migration_services.migration_config.is_soft_reboot_requested')
136140
def test_main(
137141
self,
138142
mock_get_cmdline,
@@ -141,12 +145,14 @@ def test_main(
141145
mock_get_migration_config_file,
142146
mock_os_path_exists,
143147
mock_logger_setup,
148+
mock_soft_reboot_state,
144149
):
145150
cmd_line = (
146151
'root=UUID=ec7aaf92-30ea-4c07-991a-4700177ce1b8'
147152
+ 'splash root=UUID=ec7aaf92-30ea-4c07-991a-4700177ce1b8 rw'
148153
)
149154
mock_get_cmdline.return_value = cmd_line
155+
mock_soft_reboot_state.return_value = True
150156
mock_get_migration_config_file.return_value = '../data/migration-config.yml'
151157
main()
152158
assert mock_Command_run.call_args_list == [

test/unit/units/reboot_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def test_main_skip_reboot_due_to_debug_file_set(
3737
@patch.object(Defaults, 'get_migration_config_file')
3838
@patch.object(Defaults, 'get_system_migration_custom_config_file')
3939
@patch('suse_migration_services.units.reboot.Fstab')
40+
@patch('suse_migration_services.migration_config.is_soft_reboot_requested')
4041
def test_main_kexec_reboot(
4142
self,
4243
mock_Fstab,
@@ -45,12 +46,14 @@ def test_main_kexec_reboot(
4546
mock_logger_setup,
4647
mock_Command_run,
4748
mock_os_path_exists,
49+
mock_soft_reboot_state,
4850
):
4951
def skip_device(device):
5052
if '/dev/mynode' in device:
5153
return False
5254
return True
5355

56+
mock_soft_reboot_state.return_value = True
5457
mock_os_path_exists.side_effect = skip_device
5558
fstab = Fstab()
5659
fstab_mock = Mock()

0 commit comments

Comments
 (0)