Building Guest Images for OpenStack Trove in trove

Bug #1780092 reported by Robert Duncan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
In Progress
Undecided
Tyler Bishop

Bug Description

The Trove documentation for building images with disk image builder is not sufficient for first time users. Much of it is spent documenting disk image builder, for which there is ample documentation already:
https://docs.openstack.org/diskimage-builder/latest/

The parts in the document relating to disk image builder and Trove are vague AT BEST.

I draw your attention to this section:
############################################################################################
This command will create a guest image usable by Trove:

# assign a suitable value for each of these environment
# variables that change the way the elements behave.
export HOST_USERNAME
export HOST_SCP_USERNAME
export GUEST_USERNAME
export CONTROLLER_IP
export TROVESTACK_SCRIPTS
export SERVICE_TYPE
export PATH_TROVE
export ESCAPED_PATH_TROVE
export SSH_DIR
export GUEST_LOGDIR
export ESCAPED_GUEST_LOGDIR
export DIB_CLOUD_INIT_DATASOURCES="ConfigDrive"
export DATASTORE_PKG_LOCATION
export BRANCH_OVERRIDE

# you typically do not have to change these variables
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
local QEMU_IMG_OPTIONS="--qemu-img-options compat=1.1"

# run disk-image-create that actually causes the image to be built
$disk-image-create -a amd64 -o "${VM}" \
    -x ${QEMU_IMG_OPTIONS} ${DISTRO} ${EXTRA_ELEMENTS} vm \
    cloud-init-datasources ${DISTRO}-guest ${DISTRO}-${SERVICE_TYPE}

###############################################################################################

The document never explains what these variables are other than to provide a 'suitable value'
Perhaps if the documentation provided an actual example instead of empty variables we might then be at least guess. it's like - you had one job

This bug tracker is for errors with the documentation, use the following as a template and remove or add fields as you see fit. Convert [ ] into [x] to check boxes:

- [x] This doc is inaccurate in this way: vital information is missing, empty examples, mostly about disk image builder.
- [ ] This is a doc addition request.
- [ ] I have a fix to the document that I can paste below including example: input and output.

If you have a troubleshooting or support issue, use the following resources:

 - Ask OpenStack: http://ask.openstack.org
 - The mailing list: http://lists.openstack.org
 - IRC: 'openstack' channel on Freenode

-----------------------------------
Release: 10.0.0.0b2.dev15 on 2018-07-03 09:08
SHA: f025cf78d0e227cbcc8baec3a2d39a61ac4ac6c9
Source: https://git.openstack.org/cgit/openstack/trove/tree/doc/source/admin/building_guest_images.rst
URL: https://docs.openstack.org/trove/latest/admin/building_guest_images.html

Revision history for this message
Tyler Bishop (tyler-bishop) wrote :

I hear you. I'm working through some of this right now and will submit a set of working defaults that people can at least start with..

Changed in trove:
assignee: nobody → Tyler Bishop (tyler-bishop)
status: New → In Progress
Revision history for this message
alpha23 (alpha23) wrote :

The documentation for building trove images is garbage. How long has trove been an Openstack project?

Revision history for this message
Tyler Bishop (tyler-bishop) wrote :
Revision history for this message
alpha23 (alpha23) wrote :

Tyler,

I saw your post and appreciate it because it was helpful. However, there were a number of modification needed in your post. Additionally, and for anyone reading, the configuration does not appear to work with Ubuntu because only Trusty is supported; it appears that some of the required repositories in the dib elements have been deprecated and therefore the build will fail. The following applies only for the fedora config.

After downloading and installing the latest CentOS image and installing as a standalone vm, at least the following modifications were needed to build the image.

1. The following needed to be installed: qemu-img kpartx yum-utils policycoreutils-python

2. --ignore-installed needed to be added in the 'pip install' command in ./trove/integration/scripts/files/elements/fedora-guest/install.d/15-trove-dep

3. The 'whoami' needs to be commented ./trove/integration/scripts/files/elements/fedora-guest/extra-data.d/62-ssh-key otherwise the sshkeys are not copied. Applies to whether running diskimage-builder as root or with sudo.

4. The 'pip install -r requiremenst.txt' needs to be run from the diskimage-builder directory created in the git clone specified above that command.

5. The sshkeys need to be created in the SSH_DIR. Additionally, it is required that there is an authorized_keys file in the same directory otherwise an error during the build.

6. It would be beneficial to have an explanaton for many of the environment variables and when they are needed.

There may be other modifications needed but the above are the ones I have from my notes.

Even after I built the image, I'm still in the process of figuring out how to get the image working with correctly with trove. Any steps would be very helpful.

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.