Ask Your Question
1

heat userData is not executed

asked 2014-03-29 03:53:40 -0600

guillaume gravatar image

Hello,

i've deployed Havana openstack with Heat. I can launch stacks but my user_data is not executed during the VM boot.

Here the log from cloud-init :

Cloud-init v. 0.7.2 running 'modules:config' at Fri, 28 Mar 201420:23:05 +0000. Up 36.31 seconds.

Mar 28 20:23:06 localhost cloud-init: Cloud-init v. 0.7.2 running 'modules:final' at Fri, 28 Mar 2014 20:23:06 +0000. Up 36.96 seconds. Mar 28 20:23:06 localhost cloud-init: 2014-03-28 20:23:06,743 - util.py[WARNING]: Failed running /var/lib/cloud/instance/scripts/loguserdata.py

[-] Mar 28 20:23:06 localhost cloud-init: 2014-03-28 20:23:06,753 - cc_scripts_user.py[WARNING]: Failed to run module scripts-user (scripts in /var/lib/cloud/instance/scripts) Mar 28 20:23:06 localhost cloud-init: 2014-03-28 20:23:06,754 - util.py[WARNING]: Running scripts-user (<module 'cloudinit.config.cc_scripts_user'="" from="" '="" usr="" lib="" python2.7="" site-packages="" cloudinit="" config="" cc_scripts_user.pyc'="">) failed Mar 28 20:23:06 localhost cloud-init: Cloud-init v. 0.7.2 finished at Fri, 28 Mar 2014 20:23:06 +0000. Datasource DataSourceEc2. Up 37.42 seconds

As i can see is a problem to execute /var/lib/cloud/instance/scripts/loguserdata.py.

But when i try to launch it after the boot (python /var/lib/cloud/instance/scripts/loguserdata.py) everything is Ok.

Here a extract of my template. I don't have enough point to attach a file.

ApplicationServer:

type: OS::Nova::Server

properties:

  image: { get_param: image_appli }

  flavor: { get_param: flavor }

  key_name: { get_param: key_name }

  networks: ["port": { get_resource: ApplicationServer_port0 }]

  user_data:       

    str_replace:

      template: |

        #!/bin/bash -v

        yum -y install wordpress

        sed -i "/Deny from All/d" /etc/httpd/conf.d/wordpress.conf

        sed -i "s/Require local/Require all granted/" /etc/httpd/conf.d/wordpress.conf

        sed -i "s/database_name_here/%db_name%/" /etc/wordpress/wp-config.php

        sed -i "s/username_here/%db_username%/" /etc/wordpress/wp-config.php

        sed -i "s/password_here/%db_password%/" /etc/wordpress/wp-config.php

        sed -i "s/localhost/%db_host%/" /etc/wordpress/wp-config.php

        setsebool -P httpd_can_network_connect true

        sudo systemctl enable httpd.service

        sudo systemctl start httpd.service

        exit 0

      params:

        "%db_name%": { get_param: db_name }

        "%db_username%": { get_param: db_username }

        "%db_password%": { get_param: db_password }

        "%db_host%": { get_attr: [ DatabaseServer, first_address ]}

Thanks for your help.

edit retag flag offensive close merge delete

Comments

Can you run /var/lib/cloud/instance/scripts/loguserdata.py without the "python" in front of it? Is there something else logged to /var/log/cloud-init.log or /var/log/cloud-init-output.log?

Steve Baker gravatar imageSteve Baker ( 2014-04-13 22:14:56 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-08-05 19:13:22 -0600

asalkeld gravatar image

see: https://bugs.launchpad.net/heat/+bug/...

Tho' I see there is no progress on that issue.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2014-03-29 03:53:40 -0600

Seen: 2,774 times

Last updated: Aug 05 '15