I'm trying to build a trove guest image and getting error that "SSH keys were not staged by host"

Bug #1805347 reported by dongdong
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
New
Undecided
Unassigned

Bug Description

Environment variables:
export HOST_USERNAME=root
export HOST_SCP_USERNAME=dddscp
export GUEST_USERNAME=dddguest
export CONTROLLER_IP=10.10.1.16
export TROVESTACK_SCRIPTS=/opt/images/trove-master/integration/scripts
export PATH_DISKIMAGEBUILDER=/usr/lib/python2.7/site-packages/diskimage_builder
export RELEASE=trusty
export DISTRO=ubuntu
export SERVICE_TYPE=mariadb
export PATH_TROVE=/opt/stack/trove
export ESCAPED_PATH_TROVE=$(echo $PATH_TROVE | sed 's/\//\\\//g')
export SSH_DIR="/root"
export GUEST_LOGDIR=/opt/guest/log
export ESCAPED_GUEST_LOGDIR=$(echo $GUEST_LOGDIR | sed 's/\//\\\//g')
export DIB_CLOUD_INIT_DATASOURCES="ConfigDrive"
export DATASTORE_PKG_LOCATION=/opt/datastore
#export BRANCH_OVERRIDE
export ELEMENTS_PATH=$TROVESTACK_SCRIPTS/files/elements
export ELEMENTS_PATH+=:$PATH_DISKIMAGEBUILDER/elements
#export ELEMENTS_PATH+=:$PATH_TRIPLEO_ELEMENTS/elements
export DIB_APT_CONF_DIR=/etc/apt/apt.conf.d
export DIB_CLOUD_INIT_ETC_HOSTS=true

Build command:
disk-image-create -a amd64 -o "/opt/images/ubuntu-mariadb.qcow2" ${DISTRO} ${EXTRA_ELEMENTS} vm cloud-init-datasources ${DISTRO}-guest ${DISTRO}-${SERVICE_TYPE}

Error trace:
2018-11-27 19:12:13.904 | dib-run-parts Running /tmp/in_target.d/install.d/62-ssh-key
2018-11-27 19:12:13.908 | + SSH_DIR=/home/dddguest/.ssh
2018-11-27 19:12:13.908 | + TMP_HOOKS_DIR=/tmp/in_target.d
2018-11-27 19:28:53.910 | + '[' -e /tmp/in_target.d/ssh-authorized-keys ']'
2018-11-27 19:28:53.910 | + echo 'SSH Keys were not staged by host'
2018-11-27 19:28:53.910 | SSH Keys were not staged by host

Analysis:
It's will generate ssh-authorized-keys in ...integration/scripts/files/elements/ubuntu-guest/extra-data.d/62-ssh-key file. And it needs `whoami` = "root", howerer the image has only root(/usr/lib/python2.7/site-packages/diskimage_builder/elements/ubuntu/root.d/10-cache-ubuntu-tarball).

How can I fix this bug?

Revision history for this message
dongdong (dudd) wrote :

I use OpenStack Rocky.

Revision history for this message
dongdong (dudd) wrote :

I comment `whoami` = "root" to skip this condition.

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.