Bug 1328576

Summary: RFE: When a MAC address is provided in a network kickstart line, it should be written to the installed ifcfg file as the HWADDR
Product: Red Hat Enterprise Linux 7 Reporter: jcastran
Component: anacondaAssignee: Radek Vykydal <rvykydal>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: high Docs Contact: Petr Bokoc <pbokoc>
Priority: medium    
Version: 7.2CC: cshao, cww, jcastran, jikortus, jstodola, pbokoc, qguo, qiyuan, rbarry, rvykydal, salmy, sbueno, ycui
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: anaconda-21.48.22.124-1 Doc Type: Enhancement
Doc Text:
New option for the "network" Kickstart command binding the device configuration file to the device MAC address You can now use the new "--bindto=mac" option with the "network" Kickstart command to use the `HWADDR` parameter (the MAC address) instead of the default `DEVICE` in the device's `ifcfg` file on the installed system. This will bind the device configuration to the MAC instead of the device name. Note that the new "--bindto" option is independent of the "network --device" Kickstart option. It will be applied to the `ifcfg` file even if the device was specified in the Kickstart file using its name, `link`, or `bootif`.
Story Points: ---
Clone Of:
: 1483981 1488414 (view as bug list) Environment:
Last Closed: 2018-04-10 08:45:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1483981    
Bug Blocks: 1420851, 1478303    

Comment 2 Radek Vykydal 2016-04-20 10:23:10 UTC
To prevent breaking current behavior (bug 1130042) I'd propose to add

--bindtomac

or 

--bindto=mac

network command flag.

The harder part here might be that currently we are assuming interface-name (DEVICE) setting present in connection (ifcfg) and in this case we probably want only HWADDR to be present, ie we don't want to bind device name to MAC (rename by udev's 60-net-rules) but we want just to bind connection to MAC.

Comment 4 Radek Vykydal 2017-08-03 14:39:40 UTC
Would the customer by ok with the solution using a new network kickstart command option as proposed in comment #2 ?

Comment 5 jcastran 2017-08-07 16:33:46 UTC
Customer agrees with this idea.

~~~~~~~~~~~~~~~~~~
Hello,

that sounds just right!

Perhaps it could become default behaviour if no device name is passed to the network configuration line.

Thanks.

~~~~~~~~~~~~~~~~~~

Comment 7 Radek Vykydal 2017-08-08 14:23:16 UTC
(In reply to jcastran from comment #5)

> Perhaps it could become default behaviour if no device name is passed to the
> network configuration line.

To make the requested feature safe and consistent with regard to current behavior and defaults, binding to MAC address should be used only if explicitly requested by the option, in all cases, ie --device missing, --device specified by device name, --device specified by MAC address, etc.

Comment 11 Fedora Update System 2017-09-29 16:06:31 UTC
anaconda-27.20.2-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-6dd3da2595

Comment 12 Fedora Update System 2017-10-02 00:55:34 UTC
anaconda-27.20.2-1.fc27, pykickstart-2.39-1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-6dd3da2595

Comment 13 Fedora Update System 2017-10-02 10:50:16 UTC
anaconda-27.20.2-1.fc27 pykickstart-2.39-1.fc27 python-simpleline-0.6-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-6dd3da2595

Comment 14 Fedora Update System 2017-10-02 21:25:52 UTC
anaconda-27.20.2-1.fc27, pykickstart-2.39-1.fc27, python-simpleline-0.6-1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-6dd3da2595

Comment 17 Radek Vykydal 2017-11-27 08:54:47 UTC
I would just make clear that the HWADDR will be used *instead of* DEVICE for --bindto=mac. By default the ifcfg is bound to interface name (DEVICE=<interface_name> is used in ifcfg file). The new option allows to bind the configuration to the MAC address of the device. HWADDR=<mac> is used instead of the DEVICE in the ifcfg file [1]. The --device option is independent of the --bindto option, it only serves to identify the device installer should use the network configuration (ks command) for. For example you can specify the device to be configured by MAC (--device=<MAC>) but (by default) binding to interface name will by used (DEVICE=<interface_name> in ifcfg file). On the other hand you can the specify device by its name (--device=ens3) and require the configuration (ifcfg file) to be bound to MAC address by using --bindto=mac option, which will result in HWADDR=MAC set (and DEVICE= not used) in the ifcfg.
But I think in most cases using --bindto=mac, --device will be specified by MAC or link or left out completely (which means --device=link).

So I'd modify the doc text slightly to something like this:

New option for the "network" Kickstart command allows to bind the configuration (`ifcfg` file) to device's MAC address.
   
You can now use the new "--bindto=mac" option with the "network" Kickstart command to use the `HWADDR` parameter in the device's `ifcfg` file on the installed system instead of `DEVICE` parameter which would be used by default (binding to interface name).

Note that the new option for binding the configuration is independent of the --device option. The --bindto option will be applied to the configuration (`ifcfg` file) even if the device was specified using a device name, `link` or `bootif`.

[1] To make the picture complete (not to be mentioned in rel notes), there is also a case when both DEVICE and HWADDR are set in ifcfg: when ifname= installer boot option is used. Then the ifcfg is bound to MAC (beacuse of HWADDR set) but having also DEVICE in ifcfg means renaming the device with the MAC to the name specified by DEVICE during system startup (ie not only the ifcfg file, but also the interface name is bound to the MAC).

Comment 18 Petr Bokoc 2017-11-28 12:17:47 UTC
Thanks! Updated.

Comment 21 errata-xmlrpc 2018-04-10 08:45:01 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0671