How to solve error 'Non-empty resource type is required for resource' with heat template

asked 2014-09-02 05:17:01 -0600

spradeepv gravatar image

I am trying to get familiar with the use of cloud-config in heat template. I decided to install wordpress using heat template. Following is the user data which is passed to Nova server instance :

    type: OS::Heat::CloudConfig
         - apache2
         - php5
         - php5-mysql
         - mysql-server
         - wget -P /tmp/
         - tar zxf /tmp/latest.tar.gz -C /var/www/
         - cp /var/www/wordpress/wp-config-sample.php /var/www/wordpress/wp-config.php 
         - sed -e 's/database_name_here/wordpress/' -e 's/username_here/wpuser/' -e 's/password_here/password/' /var/www/wordpress/wp-config.php
         - grep -q -F '' /etc/php5/apache2/php.ini || echo '' >> /etc/php5/apache2/php.ini
         - mysql -uroot -ppassword -e "create database wordpress; create user 'wpuser'@'localhost' identified by 'password'; grant all privileges on wordpress . \* ro 'wpuser'@localhost'; flush privileges"
         - mysql -uroot -ppassword -e "drop database test; drop user 'test'@'localhost'; flush privileges"
         - mysqladmin -u root password 'password'

    type: OS::Nova::Server
      image: {get_param: image}
      flavor: {get_param: flavor}
      key_name: {get_param: key_name}
      user_data_format: RAW
        get_resource: server_init

I get the following error while creating a stack:

"Non-empty resource type is required for resource server_init"

What is the problem with the template?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-09-21 21:11:39 -0600

Steve Baker gravatar image

You used an upper case R for Resources, but lower case for type and properties

I recommend having your template header be heat_template_version: 2013-05-23 following the HOT format, including a lower-case 'resources' section. Please follow the format described in the spec:

edit flag offensive delete link more


Thank You, Steve. I will check out the spec and will let you know how it goes.

spradeepv gravatar imagespradeepv ( 2014-09-23 07:44:34 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2014-09-02 05:17:01 -0600

Seen: 184 times

Last updated: Sep 21 '14