ironic-agent ramdisk does not generate SSH hostkey on boot

Bug #1556145 reported by aeva black
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
diskimage-builder
Fix Released
High
Gregory Haynes

Bug Description

When using debian, ubuntu, or ubuntu-minimal as the base OS for building a ramdisk from the "ironic-agent" element, the ramdisk does not generate an ssh host key on startup. This results in the inability to SSH into the ramdisk (eg, for debugging purposes). The symptom of this problem is that port 22 is open and SSH clients can initiate a connection, but the connection is closed at the KEYX stage of connection negotiation.

Environment:

Ubuntu 14.04.4 LTS
diskimage-builder==1.11.2.dev12

Example build command:

DIB_DEV_USER_USERNAME=stack DIB_DEV_USER_PWDLESS_SUDO=yes DIB_DEV_USER_AUTHORIZED_KEYS=/home/stack/.ssh/id_rsa.pub \
disk-image-create ironic-agent devuser ubuntu-minimal simple-init -p openssh-server -o ironic-agent

Changed in diskimage-builder:
importance: Undecided → High
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/383481

Changed in diskimage-builder:
assignee: nobody → Gregory Haynes (greghaynes)
status: New → In Progress
tags: added: ironic
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to diskimage-builder (master)

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

commit c67e7ed15ede7e3d387dca82c06845f0c0e332f9
Author: Gregory Haynes <email address hidden>
Date: Thu Oct 6 14:29:23 2016 -0700

    Generate ssh-hostkeys on boot for ironic agent

    Ironic agent images should have ssh hostkeys in image on boot.

    Change-Id: If8d42bb8b8bff417d5b1d4d8bc371425697edde5
    Closes-Bug: #1556145

Changed in diskimage-builder:
status: In Progress → Fix Released
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/424988

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on diskimage-builder (master)

Change abandoned by Ian Wienand (<email address hidden>) on branch: master
Review: https://review.openstack.org/424988
Reason: wrong branch

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/424989

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on diskimage-builder (feature/v2)

Change abandoned by Ian Wienand (<email address hidden>) on branch: feature/v2
Review: https://review.openstack.org/424989
Reason: i'm going to try this in smaller increments

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/427984

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on diskimage-builder (feature/v2)

Change abandoned by Ian Wienand (<email address hidden>) on branch: feature/v2
Review: https://review.openstack.org/427984
Reason: oops, new version in Ib9eb3dd1d384fc5b6a9846608216e056c57a173a

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

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

commit 7603f97cadbf92c79549547dabbe252650343cac
Author: Gregory Haynes <email address hidden>
Date: Wed Dec 21 17:39:27 2016 +0000

    Revert "Revert Xenial to Python 2"

    We landed the fix for this in
    Icdb769541eee9793f261b4b8ec563be76ee13fe2.

    This reverts commit 2978ff885b1084fee923be7efcac3524d6ee2b56.

    Change-Id: Iecfc41ab2aad57bc4f6f86a13810b534d19a8fd5

commit 54b2733ad8b5807fdae1267c5475d4a0fba38237
Author: Gregory Haynes <email address hidden>
Date: Wed Dec 21 08:17:40 2016 +0000

    Dont run with VIRTUAL_ENV set

    debian ships a modified site.py which has some interesting behavior when
    VIRTUAL_ENV is set. In this case it will add
    /usr/lib/pythonx.x/site-packages to the start of sys.path. This causes
    pip to install packages to this location (rather than /usr/local). As a
    result, later on when booting where VIRTUAL_ENV is not set this branch
    is not hit and the path where python packages were installed is not part
    of sys.path.

    Change-Id: Icdb769541eee9793f261b4b8ec563be76ee13fe2

commit 2978ff885b1084fee923be7efcac3524d6ee2b56
Author: Ian Wienand <email address hidden>
Date: Wed Dec 21 05:11:07 2016 +0000

    Revert Xenial to Python 2

    There are issues with pip packages and a python3 only Xenial systems.
    This is occuring after Ie609de51cc5fcde701296c9474e315981d9778a2.

    We believe the issue is with VIRTUAL_ENV being set within the chroot
    and messing up pip installs
    (Icdb769541eee9793f261b4b8ec563be76ee13fe2) but a full solution is not
    yet clear.

    For now, set Xenial to ensure we use python2. Install the package for
    the ubuntu element (75-debian-minimal-baseinstall will install python2
    for the minimal elements).

    Change-Id: Id403919b0af93b375a900186c01a0d3a3bdfafea

commit 9d9a1e3000b72a5ab2de0366d5068af89e252cd8
Author: Paul Belanger <email address hidden>
Date: Fri Dec 16 12:30:10 2016 -0500

    Start func testing on centos-minimal again

    Because we run this image in openstack-infra, we want to increase our
    test coverage to help avoid potential breaks to our CI systems.

    Change-Id: I26405e3f7465654075278ec35b5e0da1338bb45e
    Signed-off-by: Paul Belanger <email address hidden>

commit d9dcb3fe99a4782b1cb4ddb9179a5e86ff73be96
Author: Paul Belanger <email address hidden>
Date: Fri Dec 16 11:42:59 2016 -0500

    Increase func testing for ubuntu-minimal element

    Since we still run these 3 version of ubuntu-minimal elements in
    openstack-infra, also run functional testing for them.

    Trusty and xenial will be in voting gate, precise added as skipped for
    non-voting.

    Add the default skip/run status to the "-l" output just to confirm
    this too.

    Change-Id: Icfbfd0cb7d9acae824972474b77e2fe0486c4f69
    Signed-off-by: Paul Belanger <email address hidden>

commit 61087d33e9ef67f05ef4a3b0dfc90ab521604292
Author: Ian Wienand <iwienand@redhat...

Read more...

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.