Ask Your Question

OS::Heat::SoftwareDeployment and Image Requirements aka Diskimage builder

asked 2017-01-18 14:06:43 -0500

jidar gravatar image

updated 2017-01-18 14:09:48 -0500

I'm attempting to launch a simple example template found in the Openstack/heat-templates repo, "example-puppet-template.yaml" Example Script Template

What I find is that the tools required to run this are not found inside the default cloud-image for CentOS-7.

I note that the instructions for prepairing a image with both the git repo's "test image" (Found Here) and the Software Deployment "Custom Image Script" (Found Here) both depend on using disk-image-builder.

The Script for diskimage-builder looks like the following, with CentOS7 and puppet:

# Clone the required repositories. Some of these are also available
# via pypi or as distro packages.
git clone
git clone
git clone

# Required by diskimage-builder to discover element collections
export ELEMENTS_PATH=tripleo-image-elements/elements:heat-templates/hot/software-config/elements

# The base operating system element(s) provided by the diskimage-builder
# elements collection. Other values which may work include:
# centos7, debian, opensuse, rhel, rhel7, or ubuntu
export BASE_ELEMENTS="centos7 selinux-permissive"

# Install and configure the os-collect-config agent to poll the metadata
# server (heat service or zaqar message queue and so on) for configuration
# changes to execute
export AGENT_ELEMENTS="os-collect-config os-refresh-config os-apply-config"

# heat-config installs an os-refresh-config script which will invoke the
# appropriate hook to perform configuration. The element heat-config-script
# installs a hook to perform configuration with shell scripts
export DEPLOYMENT_BASE_ELEMENTS="heat-config heat-config-script"

# Install a hook for any other chosen configuration tool(s).
# Elements which install hooks include:
# heat-config-cfn-init, heat-config-puppet, or heat-config-salt
export DEPLOYMENT_TOOL="heat-config-puppet"

# The name of the qcow2 image to create, and the name of the image
# uploaded to the OpenStack image registry.
export IMAGE_NAME=centos-7-software-config

# Create the image
diskimage-builder/bin/disk-image-create vm $BASE_ELEMENTS $AGENT_ELEMENTS \

# Upload the image, assuming valid credentials are already sourced
glance image-create --disk-format qcow2 --container-format bare \
    --name $IMAGE_NAME < $IMAGE_NAME.qcow2

The example from uses virtualenv (which seems entirely unnecessary?) Is there a way to disable that?

So when launching a stack based off the above image created there's a few things that go wrong, the first and foremost is that the application jq is required by os-collect-config to report back to heat (I think?) and looks like the following in the logs:

dib-run-parts Wed Jan 18 19:56:03 UTC 2017 55-heat-config completed
dib-run-parts Wed Jan 18 19:56:03 UTC 2017 ----------------------- PROFILING -----------------------
dib-run-parts Wed Jan 18 19:56:03 UTC 2017
dib-run-parts Wed Jan 18 19:56:03 UTC 2017 Target: configure.d
dib-run-parts Wed Jan 18 19:56:03 UTC 2017
dib-run-parts Wed Jan 18 19:56:03 UTC 2017 Script                                     Seconds
dib-run-parts Wed Jan 18 19:56:03 UTC 2017 ---------------------------------------  ----------
dib-run-parts Wed Jan 18 19:56:03 UTC 2017
dib-run-parts Wed Jan 18 19:56:03 UTC 2017 20-os-apply-config                            0.186
dib-run-parts Wed Jan 18 19:56:03 UTC 2017 55-heat-config                                0.084
dib-run-parts Wed Jan 18 19:56:03 UTC 2017
dib-run-parts Wed Jan 18 19:56:03 UTC 2017 --------------------- END PROFILING ...
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-01-19 02:26:27 -0500

jidar gravatar image

updated 2017-02-11 21:48:17 -0500

This was the fix, apparently epel just isn't enabled by default even when the system needs packages that are only available in epel

$ git diff
diff --git a/elements/centos7/element-deps b/elements/centos7/element-deps
index c6e5925..18aa763 100644
--- a/elements/centos7/element-deps
+++ b/elements/centos7/element-deps
@@ -4,3 +4,4 @@ redhat-common

I'll also note that I was able to discover this upon looking at the yum history of the resulting image from diskimage-builder, it had the following for one of my entries:

# yum history info 3
Loaded plugins: fastestmirror
Transaction ID : 3
Begin time     : Wed Jan 18 19:32:15 2017
Begin rpmdb    : 311:8175ca00eacccb2c0528a9636a1dd2e69ef2317a
End time       :            19:32:31 2017 (16 seconds)
End rpmdb      : 370:3e2b9b5644ed8a7e915fac3288e92ef758b44f9c
User           : Cloud User <centos>
Return-Code    : Success
Command Line   : -v -y install make automake gcc gcc-c++ kernel-devel git traceroute zlib-devel lsof jq libxslt-devel ccache which tcpdump python-devel libxml2-devel

You can see right there it's attempting to install jq and later it will attempt to install puppet but can't, because there's no place to find it. This becomes more apparently when you really take a fine look at the log for diskimage-builder.

After a little more inspection we can see that epel was removed as a dependency for diskimage-builder a few months ago, found here: which obviously breaks stuff now-a-days.

Edit: I'll note that you don't need to modify the elements/centos7/elements-deps file at all, just tack on epel to the diskimage-builder command ie: diskimage-builder/bin/disk-image-create vm {...} epel {...}

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2017-01-18 14:06:43 -0500

Seen: 831 times

Last updated: Feb 11 '17