Enable support for hardware that brings the network up slowly

Add the slow-network element which defaults the timeout of network
bring-up to 60 seconds set by the NETWORK_TIMEOUT environment variable.

Syncs the ops repository to a known location so that we can use the
element when building images.

Rename the register-images script to register-nodes as that what it
actually does.

Change-Id: I403667f7bf6c69e255a4f5639ee4a8e0e8af18e3
This commit is contained in:
Matthew Thode 2017-11-15 13:12:24 -06:00
parent 62a41aef85
commit e34ad321f7
No known key found for this signature in database
GPG Key ID: 64A37BEAAE19A4E8
5 changed files with 39 additions and 6 deletions

View File

@ -0,0 +1,9 @@
============
Slow Network
============
This element is used to configure network start for network devices that take
longer than normal to start (LACP for example).
* You can use the `NETWORK_TIMEOUT` environment variable to set the timeout.
The timeout currently defaults to 60.

View File

@ -0,0 +1 @@
export NETWORK_TIMEOUT=${NETWORK_TIMEOUT:-'60'}

View File

@ -0,0 +1,16 @@
#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
# If the file /etc/sysconfig/network exists, set some options to make dhcp happy happy happy
if [ -e "/etc/sysconfig/network" ] ; then
# Give some time for the link to come up before configuring via dhcp
grep -v -q '^LINKDELAY' /etc/sysconfig/network && echo "LINKDELAY=${NETWORK_TIMEOUT}" >> /etc/sysconfig/network
# Persistently try to gain a dhcp address
grep -v -q '^PERSISTENT_DHCLIENT' /etc/sysconfig/network && echo 'PERSISTENT_DHCLIENT=yes' >> /etc/sysconfig/network
fi

View File

@ -19,7 +19,7 @@ function cleanup {
trap cleanup EXIT
function make-base-image {
disk-image-create -o baremetal-$DISTRO_NAME-$DIB_RELEASE $DISTRO_NAME baremetal bootloader dhcp-all-interfaces local-config proliant-tools ${DEBUG_USER_ELEMENT:-""}
disk-image-create -o baremetal-$DISTRO_NAME-$DIB_RELEASE $DISTRO_NAME baremetal bootloader dhcp-all-interfaces local-config proliant-tools slow-network ${DEBUG_USER_ELEMENT:-""}
rm -R *.d/
scp -o StrictHostKeyChecking=no baremetal-$DISTRO_NAME-$DIB_RELEASE* "${UTILITY01_HOSTNAME}":~/images
@ -53,7 +53,9 @@ apt-get install -y kpartx parted qemu-utils
mkdir -p ~/dib
pushd ~/dib
virtualenv env
set +u
source env/bin/activate
set -u
# newton pip.conf sucks
if [[ -f ~/.pip/pip.conf ]]; then
@ -74,6 +76,9 @@ pushd ~/dib
if [[ -f ~/.pip/pip.conf.bak ]]; then
mv ~/.pip/pip.conf.bak ~/.pip/pip.conf
fi
if [[ ! -e ~/dib/openstack-ansible-ops ]]; then
git clone https://github.com/openstack/openstack-ansible-ops ~/dib/openstack-ansible-ops
fi
UTILITY01_HOSTNAME="${UTILITY01_HOSTNAME:-$(grep infra01_util /etc/hosts | awk '{print $NF}')}"
@ -89,6 +94,10 @@ pushd ~/dib
# set up envars for all images
export DIB_CLOUD_INIT_DATASOURCES="Ec2, ConfigDrive, OpenStack"
export ELEMENTS_PATH=~/dib/openstack-ansible-ops/elements
# default to ubuntu xenial
export DIB_RELEASE=xenial
export DISTRO_NAME=ubuntu
# set up envars for the deploy image ironic agent
# export DIB_HPSSACLI_URL="http://downloads.hpe.com/pub/softlib2/software1/pubsw-linux/p1857046646/v109216/hpssacli-2.30-6.0.x86_64.rpm"
@ -114,17 +123,15 @@ pushd ~/dib
--protected=True \
--container-format ari < ~/images/ironic-deploy.initramfs"
# Ubuntu Xenial
export DIB_RELEASE=xenial
export DISTRO_NAME=ubuntu
# Ubuntu Xenial final image
make-base-image
# Ubuntu Trusty
# Ubuntu Trusty final image
export DIB_RELEASE=trusty
export DISTRO_NAME=ubuntu
make-base-image
# CentOS 7
# CentOS 7 final image
export DIB_RELEASE=7
export DISTRO_NAME=centos7
make-base-image