Bug 1387267

Summary: dhcp-all-interfaces doesn't work for rhel6 images
Product: Red Hat OpenStack Reporter: Derek Higgins <derekh>
Component: diskimage-builderAssignee: Derek Higgins <derekh>
Status: CLOSED ERRATA QA Contact: Derek Higgins <derekh>
Severity: high Docs Contact:
Priority: unspecified    
Version: 10.0 (Newton)CC: dtantsur, jschluet, mburns, mfuruta, rbartal, rhel-osp-director-maint
Target Milestone: rcKeywords: Triaged
Target Release: 10.0 (Newton)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: diskimage-builder-1.21.0-6.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-14 16:23:29 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:

Description Derek Higgins 2016-10-20 13:52:57 UTC
RHEL 6 images build and boot successfully (built with the following command)

DIB_REG_TYPE= DIB_CLOUD_IMAGES=file://$PWD DIB_RELEASE=6.8-20160425.0 disk-image-create --mkfs-options "-O ^64bit" rhel baremetal dhcp-all-interfaces grub2 -o rhel6-image

(Note: the --mkfs-options "-O ^64bit" is required if building a RHEL 6 image on a RHEL 7 host)

But when the instance boots its not getting any IP address

The problem seems to be that dhcp-all-interfaces isn't being installed correctly as its using dib-init-system to decide how to install itself.
dib-init-system is reporting that the image uses upstart as a init system instead of sysv

Also when localy forcing dhcp-all-interfaces down the sysv path it fails because 

/tmp/in_target.d/install.d/50-dhcp-all-interfaces: line 26: update-rc.d: command not found

We should instead be adding 
# chkconfig:         3 9 50
to the init script header and doing something like
chkconfig dhcp-all-interfaces on

Comment 1 Derek Higgins 2016-10-20 14:47:58 UTC
An update to the previous comment dib-init-system is probably returning the current value (it is upstart on RHEL 6) but the networking is being handled by the sysv compatibility layer.
here
/etc/rc.d/rc3.d/S10network -> ../init.d/network

Comment 4 Derek Higgins 2016-11-15 11:45:46 UTC
Tested using
diskimage-builder-1.21.0-6.el7ost.noarch

Built a rhel6 image with
DIB_RHSM_POOL=$POOL DIB_RHSM_PASSWORD=$P DIB_RHSM_USER=$U DIB_REG_TYPE= DIB_CLOUD_IMAGES=file://$PWD DIB_RELEASE=6.8-20160425.0 disk-image-create --mkfs-options "-O ^64bit" rhel baremetal dhcp-all-interfaces -o rhel6-image

Booted the image and all was well

[cloud-user@undercloud ~]$ ssh cloud-user.2.6 cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.8 (Santiago)

Comment 6 errata-xmlrpc 2016-12-14 16:23:29 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.

https://rhn.redhat.com/errata/RHEA-2016-2948.html