What Linux distribution versions does openstack support with heat?

asked 2014-09-16 04:25:05 -0600

I've set up an openstack host on RHEL 6. I want to run VMs of RHEL 5.

I can spin up instances without any problem, but using heat templates doesn't work. As soon as I add a user_data script:

    type: OS::Nova::Server
          template: |
            #!/bin/bash -v

            echo 'hello'

My script does not end up running. /var/log/cloud-init-output.log shows:

  File "/var/lib/cloud/instance/scripts/loguserdata.py", line 39
    os.chmod(fh.baseFilename, 0o600)
SyntaxError: invalid syntax
/var/lib/cloud/instance/scripts/loguserdata.py failed; code 1
2014-09-16 10:19:47,655 - cc_scripts_user.py[WARNING]: failed to run-parts in /var/lib/cloud/instance/scripts
2014-09-16 10:19:47,879 - __init__.py[WARNING]: Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/cloudinit/CloudConfig/__init__.py", line 118, in run_cc_modules
    cc.handle(name, run_args, freq=freq)
  File "/usr/lib/python2.6/site-packages/cloudinit/CloudConfig/__init__.py", line 79, in handle
    [name, self.cfg, self.cloud, cloudinit.log, args])
  File "/usr/lib/python2.6/site-packages/cloudinit/__init__.py", line 324, in sem_and_run
  File "/usr/lib/python2.6/site-packages/cloudinit/CloudConfig/cc_scripts_user.py", line 31, in handle
  File "/usr/lib/python2.6/site-packages/cloudinit/util.py", line 222, in runparts
    raise RuntimeError('runparts: %i failures' % failed)
RuntimeError: runparts: 1 failures

2014-09-16 10:19:47,879 - __init__.py[ERROR]: config handling of scripts-user, None, [] failed

2014-09-16 10:19:48,332 - cloud-init-cfg[ERROR]: errors running cloud_config [final]: ['scripts-user']
errors running cloud_config [final]: ['scripts-user']

This looks like heat is trying to run loguserdata.py, but loguserdata.py contains syntax that requires Python 2.6 or later. RHEL 5 has Python 2.4 as its default Python version (and yum depends upon this).

Can I use heat on RHEL 5? Is there are list of supported distributions anywhere?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2014-09-16 09:36:32 -0600

larsks gravatar image

By default, Heat wraps your user_data in a multipart MIME archive containing a variety of other Heat-specific data. You can inhibit this behavior by adding the user_data_format key, like this:

type: OS::Nova::Server
  user_data_format: RAW
      template: |
        #!/bin/bash -v

        echo 'hello'

With user_data_format: RAW, the user_data in your template will be pased verbatim to cloud-init.

edit flag offensive delete link more


Yes, larsks is correct here, RAW should help you run any user_data

Steve Baker gravatar imageSteve Baker ( 2014-09-18 22:21:25 -0600 )edit

answered 2014-09-30 10:44:45 -0600

This looks like a Heat bug. I've filed a bug upstream: https://bugs.launchpad.net/heat/+bug/1375864 (https://bugs.launchpad.net/heat/+bug/...) with a suggested solution.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2014-09-16 04:23:46 -0600

Seen: 311 times

Last updated: Sep 30 '14