Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OS::Heat::SoftwareDeployment and Xenial (16.04) custom image

Dears,

there is a problem with Ubuntu 16.04 (Xenial) custom image for Heat. Everything built accordingly to http://docs.openstack.org/developer/heat/template_guide/software_deployment.html#custom-image-script and while it works fine with Ubuntu 14.04 (DIB_RELEASE=trusty), it fails with Ubuntu 16.04 (DIB_RELEASE=xenial).

ubuntu@adb1:~$ sudo os-collect-config --force --one-time --debug
[ ... ]
dib-run-parts Sat Feb 11 22:57:31 EET 2017 20-os-apply-config completed
dib-run-parts Sat Feb 11 22:57:31 EET 2017 Running /usr/libexec/os-refresh-config/configure.d/55-heat-config
Traceback (most recent call last):
  File "/usr/libexec/os-refresh-config/configure.d/55-heat-config", line 23, in <module>
    import requests
ImportError: No module named requests

ubuntu@adb1:~$ sudo -H pip install requests
Requirement already satisfied: requests in /usr/local/lib/python3.5/dist-packages

ubuntu@adb1:~$ cat /usr/libexec/os-refresh-config/configure.d/55-heat-config
#!/usr/bin/env python
#
[ ... ]

ubuntu@adb1:~$ /usr/bin/env python
Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
>>> import requests
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named requests

Under 14.04 (Trusty) module "requests" is available for python2 and 55-heat-config works without issues. Under 16.04 (Xenial) module "requests" isn't available in default distribution for python2 and, thus, 55-heat-config doesn't work.

Any ideas on why this happen and how to fix this?

Script I use to build image follows:

#!/bin/sh

# Clone the required repositories. Some of these are also available
# via pypi or as distro packages.
git clone https://git.openstack.org/openstack/diskimage-builder
git clone https://git.openstack.org/openstack/tripleo-image-elements.git
git clone https://git.openstack.org/openstack/heat-templates.git
git clone https://git.openstack.org/openstack/dib-utils

export PATH=$(pwd)/diskimage-builder/bin:$(pwd)/dib-utils/bin:$PATH

# 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="ubuntu 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=""

# The name of the qcow2 image to create, and the name of the image
# uploaded to the OpenStack image registry.
export DIB_RELEASE=xenial
export IMAGE_NAME=ubuntu-${DIB_RELEASE}-heat

# Create the image
diskimage-builder/bin/disk-image-create --mkfs-options '-i 16384' --no-tmpfs vm $BASE_ELEMENTS $AGENT_ELEMENTS \
        $DEPLOYMENT_BASE_ELEMENTS $DEPLOYMENT_TOOL -o $IMAGE_NAME.qcow2

Thank you!

OS::Heat::SoftwareDeployment and Xenial (16.04) custom image

Dears,

there is a problem with Ubuntu 16.04 (Xenial) custom image for Heat. Everything built accordingly to http://docs.openstack.org/developer/heat/template_guide/software_deployment.html#custom-image-script and while it works fine with Ubuntu 14.04 (DIB_RELEASE=trusty), it fails with Ubuntu 16.04 (DIB_RELEASE=xenial).

Screenshot from VM:

ubuntu@adb1:~$ sudo os-collect-config --force --one-time --debug
[ ... ]
dib-run-parts Sat Feb 11 22:57:31 EET 2017 20-os-apply-config completed
dib-run-parts Sat Feb 11 22:57:31 EET 2017 Running /usr/libexec/os-refresh-config/configure.d/55-heat-config
Traceback (most recent call last):
  File "/usr/libexec/os-refresh-config/configure.d/55-heat-config", line 23, in <module>
    import requests
ImportError: No module named requests

ubuntu@adb1:~$ sudo -H pip install requests
Requirement already satisfied: requests in /usr/local/lib/python3.5/dist-packages

ubuntu@adb1:~$ cat /usr/libexec/os-refresh-config/configure.d/55-heat-config
#!/usr/bin/env python
#
[ ... ]

ubuntu@adb1:~$ /usr/bin/env python
Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
>>> import requests
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named requests

Under 14.04 (Trusty) module "requests" is available for python2 and 55-heat-config works without issues. Under 16.04 (Xenial) module "requests" isn't available in default distribution for python2 and, thus, 55-heat-config doesn't work.

Any ideas on why this happen and how to fix this?

Script I use to build image (I'm doing this under 16.04.2 LTS) follows:

#!/bin/sh

# Clone the required repositories. Some of these are also available
# via pypi or as distro packages.
git clone https://git.openstack.org/openstack/diskimage-builder
git clone https://git.openstack.org/openstack/tripleo-image-elements.git
git clone https://git.openstack.org/openstack/heat-templates.git
git clone https://git.openstack.org/openstack/dib-utils

export PATH=$(pwd)/diskimage-builder/bin:$(pwd)/dib-utils/bin:$PATH

# 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="ubuntu 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=""

# The name of the qcow2 image to create, and the name of the image
# uploaded to the OpenStack image registry.
export DIB_RELEASE=xenial
export IMAGE_NAME=ubuntu-${DIB_RELEASE}-heat

# Create the image
diskimage-builder/bin/disk-image-create --mkfs-options '-i 16384' --no-tmpfs vm $BASE_ELEMENTS $AGENT_ELEMENTS \
        $DEPLOYMENT_BASE_ELEMENTS $DEPLOYMENT_TOOL -o $IMAGE_NAME.qcow2

Thank you!

OS::Heat::SoftwareDeployment and Xenial (16.04) custom image

Dears,

there is a problem with Ubuntu 16.04 (Xenial) custom image for Heat. Everything built accordingly to http://docs.openstack.org/developer/heat/template_guide/software_deployment.html#custom-image-script and while it works fine with Ubuntu 14.04 (DIB_RELEASE=trusty), it fails with Ubuntu 16.04 (DIB_RELEASE=xenial).

Screenshot from VM:

ubuntu@adb1:~$ sudo os-collect-config --force --one-time --debug
[ ... ]
dib-run-parts Sat Feb 11 22:57:31 EET 2017 20-os-apply-config completed
dib-run-parts Sat Feb 11 22:57:31 EET 2017 Running /usr/libexec/os-refresh-config/configure.d/55-heat-config
Traceback (most recent call last):
  File "/usr/libexec/os-refresh-config/configure.d/55-heat-config", line 23, in <module>
    import requests
ImportError: No module named requests

ubuntu@adb1:~$ sudo -H pip install requests
Requirement already satisfied: requests in /usr/local/lib/python3.5/dist-packages

ubuntu@adb1:~$ cat /usr/libexec/os-refresh-config/configure.d/55-heat-config
#!/usr/bin/env python
#
[ ... ]

ubuntu@adb1:~$ /usr/bin/env python
Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
>>> import requests
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named requests

Under On 14.04 (Trusty) module "requests" is available for python2 and 55-heat-config works without issues. Under On 16.04 (Xenial) module "requests" isn't available in default distribution for python2 and, thus, 55-heat-config doesn't work.

Any ideas on why this happen and how to fix this?

Script I use to build image (I'm doing this under 16.04.2 LTS) follows:

#!/bin/sh

# Clone the required repositories. Some of these are also available
# via pypi or as distro packages.
git clone https://git.openstack.org/openstack/diskimage-builder
git clone https://git.openstack.org/openstack/tripleo-image-elements.git
git clone https://git.openstack.org/openstack/heat-templates.git
git clone https://git.openstack.org/openstack/dib-utils

export PATH=$(pwd)/diskimage-builder/bin:$(pwd)/dib-utils/bin:$PATH

# 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="ubuntu 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=""

# The name of the qcow2 image to create, and the name of the image
# uploaded to the OpenStack image registry.
export DIB_RELEASE=xenial
export IMAGE_NAME=ubuntu-${DIB_RELEASE}-heat

# Create the image
diskimage-builder/bin/disk-image-create --mkfs-options '-i 16384' --no-tmpfs vm $BASE_ELEMENTS $AGENT_ELEMENTS \
        $DEPLOYMENT_BASE_ELEMENTS $DEPLOYMENT_TOOL -o $IMAGE_NAME.qcow2

Thank you!