[Openstack] [Heat] Error - Template not in valid format
Angus Salkeld
asalkeld at redhat.com
Thu Oct 31 23:52:02 UTC 2013
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
>Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
More information about the Openstack
mailing list