Bug 1397518

Summary: upgrade from 6.1 to 6.2 fails if dhcpd.conf contains broken config
Product: Red Hat Satellite 6 Reporter: Patrick C. F. Ernzer <pcfe>
Component: InstallerAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2.4CC: bbuckingham, jcallaha, stbenjam
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-22 19:13:38 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:

Description Patrick C. F. Ernzer 2016-11-22 17:09:07 UTC
Description of problem:
while trying to update 6.1.9 to 6.2.4 I ran into the following bug;
Operator had made an error during install (of 6.1) that led to a non functional dhcpd.conf
upgrade starts but fails

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

How reproducible:

Steps to Reproduce:
1. install 6.1 with "katello-installer --capsule-dhcp true --capsule-dhcp-interface ens192 --capsule-dhcp-range "" --capsule-dhcp-gateway" while having an IP in another network (
2. attempt to upgrade to 6.2.4 as per the official docs ( https://access.redhat.com/documentation/en/red-hat-satellite/6.2/single/installation-guide#upgrading_a_connected_satellite_server )

Actual results:
upgrade fails because dhcpd.conf contains junk

Expected results:
one of
- 'foreman-rake katello:upgrade_check' catches the broken dhcpd.conf
- 'satellite-installer / katello-installer' catches the bogus range and refuse to use it

Additional info:
'ip a s' of the affected machine
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet scope host lo
       valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether <REDACTED> brd ff:ff:ff:ff:ff:ff
    inet brd scope global ens192
       valid_lft forever preferred_lft forever

dhcpd.conf (note the 246 vs 248) contains
subnet netmask {

  option subnet-mask;
  option routers;

obviously at the time the dhcpd servce is started by satelite-installer the exit code is not 0 (as 10.248... is not inside

workaround was to run 'satellite-installer --scenario satellite --upgrade --foreman-proxy-dhcp false'

Comment 3 Stephen Benjamin 2016-11-22 19:13:38 UTC
This is a dupe of https://bugzilla.redhat.com/show_bug.cgi?id=1267766.

The ranges given aren't bad, the operator may very well have made a mistake, but it might not have been in another situation.  Your dhcpd can manage leases for a subnet that's not explicitly attached to an interface, via DHCP relay.  

The problem is we generate the subnet declaration in the dhcpd.conf (subnet netmask part) based on the interface's own IP, instead of the ranges given.  We need to let a user override that.

You are right that if a user gives us a range and doesn't give us a subnet that matches up we should error, but that should be covered by the other BZ too.

*** This bug has been marked as a duplicate of bug 1267766 ***