This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours

Bug 675325

Summary: Changes to networking always clear the contents of resolv.conf
Product: Red Hat Enterprise Linux 5 Reporter: Allan Voss <avoss>
Component: ovirt-nodeAssignee: Joey Boggs <jboggs>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 5.7CC: apevec, bingdan, cpelland, cshao, gouyang, jwest, leiwang, mburns, moli, ovirt-maint, pcao, sgordon, ycui, yeylon
Target Milestone: rcKeywords: TestOnly, ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: ovirt-node-1.0-80.el5 Doc Type: Bug Fix
Doc Text:
The /etc/resolv.conf file was being overwritten every time a change was made to networking. The statement PEERDNS="no" is now added to all interface configuration (ifcfg*) files created by the hypervisor. This prevents the incorrect overwriting of the resolv.conf file.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-21 00:03:34 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 768021    
Attachments:
Description Flags
Patch none

Description Allan Voss 2011-02-04 16:51:08 EST
Description of problem:

When RHEV-H is installed on a multiple-NIC machine, and only one NIC is configured at install time, the remaining, unconfigured NICs will cause resolv.conf to be overwritten anytime a change is made to networking.

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

2.2

How reproducible:

Very

Steps to Reproduce:
1. Install RHEV-H on a system with multiple nics. Only configure one nic at install time, the rhevm connection. Make sure to add DNS entries at that point. All other nics left un-configured.

2. Logon to RHEV-H system, cat /etc/resolv.conf, and run "ifup ethX" for any nic that was left unconfigured.

3. Once the int is up, cat /etc/resolv.conf, and run "ifdown ethX" on the same interface.
  
Actual results:

Either the up or the down will effectively end up wiping out the /etc/resolv.conf file. This appears to happen because the rhevm interface replaces the initial resolv.conf, which is blank and from the live iso image, when it first gets it's configuration. The subsequent ifup and ifdown on the eth interfaces, which also seems to happen when using RHEV-M to configure networking, execs the ifup-post and ifdown-post scripts. There's an if stanza in that file that modifies the resolv.conf if PEERDNS=no or RESOLV_MODS is set and not "no".

Expected results:

resolv.conf shouldn't be affected

Additional info:

At this point, it's not clear why RESOLV_MODS is set. Adding "PEERDNS=no" to the ifcfg-ethX files prevents all of this. Since only rhevm should usually have a DNS entry, a valid solution might be to change the ovirt-network-config utility to add in the PEERDNS=no for all unconfigured interfaces, and likely even all eth interfaces, since DNS should be set via rhevm interface.
Comment 3 Alan Pevec 2011-03-04 05:36:52 EST
*** Bug 679876 has been marked as a duplicate of this bug. ***
Comment 6 Mike Burns 2011-05-10 13:43:31 EDT
Created attachment 498115 [details]
Patch

Adds PEERDNS to all ifcfg-eth* scripts.
Comment 7 Guohua Ouyang 2011-06-24 03:55:57 EDT
Tested on rhev-hypervisor-5.7-20110622.0.el5, change networking still clear resolv.conf, steps as below:

1. configure the nic eth0 and add dns entry (192.168.20.55) during install, other nics were not configured. reboot and check /etc/resolv.conf, dns entry (192.168.20.55) is there.

2. Check ifcfg-eth*, "PEERDNS=no" is added to unconfigured nics but not the configured nic eth0. 

3. Enter "setup" and configure eth1, configured dns (192.168.20.3) at this time too. after network configuring finish, check /etc/resolv.conf, dns entry (192.168.20.3) is there.  If choose not configured dns, after network configuring finish, /etc/resolv.conf is empty.

4. Check ifcfg-eth1, "PEERDNS=no" is removed, but added to ifcfg-eth0.

It should be "PEERDNS=no" is removed while configured the new nic.
Comment 9 Alan Pevec 2011-06-27 04:43:47 EDT
Original case is solved and reconfiguring can be moved to 5.8/5.7.z
Comment 14 Stephen Gordon 2012-01-10 08:59:06 EST
    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:
When the hypervisor was installed on a machine with multiple Network Interface Cards (NICs), and only one NIC wass configured at install time, the resolv.conf file would be overwritten each time a change was made to networking. The statement PEERDNS="no" is now added to all interface configuration (ifcfg*) files created by the hypervisor. This prevents the incorrect overwriting of the resolv.conf file.
Comment 15 Mike Burns 2012-01-10 09:45:39 EST
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-When the hypervisor was installed on a machine with multiple Network Interface Cards (NICs), and only one NIC wass configured at install time, the resolv.conf file would be overwritten each time a change was made to networking. The statement PEERDNS="no" is now added to all interface configuration (ifcfg*) files created by the hypervisor. This prevents the incorrect overwriting of the resolv.conf file.+The /etc/resolv.conf file was being overwritten every time a change was made to networking.  The statement PEERDNS="no" is now added to all interface configuration (ifcfg*) files created by the hypervisor. This prevents the incorrect overwriting of the resolv.conf file.
Comment 16 errata-xmlrpc 2012-02-21 00:03:34 EST
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-0168.html