Bug 1295491

Summary: fusor-installer NTP check may leave system with a broken /etc/resolv.conf
Product: Red Hat Quickstart Cloud Installer Reporter: John Matthews <jmatthew>
Component: fusor-installerAssignee: Jason Montleon <jmontleo>
Status: CLOSED CURRENTRELEASE QA Contact: Tasos Papaioannou <tpapaioa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 1.0CC: arubin, dgao, jmontleo, tpapaioa
Target Milestone: TP2Keywords: Triaged
Target Release: 1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-03 19:08:41 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:    
Bug Blocks: 1291836    

Description John Matthews 2016-01-04 16:54:46 UTC
Description of problem:

I ran into a situation where the NTP check in fusor-installer failed and my /etc/resolv.conf only contained entries for the Sat VM, therefore I couldn't resolve other addresses and install couldn't proceed.

It looks like we might be modifying /etc/resolv.conf then doing the NTP check, if it fails exiting with a busted /etc/resolv.conf




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

rpm -qa | grep fusor-installer
fusor-installer-0.0.14-23.el7.noarch

How reproducible:


Steps to Reproduce:
1. New VM
2. Run fusor-installer
3. Enter bad info for NTP server
4. Agree to stop fusor-installer
5. Re-run fusor-installer
6. Enter a valid NTP host
7. See how it complains about NTP host can't be reached
8. Agree to stop fusor-installer

Look at /etc/resolv.conf

# cat /etc/resolv.conf
; generated by /usr/sbin/dhclient-script
nameserver 192.168.52.10
nameserver 192.168.52.10



Issue is that the first run changes /etc/resolv.conf to:
 nameserver 192.168.52.10
 nameserver 192.168.121.1

2nd run changes to:
 nameserver 192.168.52.10
 nameserver 192.168.52.10

The removal of 192.168.121.1 for this case is what's breaking DNS resolution.


Actual results:

Example of /etc/resolv.conf prior to running fusor-installer:

cat /etc/resolv.conf
; generated by /usr/sbin/dhclient-script
nameserver 192.168.121.1
search localhost


Run fusor-installer for first time

1.      Proceed with the values shown
2.           Network interface | eth1
3.                  IP address | 192.168.52.10
4.                    Hostname | sat61fusorjwm.example.com
5.                Network mask | 255.255.255.0
6.             Network address | 192.168.52.0
7.                Host Gateway | 192.168.121.1
8.            DHCP range start | 192.168.52.11
9.              DHCP range end | 192.168.52.254
10.               DHCP Gateway | 192.168.52.1
11.              DNS forwarder | 192.168.121.1
12.                     Domain | example.com
13.                Foreman URL | https://sat61fusorjwm.example.com
14.              NTP sync host | foo.example.com
15.                   Timezone | UTC
16.        BMC feature enabled | false
17.       BMC default provider | ipmitool
18. Do not configure networking
19. Do not configure firewall
20. Cancel Installation
1
Starting networking setup
Networking setup has finished
WARNING!! - NTP sync host "foo.example.com" does not appear to be valid!
Do you want to continue anyway? [Yes/No]
no
Exiting installation!
  Something went wrong! Check the log for ERROR-level output
  The full log is at /var/log/katello-installer/katello-installer.log

real    0m42.417s
user    0m5.936s
sys     0m2.223s

# cat /etc/resolv.conf
; generated by /usr/sbin/dhclient-script
nameserver 192.168.52.10
nameserver 192.168.121.1

(DNS Resolution still works after first run)


Re-run fusor-installer
1.      Proceed with the values shown
2.           Network interface | eth1
3.                  IP address | 192.168.52.10
4.                    Hostname | sat61fusorjwm.example.com
5.                Network mask | 255.255.255.0
6.             Network address | 192.168.52.0
7.                Host Gateway | 192.168.121.1
8.            DHCP range start | 192.168.52.11
9.              DHCP range end | 192.168.52.254
10.               DHCP Gateway | 192.168.52.10
11.              DNS forwarder | 192.168.52.10
12.                     Domain | example.com
13.                Foreman URL | https://sat61fusorjwm.example.com
14.              NTP sync host | 0.rhel.pool.ntp.org
15.                   Timezone | UTC
16.        BMC feature enabled | false
17.       BMC default provider | ipmitool
18. Do not configure networking
19. Do not configure firewall
20. Cancel Installation
1
Starting networking setup
Networking setup has finished
WARNING!! - NTP sync host "0.rhel.pool.ntp.org" does not appear to be valid!
Do you want to continue anyway? [Yes/No]
no
Exiting installation!
  Something went wrong! Check the log for ERROR-level output
  The full log is at /var/log/katello-installer/katello-installer.log

# cat /etc/resolv.conf
; generated by /usr/sbin/dhclient-script
nameserver 192.168.52.10
nameserver 192.168.52.10


DNS resolution is now broken since we removed the entry for the external resolver.

Comment 1 John Matthews 2016-01-04 17:04:49 UTC
In terms of fixing this issue, I think we need to look at the code for adding the Satellite IP to /etc/resolv.conf.

We need the puppet code to be idempotent.  I'm guessing issue is around that area, likely not related to actual NTP check.

Comment 3 Jason Montleon 2016-01-18 17:30:38 UTC
https://github.com/fusor/fusor-installer/pull/41/files

Comment 4 John Matthews 2016-01-22 20:19:47 UTC
Compose of 1/22/16

Comment 5 Tasos Papaioannou 2016-01-25 17:17:19 UTC
Description and PR # are identical to https://bugzilla.redhat.com/show_bug.cgi?id=1295489 , which is VERIFIED on RHCI-6.0-RHEL-7-20160118.t.1. Marking this one as verified too.