Bug 750833 - running sys-unconfig doesn't clean the existing MAC address in the ifcfg-eth0 file.
Summary: running sys-unconfig doesn't clean the existing MAC address in the ifcfg-eth0...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: initscripts
Version: 6.1
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Lukáš Nykrýn
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
: 786538 (view as bug list)
Depends On:
Blocks: 782183 840699
TreeView+ depends on / blocked
 
Reported: 2011-11-02 13:30 UTC by Alexander Chuzhoy
Modified: 2018-11-29 21:40 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-10-01 14:00:19 UTC
Target Upstream Version:


Attachments (Terms of Use)
rc.sysinit patch (402 bytes, patch)
2011-11-03 08:52 UTC, Richard W.M. Jones
no flags Details | Diff

Description Alexander Chuzhoy 2011-11-02 13:30:59 UTC
Description of problem:
After running sys-unconfig on a VM with 1 NIC (eth0) running RHEL6.1, I'm creating a template from it. Then, I create a new VM from this template.
When I boot the newly created VM - it can't start eth0.

When I check the /etc/sysconfig/network-scripts/ifcfg-eth0 file - the "HWADDR=" line still has the old MAC.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Prepare a VM with 1 NIC running RHEL6.1
2. Make sure eth0 is UP.
3. Run sys-unconfig and create a template from this VM.
4. Create a new VM from this template.
5. Check the status of the interfaces.
  
Actual results:
eth0 is down and can't be brought up.

Expected results:
eth0 is UP.

Additional info:

Comment 8 Alexander Chuzhoy 2011-11-03 08:43:24 UTC
Removing the udev rules file (or just fixing its entries) doesn't fix the "HWADDR=" line.

Comment 9 Richard W.M. Jones 2011-11-03 08:52:36 UTC
Created attachment 531514 [details]
rc.sysinit patch

Suggested patch to initscripts, untested.

Comment 10 Alexander Chuzhoy 2011-11-03 09:28:58 UTC
Tried it - doesn't work.
The udev still tries to create ifcfg-eth1 and ifcfg-eth0 fails to start.

What will do the trick though (obviously... and tested to be on the safe side) is the following:

    for f in /etc/sysconfig/network-scripts/ifcfg-*; do
        rm -f $f
#	sed -i -e '/^HWADDR=/d' "$f"
    done


IMHO, sys-unconfig implies reconfiguration of all adapters, so this should be fine....

Comment 11 Alexander Chuzhoy 2011-11-03 09:31:02 UTC
In the previous comment I meant ethX (not ifcfg-ethX).
Thanks.

Comment 12 Bill Nottingham 2011-11-03 17:18:55 UTC
Surely if you want to 'reconfigure all adapters', you'd remove the ifcfg files entirely, and therefore the X configuration, modprobe.conf.d files, and so on.

Comment 13 RHEL Program Management 2011-11-07 06:47:09 UTC
Since RHEL 6.2 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.

Comment 15 Bill Nottingham 2011-12-21 19:18:27 UTC
That patch implies that the only use of it is your usage case, though. I'd expect the case where someone who wants to unconfigure their system wants the entirety of network config to go away to be roughly as common.

Comment 16 Derrick Ornelas 2012-01-11 20:08:29 UTC
(In reply to comment #15)
> That patch implies that the only use of it is your usage case, though. I'd
> expect the case where someone who wants to unconfigure their system wants the
> entirety of network config to go away to be roughly as common.

I can understand that point, but there currently doesn't appear to be any way to configure new network devices on the next boot when we run system-config-network-tui.  In RHEL 5 I seem to remember kudzu scanning for new devices on boot and prompting the user to configure them, but nothing like this happens in RHEL 6 as far as I can see.  Udev creates a new persistence rule, but the user is left having to write ifcfg files from scratch.

Comment 17 Bryan Yount 2012-05-15 14:21:53 UTC
(In reply to comment #16)
> In RHEL 5 I seem to remember kudzu scanning for new
> devices on boot and prompting the user to configure them, but nothing like this
> happens in RHEL 6 as far as I can see.  Udev creates a new persistence rule,
> but the user is left having to write ifcfg files from scratch.

This is exactly what I reported in bug 750386. It seems to me that sys-unconfig isn't cleaning up as much as it should. It should be cleaning out udev rules and old ifcfg files so that new ones will be generated on next boot.

Comment 19 RHEL Program Management 2012-07-10 07:39:52 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 20 RHEL Program Management 2012-07-10 23:25:47 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 21 Lukáš Nykrýn 2012-08-01 12:53:09 UTC
*** Bug 786538 has been marked as a duplicate of this bug. ***

Comment 22 Lukáš Nykrýn 2012-08-02 12:18:18 UTC
I am not sure if we can handle this properly in initscripts, best way would be to completely regenerate ifcfg files, but these are created in anaconda.

Comment 26 Lukáš Nykrýn 2012-09-26 07:03:41 UTC
This bug was reported for VMs and we have now tool virt-sysprep which should do mentioned job, so I will close this bug. Does anyone have any objections?


Note You need to log in before you can comment on or make changes to this bug.