dhcp-all-interfaces doesn't work for rhel6 images

Bug #1638527 reported by Derek Higgins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
diskimage-builder
Fix Released
High
Derek Higgins

Bug Description

RHEL 6(and presumably centos6) images build and boot successfully (built with the following command)

DIB_REG_TYPE=portal DIB_CLOUD_IMAGES=file://$PWD DIB_RELEASE=6.8-20160425.0 disk-image-create --mkfs-options "-O ^64bit" rhel baremetal dhcp-all-interfaces devuser 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 but the networking is being handled by the sysv compatibility layer. here
/etc/rc.d/rc3.d/S10network -> ../init.d/network

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

Derek Higgins (derekh)
Changed in diskimage-builder:
importance: Undecided → High
assignee: nobody → Derek Higgins (derekh)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to diskimage-builder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/392555

Changed in diskimage-builder:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to diskimage-builder (master)

Reviewed: https://review.openstack.org/392555
Committed: https://git.openstack.org/cgit/openstack/diskimage-builder/commit/?id=d5225055ef2403b461083f5d76c67bc8410539a7
Submitter: Jenkins
Branch: master

commit d5225055ef2403b461083f5d76c67bc8410539a7
Author: Derek Higgins <email address hidden>
Date: Wed Nov 2 11:01:15 2016 +0000

    dhcp-all-interfaces: support Centos/RHEL 6

    On Centos and RHEL 6 the init system is upsart but but networking is using
    sysv compatabiliy and a code path the handle this situation.

    We can't use DISTRO_NAME because the centos-minimal element sets it to
    centos for CentOS 7 but the centos element sets it to centos for CentOS 6.

    Change-Id: Ib8e33ed78b3d6a5737eb7449bccef2d33f72b131
    Closes-Bug: #1638527

Changed in diskimage-builder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to diskimage-builder (feature/v2)

Fix proposed to branch: feature/v2
Review: https://review.openstack.org/399347

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to diskimage-builder (feature/v2)
Download full text (14.6 KiB)

Reviewed: https://review.openstack.org/399347
Committed: https://git.openstack.org/cgit/openstack/diskimage-builder/commit/?id=7d5afecfd9e2ea5249ea7f12eba74c77c1abd7e6
Submitter: Jenkins
Branch: feature/v2

commit 8d7362aa9b4a9d2430de7959d4ee4c78429464c0
Author: d.marlin <email address hidden>
Date: Thu Nov 17 03:36:54 2016 -0500

    Change path for dnf arch override so basearch is not overwritten.

    After writing the basearch value to /etc/dnf/vars/basearch the
    arch value was overwriting the same file. This appears to be
    incorrect, so changing it to write /etc/dnf/vars/arch, which
    matches the subsequent 'yum' code paths.

    Change-Id: I5da54f03224c11f9e286f16b68533936c4174c2a

commit fb8cf95b6fb0820867ebfd262c38d2cae5ab43fa
Author: Ben Nemec <email address hidden>
Date: Wed Nov 16 16:27:24 2016 -0600

    Disable all repos in os-refresh-config too

    This change was made for pre-install so it applies during the
    image build, but wasn't applied to the os-refresh-config script
    that would run after deployment. The same problems apply there,
    so we should do the same thing.

    Change-Id: I4b8534cc9586eeb588b5c358550e76e27d40556a
    Closes-Bug: 1629922

commit a1f57b8cad0717090eb12014d7847a35bd0563a3
Author: Markos Chandras <email address hidden>
Date: Mon Oct 31 21:43:47 2016 +0000

    lib: common-functions: Fix tmpfs umounting

    It has been observed that some chroot operations spawn additional
    processes which rely on chroot files. More specifically, zypper, uses
    gpg-agent to import and validate gpg keys for its repositories. This
    gpg-agent process may stay alive for longer which prevents unmounting of
    the tmpfs directory since the gpg-agent process still uses libraries etc
    which were present in the chroot. We try to solve this by using walking
    all the pids in /proc to find out the running processes in the chroot and
    kill them gracefully. If that fails for whatever reason, then we simply
    keep trying to umount the tmpfs directory before we give up.

    The gpg-agent process usually terminates soon after its home directory
    disappears but on fast systems we can reach the 'umount tmpfs' point
    before gpg-agent terminates by itself. The solution is generic enough so
    other 'chroot processes' can also be handled appropriately.

    Change-Id: Iccf332678c79266113e76f062884fc5ee79e515d

commit e88d6b37df5a210ad15da24403274914f737956e
Author: Noam Angel <email address hidden>
Date: Mon Oct 31 11:54:58 2016 +0200

    add support for SUSE in dhcp-all-interfaces

    This patch will add support for SUSE network scripts,
    network script in SUSE saved under "/etc/sysconfig/network/ifcfg-*"
    see: https://www.suse.com/documentation/sled11/book_sle_admin/data/sec_basicnet_manconf.html

    Change-Id: I87ac2e327cee4945c15da9f2e4adc0a8b7650712

commit d07d7ed15d54c37448d5be67c4e4707ba19edac0
Author: Noam Angel <email address hidden>
Date: Tue Nov 1 16:19:44 2016 +0200

    simplify ARCH param for rhel/centos param can be x86_64 and amd64

    for fedora/rhel/centos the main supported ARCH is x86_64. This patch allow
    to call diskima...

tags: added: in-feature-v2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.