-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: add possibility to use net.naming-scheme #1215
Conversation
Thank you for contributing to the Leapp project!Please note that every PR needs to comply with the Leapp Guidelines and must pass all tests in order to be mergeable.
Packit will automatically schedule regression tests for this PR's build and latest upstream leapp build. If you need a different version of leapp, e.g. from PR#42, use It is possible to schedule specific on-demand tests as well. Currently 2 test sets are supported,
See other labels for particular jobs defined in the Please open ticket in case you experience technical problem with the CI. (RH internal only) Note: In case there are problems with tests not being triggered automatically on new PR/commit or pending for a long time, please contact leapp-infra. |
4ca08f4
to
65cc048
Compare
65cc048
to
e4abe9e
Compare
I have tested the PR using a rhel8 system running on real HW with a NIC that would be renamed during the upgrade. The solutions installed the |
496d59b
to
1d04bf9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code-wise seems okay, just some minor comments.
I know RHEL7 is EOL, but maybe you could check if the LEAPP_USE_NET_NAMING_SCHEME
envar is set for 7->8 upgrade. I would expect at least a warning message in the logs, since we can't and won't do what the user explicitly wants.
I haven't tested the code yet.
repos/system_upgrade/common/actors/addupgradebootentry/tests/unit_test_addupgradebootentry.py
Outdated
Show resolved
Hide resolved
...s/system_upgrade/el8toel9/actors/emit_net_naming_scheme/tests/test_emit_net_naming_scheme.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/common/actors/addupgradebootentry/libraries/addupgradebootentry.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/common/actors/addupgradebootentry/libraries/addupgradebootentry.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/common/actors/addupgradebootentry/libraries/addupgradebootentry.py
Show resolved
Hide resolved
repos/system_upgrade/el8toel9/actors/emit_net_naming_scheme/libraries/emit_net_naming.py
Outdated
Show resolved
Hide resolved
/packit copr-build |
/packit build |
/packit retest-failed |
Tested, now works as expected. PLease rebase and resolved conflicts. |
9f96f17
to
6a32159
Compare
@matejmatuska rebased |
Leapp writes .link files to prevent interfaces being renamed after booting to post-upgrade system. This patch adds a less error-prone approach that uses net.naming-scheme kernel param. The naming-scheme tells udev what hardware properties to use when composing a device name. Moreover, possible values of this parameter are coarse-grained "profiles", that tell udev to behave as if it did on RHEL8.0. The functionality is enabled by setting LEAPP_USE_NET_NAMING_SCHEME environmental variable to 1. If the feature is enabled, the .link file generation is disabled. A kernel parameter `net.naming-scheme=` is added to the upgrade boot entry and the post-upgrade entry. The value of the parameter will be `rhel-<source_major>.0`. Note that the minor source version is *not used*. Using also source major version instead of 0 causes the device names to change slightly, so we use 0. Moreover, an extra RPM named `rhel-net-naming-sysattrs` is installed to the target system and target userspace container. The RPM provides definitions of the "profiles" for net.naming-scheme. The feature is available only for 8>9 and higher. Attempting to upgrade 7>8 with LEAPP_USE_NET_NAMING_SCHEME=1 will ignore the value of LEAPP_USE_NET_NAMING_SCHEME. Add a possibility to use the net.naming-scheme cmdline argument to make immutable network interface names during the upgrade. The feature can be used only for 8>9 upgrades and higher. To enable the feature, use LEAPP_USE_NET_NAMING_SCHEME=1. Jira-ref: RHEL-23473
6a32159
to
4a1ac6c
Compare
/packit copr-build |
b82a1cd
to
a209d46
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now this is only going to be enabled on 8->9.
The persistentnamesconfig
actor is now properly skipped on paths other than 8->9 and emit_net_naming_scheme
only emits on 8->9.
I tested it and it works as expected. LGTM
Leapp writes .link files to prevent interfaces being renamed
after booting to post-upgrade system. This patch adds a less
error-prone approach that uses net.naming-scheme kernel param.
The naming-scheme tells udev what hardware properties to use
when composing a device name. Moreover, possible values of this
parameter are coarse-grained "profiles", that tell udev to
behave as if it did on RHEL8.0.
The functionality is enabled by setting LEAPP_USE_NET_NAMING_SCHEME
environmental variable to 1. If the feature is enabled, the .link
file generation is disabled. A kernel parameter
net.naming-scheme=
is added to the upgrade boot entry and the post-upgrade entry.
The value of the parameter will be
rhel-<source_major>.0
. Notethat the minor source version is not used. Using also source major
version instead of 0 causes the device names to change slightly,
so we use 0. Moreover, an extra RPM named
rhel-net-naming-sysattrs
is installed to the target system and target userspace container.
The RPM provides definitions of the "profiles" for net.naming-scheme.
The feature is available only for 8>9 and higher. Attempting to
upgrade 7>8 with LEAPP_USE_NET_NAMING_SCHEME=1 will ignore
the value of LEAPP_USE_NET_NAMING_SCHEME.
Add a possibility to use the net.naming-scheme cmdline argument
to make immutable network interface names during the upgrade.
The feature can be used only for 8>9 upgrades and higher.
To enable the feature, use LEAPP_USE_NET_NAMING_SCHEME=1.
Jira-ref: RHEL-23473