upgrades-migrations / preupgrade-assistant-modules

Modules for the Preupgrade Assistant tool. Disclaimer: It was fun. R.I.P. :-)
GNU General Public License v3.0
3 stars 11 forks source link

system/tuned: updated the check, added more rules #125

Closed yarda closed 4 years ago

yarda commented 4 years ago

Related: https://projects.engineering.redhat.com/browse/OAMG-3185

Signed-off-by: Jaroslav Škarvada jskarvad@redhat.com

It adds more check logic. Currently the code doesn't work for profiles with spaces in the name (I am not sure whether it's supported, if yes, feel free to update the code).

It works the following way:

Also it wouldn't be bad if it could run check after the migration (i.e. on the RHEL-7). In such case I would recommend running tuned-adm recommend (on the RHEL-7) and if its output differs from the $ACTIVE_PROFILE it could warn user that her or his profile is different from the recommended one and that she or he could reconsider using the recommended defaults.

AloisMahdal commented 4 years ago

Note that the stray output is #122.

pirat89 commented 4 years ago

@yarda kind of done. I did one push force to fix some changes to fix couple of things in those two additional commits. So far it seems it works. Pls check the current solution and let me know.

AloisMahdal commented 4 years ago

I ran the original downstream test with

preupgrade-assistant-2.6.1-1.201903271312Z.master.el6_10
preupgrade-assistant-el6toel7-0.7.9-0.202007130935Z.PR125.el6_10
preupgrade-assistant-el6toel7-data-0.20200704-1.el6_10
redhat-upgrade-tool-0.8.0-1.201903271313Z.rhel6.el6_10

Is this expected in upgrade.log?:

[..]
[..]
Jul 13 12:11:14 (hostname) upgrade-post[31894]: Config file /var/lib/logrotate.status does not exists.
Jul 13 12:11:14 (hostname) upgrade-post[31894]: Copy file var/lib/logrotate.status to /var/lib/logrotate.status
Jul 13 12:11:14 (hostname) upgrade-post[31894]: Running /root/preupgrade/postupgrade.d/zz_tuned_post.sh...
Jul 13 12:11:14 (hostname) upgrade-post[31894]: Warning: The recommended tuned profile 'throughput-performance' is different from the active one 'virtual-guest'. Consider the change of the profile.
Jul 13 12:11:14 (hostname) upgrade-post[31894]: redhat_upgrade_tool.util WARNING: failed to remove /system-upgrade-root: [Errno 16] Device or resource busy: '/system-upgrade-root/mnt'
Jul 13 12:11:15 (hostname) upgrade-post[31894]: resetting bootloader config
[..]
[..]

Asking just about the "recommended tuned profile"; the "failed to remove" is already known as upgrades-migrations/redhat-upgrade-tool#52

Otherwise no issues found; the test passed.

pirat89 commented 4 years ago

@AloisMahdal it's expected message. The warning is additional pointer that user should check it. The same instruction is already in the preupgrade report.

AloisMahdal commented 4 years ago

also note that this message is not in preupgrade asessment (result.html); the result there is pass.

yarda commented 4 years ago

Yes, the warning about recommended profile is usually OK, but in this case it's suspicious.

In case it's virtual machine, the 'tuned-adm recommend' should recommend 'virtual-guest' profile, not the 'throughput-performance' profile. What's the output of the 'virt-what' command on the machine?

AloisMahdal commented 4 years ago

virt-what produces empty output on this one.

yarda commented 4 years ago

So it's probably OK, on bare metal (with the empty virt-what output) the recommendation to use 'throughput-performance' profile is correct.

AloisMahdal commented 4 years ago

Also it wouldn't be bad if it could run check after the migration (i.e. on the RHEL-7). In such case I would recommend running tuned-adm recommend (on the RHEL-7) and if its output differs from the $ACTIVE_PROFILE it could warn user that her or his > profile is different from the recommended one and that she or he could reconsider using the recommended defaults.

Why this? IOW, how does having different than recommended profile relate to upgrade?

If it's because recommendations changed, could we predict that change and report the fact to the assessment?

yarda commented 4 years ago

Theoretically we cannot predict it. Tuned on RHEL-6 doesn't have the recommend feature. On RHEL-7 the 'recommend' behaviour can be also changed by 3rd party packages.

AloisMahdal commented 4 years ago

OK, talking to @pirat89 the intent is that user is already instructed about possible need of re-consideration. This warning is a smart reminder of that.

However there's actually nothing about this in the assessment:

oamg3352-ast

AloisMahdal commented 4 years ago

With

preupgrade-assistant-2.6.1-1.201903271312Z.master.el6_10
preupgrade-assistant-el6toel7-0.7.9-0.202007131641Z.PR125.el6_10
preupgrade-assistant-el6toel7-data-0.20200704-1.el6_10
redhat-upgrade-tool-0.8.0-1.201903271313Z.rhel6.el6_10

the original downstream test now passed.

pirat89 commented 4 years ago

Thanks guys @yarda @AloisMahdal . Merging