[Openstack] [Heat] Error - Template not in valid format

Therese Persson therese.persson at ericsson.com
Mon Nov 11 14:59:05 UTC 2013


Thank you Steve, this solved my problem.
Heat works fine for me with the following information in my files:


In my heat.conf file:



[DEFAULT]

connection = mysql://heat:heat@10.10.10.51/heat<mailto:mysql://heat:heat@10.10.10.51/heat>



[keystone_authtoken]

auth_host = 10.10.10.51

auth_uri = http://10.10.10.51:35357/v2.0

auth_port = 35357

auth_protocol = http

admin_tenant_name = service

admin_user = heat

admin_password = heat



In my /etc/heat/api-paste.conf file:


# Auth middleware that validates token against keystone

[filter:authtoken]

paste.filter_factory = heat.common.auth_token:filter_factory

auth_uri = http://10.10.10.51:35357/v2.0

Where auth_uri is the endpoint for keystone.

Best regards
Therese


From: Steve Baker [mailto:sbaker at redhat.com]
Sent: den 10 november 2013 22:02
To: openstack at lists.openstack.org
Subject: Re: [Openstack] [Heat] Error - Template not in valid format

On 11/01/2013 09:35 PM, Therese Persson wrote:

Thank you for your answer Angus.



I tried to remove the parameters from the file as you suggested and tried to create a stack with horizon, but I seem to have an authorization problem.
...




In my heat.conf file:



[DEFAULT]

connection = mysql://heat:heat@10.10.10.51/heat<mailto:mysql://heat:heat@10.10.10.51/heat>



(Everything else is commented out.)



In my /etc/heat/api-paste.conf file:
...




# Auth middleware that validates token against keystone

[filter:authtoken]

paste.filter_factory = heat.common.auth_token:filter_factory

auth_host = 10.10.10.51

auth_port = 35357

auth_protocol = http

admin_tenant_name = service

admin_user = heat

admin_password = heat
This section is missing auth_uri, as per this doc fix:
https://review.openstack.org/#/c/55020/

As an aside, these values should not be set at all in api-paste.ini, but instead they should be set in heat.conf, section [keystone_authtoken]







-----Original Message-----

From: Angus Salkeld [mailto:asalkeld at redhat.com]

Sent: den 1 november 2013 00:52

To: openstack at lists.openstack.org<mailto:openstack at lists.openstack.org>

Subject: Re: [Openstack] [Heat] Error - Template not in valid format



On 31/10/13 15:17 +0000, Therese Persson wrote:

Hi,



I have recently upgraded to Havana and just started trying out Heat. I tried to launch a stack by using this template file:

https://github.com/openstack/heat-templates/blob/master/hot/servers_in_

existing_neutron_net.yaml



However, I am not familiar with these type of files and I am not sure of what information I should add to the file to make it valid for Heat.

This is what my modified file looks like:



Hi Therese,



It's just yaml, so I sometimes head over to http://yaml-online-parser.appspot.com/ and dump my template in there and tells you what is wrong.



Basically you are putting your parameter values in the wrong place.



instead of:

parameters:

   key_name: mykey

     type: string

     description: Name of keypair to assign to servers remove the "mykey" so it is back to:



parameters:

   key_name:

     type: string

     description: Name of keypair to assign to servers





Then start the template like this:



heat stack-create mystack --template-file=/scripts/servers_in_existing_neutron_net.yaml -P "key_name=mykey;image=Ubuntu;flavor=m1.small"



Hope that helps

-Angus





heat_template_version: 2013-05-23



description: >

 HOT template to deploy two servers into an existing neutron tenant

network and

 assign floating IP addresses to each server so they are routable from

the

 public network.



parameters:

 key_name: mykey

   type: string

   description: Name of keypair to assign to servers

 image: Ubuntu

   type: string

   description: Name of image to use for servers

 flavor: m1.small

   type: string

   description: Flavor to use for servers

 public_net_id: 55896cd0-040a-4e7b-8a92-cb27f32b4ad9

   type: string

   description: >

     ID of public network for which floating IP addresses will be

allocated

 private_net_id: 3bd4e56f-1e8c-4316-8e59-a358016e9ef8

   type: string

   description: ID of private network into which servers get deployed

 private_subnet_id: f4bac2ea-b74d-47ef-a8b3-5969d60bfbba

   type: string

   description: ID of private sub network into which servers get

deployed



resources:

 server1:

   type: OS::Nova::Server

   properties:

     name: Server1

     image: { get_param: image }

     flavor: { get_param: flavor }

     key_name: { get_param: key_name }

     networks:

       - port: { get_resource: server1_port }



 server1_port:

   type: OS::Neutron::Port

   properties:

     network_id: { get_param: private_net_id }

     fixed_ips:

       - subnet_id: { get_param: private_subnet_id }



 server1_floating_ip:

   type: OS::Neutron::FloatingIP

   properties:

     floating_network_id: { get_param: public_net_id }

     port_id: { get_resource: server1_port }



 server2:

   type: OS::Nova::Server

   properties:

     name: Server2

     image: { get_param: image }

     flavor: { get_param: flavor }

     key_name: { get_param: key_name }

     networks:

       - port: { get_resource: server2_port }



 server2_port:

   type: OS::Neutron::Port

   properties:

     network_id: { get_param: private_net_id }

     fixed_ips:

       - subnet_id: { get_param: private_subnet_id }



 server2_floating_ip:

   type: OS::Neutron::FloatingIP

   properties:

     floating_network_id: { get_param: public_net_id }

     port_id: { get_resource: server2_port }



outputs:

 server1_private_ip:

   description: IP address of server1 in private network

   value: { get_attr: [ server1, first_address ] }

 server1_public_ip:

   description: Floating IP address of server1 in public network

   value: { get_attr: [ server1_floating_ip, floating_ip_address ] }

 server2_private_ip:

   description: IP address of server2 in private network

   value: { get_attr: [ server2, first_address ] }

 server2_public_ip:

   description: Floating IP address of server2 in public network

   value: { get_attr: [ server2_floating_ip, floating_ip_address ] }





When I try to run the command:

heat stack-create mystack

--template-file=/scripts/servers_in_existing_neutron_net.yaml



I get the following error:

ERROR: Template not in valid format





Any ideas?



Therese



_______________________________________________

Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack

Post to     : openstack at lists.openstack.org<mailto:openstack at lists.openstack.org>

Unsubscribe :

http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack





_______________________________________________

Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack

Post to     : openstack at lists.openstack.org<mailto:openstack at lists.openstack.org>

Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack



_______________________________________________

Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack

Post to     : openstack at lists.openstack.org<mailto:openstack at lists.openstack.org>

Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20131111/81549e14/attachment.html>


More information about the Openstack mailing list