RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 811117 - [RFE][virt-sysprep] net-hwaddr not removed from "ifcfg-*" files on rhel
Summary: [RFE][virt-sysprep] net-hwaddr not removed from "ifcfg-*" files on rhel
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libguestfs
Version: 6.2
Hardware: Unspecified
OS: Linux
high
medium
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-10 07:47 UTC by Qin Guan
Modified: 2012-06-20 07:01 UTC (History)
4 users (show)

Fixed In Version: libguestfs-1.16.18-2.el6
Doc Type: Enhancement
Doc Text:
No Documentation needed
Clone Of:
Environment:
Last Closed: 2012-06-20 07:01:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0774 0 normal SHIPPED_LIVE Low: libguestfs security, bug fix, and enhancement update 2012-06-19 19:29:50 UTC

Description Qin Guan 2012-04-10 07:47:11 UTC
Description of problem:
The HWADDR can not be removed from "ifcfg-*" file on RHEL system. "$type/$distro" has the value of "linux/rhel", which is not in the support list.

In the script, net-hwaddr can be removed only when "$type/$distro" is linux/fedora:

    if [ "$net_hwaddr" = "yes" ]; then
        case "$type/$distro" in
            linux/fedora)
            ...
        esac
    fi

Need to add redhat-based linux system into support list, like linux/fedora|linux/rhel|linux/centos|linux/scientificlinux. 

Version-Release number of selected component (if applicable):
libguestfs-tools-1.16.15-1.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. on latest rhel6.3 host, update to use the latest libguestfs-tool (1.16.15-1.el6) package
2. provision a rhel6 kvm guest (named rhel6u2-x64)
3. reset the domain:
# virt-sysprep -d rhel6u2-x64
4. check HWADDR in the ifcfg-* file

Actual results:
The HWADDR is not removed from "ifcfg-*" files

Expected results:
The HWADDR is removed from "ifcfg-*" files. 

Additional info:

Comment 1 Richard W.M. Jones 2012-04-10 13:21:25 UTC
Upstream commit:
https://github.com/libguestfs/libguestfs/commit/5e054f873198b83947de328777d9ced3bfa39ad5

This fix will be backported to libguestfs 1.16.16.

Comment 3 Qixiang Wan 2012-04-17 07:07:36 UTC
Verified with libguestfs-tools-1.16.18-2.el6.x86_64.

Before fix (libguestfs-tools-1.16.15-1.el6.x86_64):

# guestfish --ro -a rhel.raw -i cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
HWADDR=52:54:00:19:22:B5  

# virt-sysprep -a rhel.raw
# guestfish --ro -a rhel.raw -i cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
HWADDR=52:54:00:19:22:B5  

After fix:

# guestfish --ro -a rhel.raw -i cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
HWADDR=52:54:00:19:22:B5  

# virt-sysprep -a rhel.raw
# guestfish --ro -a rhel.raw -i cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

Comment 4 Richard W.M. Jones 2012-04-26 12:26:58 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No Documentation needed

Comment 6 errata-xmlrpc 2012-06-20 07:01:46 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.

http://rhn.redhat.com/errata/RHSA-2012-0774.html


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