Ask Your Question
0

Heat: heat create command successfull, but no resources created.

asked 2017-01-07 00:31:03 -0500

updated 2017-01-07 17:54:40 -0500

Environment:

  • VMware VM
  • PackStack installation All-in-one
  • CentOS Linux release 7.3.1611 (Core)

Issue:

Using the following heat template:

heat_template_version: '2016-10-14'
description:
  resources:

    internal_net:
      type: OS::Neutron::Net

    internal_router:
      properties:
        external_gateway_info: {network: public}
      type: OS::Neutron::Router

    internal_subnet:
      properties:
        cidr: 12.8.1.0/24
        dns_nameservers: [8.8.8.8, 8.8.4.4]
        ip_version: 4
        network_id: {get_resource: internal_net}
      type: OS::Neutron::Subnet

    internal_interface:
      type: OS::Neutron::RouterInterface
      properties:
        router_id: {get_resource: internal_router}
        subnet: {get_resource: internal_subnet}

    inst1:
      type: OS::Nova::Server
      properties:
        flavor: m1.tiny
        image: cirros
        interface: {get_param: internal_interface}

The command output shows successful creation (suspiciously fast ~2-3 sec.) of the stack, but no resource has been created:

openstack stack create -t heat4.yml heat4
+---------------------+--------------------------------------------------------------------------------------------------------------------------------+
| Field               | Value                                                                                                                          |
+---------------------+--------------------------------------------------------------------------------------------------------------------------------+
| id                  | 78f1c271-8a27-45fe-a9df-d5be897433c7                                                                                           |
| stack_name          | heat4                                                                                                                          |
| description         | {u'resources': {u'internal_interface': {u'type': u'OS::Neutron::RouterInterface', u'properties': {u'router_id':                |
|                     | {u'get_resource': u'internal_router'}, u'subnet': {u'get_resource': u'internal_subnet'}}}, u'internal_net': {u'type':          |
|                     | u'OS::Neutron::Net'}, u'inst1': {u'type': u'OS::Nova::Server', u'properties': {u'interface': {u'get_param':                    |
|                     | u'internal_interface'}, u'flavor': u'm1.tiny', u'image': u'cirros'}}, u'internal_router': {u'type': u'OS::Neutron::Router',    |
|                     | u'properties': {u'external_gateway_info': {u'network': u'public'}}}, u'internal_subnet': {u'type': u'OS::Neutron::Subnet',     |
|                     | u'properties': {u'ip_version': 4, u'network_id': {u'get_resource': u'internal_net'}, u'cidr': u'12.8.1.0/24',                  |
|                     | u'dns_nameservers': [u'8.8.8.8', u'8.8.4.4']}}}}                                                                               |
| creation_time       | 2017-01-07T10:23:26Z                                                                                                           |
| updated_time        | None                                                                                                                           |
| stack_status        | CREATE_COMPLETE                                                                                                                |
| stack_status_reason | Stack CREATE completed successfully                                                                                            |
+---------------------+--------------------------------------------------------------------------------------------------------------------------------+

 openstack stack list
+--------------------------------------+------------+-----------------+----------------------+--------------+
| ID                                   | Stack Name | Stack Status    | Creation Time        | Updated Time |
+--------------------------------------+------------+-----------------+----------------------+--------------+
| 78f1c271-8a27-45fe-a9df-d5be897433c7 | heat4      | CREATE_COMPLETE | 2017-01-07T10:23:26Z | None         |
+--------------------------------------+------------+-----------------+----------------------+--------------+

None of the resources specified in the template (internal_net, internal_router, internal_subnet and inst1) are there:

for r in network subnet router server; do openstack $r list; done
+--------------------------------------+---------+--------------------------------------+
| ID                                   | Name    | Subnets                              |
+--------------------------------------+---------+--------------------------------------+
| 3bee936e-cd0d-4b0f-9842-9c0d03f0b865 | public  | ce9c604e-436f-4597-8386-97b7b21568b3 |
| cbb57cde-0f8f-467c-8de0-b7b0a7c41a77 | net11   | 7781c4fa-ce29-4bb3-8880-7d775b2af2e6 |
| f74a2c53-0e71-43e3-aeb9-2aeec344f27c | private | 62777bfc-85aa-4aad-97e1-8da1fba4d18b |
+--------------------------------------+---------+--------------------------------------+
+--------------------------------------+----------------+--------------------------------------+-----------------+
| ID                                   | Name           | Network                              | Subnet          |
+--------------------------------------+----------------+--------------------------------------+-----------------+
| 62777bfc-85aa-4aad-97e1-8da1fba4d18b | private_subnet | f74a2c53-0e71-43e3-aeb9-2aeec344f27c | 10.0.0.0/24     |
| 7781c4fa-ce29-4bb3-8880-7d775b2af2e6 | sunet11        | cbb57cde-0f8f-467c-8de0-b7b0a7c41a77 | 11.0.0.0/24     |
| ce9c604e-436f-4597-8386-97b7b21568b3 | public_subnet  | 3bee936e-cd0d-4b0f-9842-9c0d03f0b865 | 172.24.4.224/28 |
+--------------------------------------+----------------+--------------------------------------+-----------------+
+--------------------------------------+---------+--------+-------+-------------+-------+----------------------------------+
| ID                                   | Name    | Status | State | Distributed | HA    | Project                          |
+--------------------------------------+---------+--------+-------+-------------+-------+----------------------------------+
| 6ea24c8b-fa6b-440e-9573-be29d24da69c | router2 | ACTIVE | UP    | False       | False | 11d2ce4715634f85829773e7b55ba33a |
| 89b1d1e2-d93f-469b-84f4-e7e26989c58d | router1 | ACTIVE | UP    | False       | False | 3e940df3cde948188608a1003ba54014 |
+--------------------------------------+---------+--------+-------+-------------+-------+----------------------------------+

Works fine with very basic template.

Any hint?


heat event-list 78f1c271-8a27-45fe-a9df-d5be897433c7
WARNING (shell) "heat event-list" is deprecated, please use "openstack stack event list" instead
+---------------+--------------------------------------+-------------------------------------+--------------------+----------------------+
| resource_name | id                                   | resource_status_reason              | resource_status    | event_time           |
+---------------+--------------------------------------+-------------------------------------+--------------------+----------------------+
| heat4         | 0e97760b-d7e9-4a24-9c7d-958c34e08e1e | Stack CREATE started                | CREATE_IN_PROGRESS | 2017-01-07T10:23:27Z |
| heat4         | 3c059856-baf0-4abe-bd02-9e2fc80704ab | Stack CREATE completed successfully | CREATE_COMPLETE    | 2017-01-07T10:23:27Z |
+---------------+--------------------------------------+-------------------------------------+--------------------+----------------------+
edit retag flag offensive close merge delete

Comments

check what resources and in which state are each one with heat event-list <stack-id>

Eduardo Gonzalez gravatar imageEduardo Gonzalez ( 2017-01-07 10:42:30 -0500 )edit

Eduardo, Thanks for yout reply. I added the output of event-list to the original post

AJ NOURI gravatar imageAJ NOURI ( 2017-01-07 12:41:40 -0500 )edit

not sure if order is important, but often, type goes before properties. Ex:

resources:
  my_instance:
    type: OS::Nova::Server
    properties:
      key_name: my_key
Eduardo Gonzalez gravatar imageEduardo Gonzalez ( 2017-01-07 13:59:42 -0500 )edit

Using this trivial template, tested with different orders, it doesn't matter.

heat_template_version: 2015-04-30

resources:
  heat-i2:
    properties:
      flavor: m1.tiny
      image: cirros-0.3.4-x86_64 
      key_name: kp3
    type: OS::Nova::Server
AJ NOURI gravatar imageAJ NOURI ( 2017-01-07 15:40:38 -0500 )edit

Can you check logs from heat engine and api, maybe there is a hint (auth issue, connection problem, wrong config). At the first glance heat api seems to work as commands and db connections are working, so probably there is something wrong in heat engine. Also, output from event-list is not posted ;)

Eduardo Gonzalez gravatar imageEduardo Gonzalez ( 2017-01-07 16:05:34 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
3

answered 2017-01-09 10:15:53 -0500

zaneb gravatar image

The problem is your indentation. All of the resources are inside the description section, which is why they show up in the description field when creating the stack. resources should be a top-level key (the description is for you to add a written description of what the template is for). Ordering of keys is a dict is not significant.

edit flag offensive delete link more

Comments

Yeah, good catch!

Eduardo Gonzalez gravatar imageEduardo Gonzalez ( 2017-01-09 11:04:34 -0500 )edit

Thanks Zaneb, that explains it! (passed that, now I work on the template itself)

AJ NOURI gravatar imageAJ NOURI ( 2017-01-09 19:57:00 -0500 )edit

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

1 follower

Stats

Asked: 2017-01-07 00:31:03 -0500

Seen: 227 times

Last updated: Jan 09 '17