AJNOURI / COA

Openstack Foundation Openstack Certified Administrator exam Preparation
MIT License
45 stars 37 forks source link

Heat: successful stack creation, but nothing happens #53

Closed AJNOURI closed 7 years ago

AJNOURI commented 7 years ago

Environment:


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.


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 |
+---------------+--------------------------------------+-------------------------------------+--------------------+----------------------+
AJNOURI commented 7 years ago

The logs doesn't show any issues:

for log in $(ls /var/log/heat/); do tail /var/log/heat/$log;echo '###'; echo '###' ;done

2017-01-07 08:43:06.406 14763 WARNING oslo_config.cfg [-] Option "rpc_backend" from group "DEFAULT" is deprecated for removal. Its value may be silently ignored in the future. 2017-01-07 08:43:14.356 14763 INFO heat.api.cfn [-] Starting Heat API on 0.0.0.0:8000 2017-01-07 08:43:14.437 14763 WARNING oslo_reports.guru_meditation_report [-] Guru meditation now registers SIGUSR1 and SIGUSR2 by default for backward compatibility. SIGUSR1 will no longer be registered in a future release, so please use SIGUSR2 to generate reports. 2017-01-07 08:43:14.439 14763 INFO heat.common.wsgi [-] Starting single process server 2017-01-07 08:43:14.439 14763 INFO eventlet.wsgi.server [-] (14763) wsgi starting up on http://0.0.0.0:8000

2017-01-07 08:43:12.231 14865 WARNING oslo_config.cfg [-] Option "rpc_backend" from group "DEFAULT" is deprecated for removal. Its value may be silently ignored in the future. 2017-01-07 08:43:18.803 14865 INFO heat.api.cloudwatch [-] Starting Heat CloudWatch API on 0.0.0.0:8003 2017-01-07 08:43:18.804 14865 WARNING oslo_reports.guru_meditation_report [-] Guru meditation now registers SIGUSR1 and SIGUSR2 by default for backward compatibility. SIGUSR1 will no longer be registered in a future release, so please use SIGUSR2 to generate reports. 2017-01-07 08:43:18.846 14865 INFO heat.common.wsgi [-] Starting single process server 2017-01-07 08:43:18.846 14865 INFO eventlet.wsgi.server [-] (14865) wsgi starting up on http://0.0.0.0:8003

2017-01-07 11:36:44.612 14827 INFO eventlet.wsgi.server [req-1e380413-af44-4d94-a6f6-5a99033621d7 6994b730621e4ab1a85dcb4a3088309f 15c30f06d4024134b54e1d3ee284f1ea - default default] 192.168.0.126 - - [07/Jan/2017 11:36:44] "GET /v1/15c30f06d4024134b54e1d3ee284f1ea/stacks HTTP/1.1" 200 762 0.250594 2017-01-07 23:55:12.189 14827 INFO eventlet.wsgi.server [req-3d64537f-cc95-4ff3-85e9-523e1d46825b 6994b730621e4ab1a85dcb4a3088309f 15c30f06d4024134b54e1d3ee284f1ea - default default] 192.168.0.126 - - [07/Jan/2017 23:55:12] "GET /v1/15c30f06d4024134b54e1d3ee284f1ea/stacks/78f1c271-8a27-45fe-a9df-d5be897433c7/events?sort_dir=asc HTTP/1.1" 302 765 0.551890 2017-01-07 23:55:12.281 14827 INFO eventlet.wsgi.server [req-841ebf15-6fed-4015-b50e-159c3139a972 6994b730621e4ab1a85dcb4a3088309f 15c30f06d4024134b54e1d3ee284f1ea - default default] 192.168.0.126 - - [07/Jan/2017 23:55:12] "GET /v1/15c30f06d4024134b54e1d3ee284f1ea/stacks/heat4/78f1c271-8a27-45fe-a9df-d5be897433c7/events?sort_dir=asc HTTP/1.1" 200 1861 0.083596 2017-01-08 00:53:26.226 14827 INFO eventlet.wsgi.server [req-ce235455-6bdb-4ab5-bfb5-91097d63f193 6994b730621e4ab1a85dcb4a3088309f 15c30f06d4024134b54e1d3ee284f1ea - default default] 192.168.0.126 - - [08/Jan/2017 00:53:26] "POST /v1/15c30f06d4024134b54e1d3ee284f1ea/stacks HTTP/1.1" 201 535 2.803833 2017-01-08 00:53:26.345 14827 INFO eventlet.wsgi.server [req-f717514b-4598-4334-a69c-e89d6acf446a 6994b730621e4ab1a85dcb4a3088309f 15c30f06d4024134b54e1d3ee284f1ea - default default] 192.168.0.126 - - [08/Jan/2017 00:53:26] "GET /v1/15c30f06d4024134b54e1d3ee284f1ea/stacks/a16e1347-1ce7-4e4c-ab59-5d8a0f3e9048 HTTP/1.1" 302 705 0.115662 2017-01-08 00:53:26.534 14827 INFO eventlet.wsgi.server [req-91a11473-1260-4d4e-afaf-cd5aed63825e 6994b730621e4ab1a85dcb4a3088309f 15c30f06d4024134b54e1d3ee284f1ea - default default] 192.168.0.126 - - [08/Jan/2017 00:53:26] "GET /v1/15c30f06d4024134b54e1d3ee284f1ea/stacks/heat1/a16e1347-1ce7-4e4c-ab59-5d8a0f3e9048 HTTP/1.1" 200 1066 0.184152 2017-01-08 00:54:30.082 14827 INFO eventlet.wsgi.server [req-fbaa4446-e2e9-4815-81e1-e132bc86985d 6994b730621e4ab1a85dcb4a3088309f 15c30f06d4024134b54e1d3ee284f1ea - default default] 192.168.0.126 - - [08/Jan/2017 00:54:30] "POST /v1/15c30f06d4024134b54e1d3ee284f1ea/stacks HTTP/1.1" 201 535 8.399322 2017-01-08 00:54:30.318 14827 INFO eventlet.wsgi.server [req-b4ff3bf1-6102-4852-95fb-c2080e7d9c9e 6994b730621e4ab1a85dcb4a3088309f 15c30f06d4024134b54e1d3ee284f1ea - default default] 192.168.0.126 - - [08/Jan/2017 00:54:30] "GET /v1/15c30f06d4024134b54e1d3ee284f1ea/stacks/10a767cc-ead3-4643-9555-baa17fbab677 HTTP/1.1" 302 705 0.232278 2017-01-08 00:54:30.530 14827 INFO eventlet.wsgi.server [req-5eaa8a7b-d299-484f-ae5d-0dae343e1698 6994b730621e4ab1a85dcb4a3088309f 15c30f06d4024134b54e1d3ee284f1ea - default default] 192.168.0.126 - - [08/Jan/2017 00:54:30] "GET /v1/15c30f06d4024134b54e1d3ee284f1ea/stacks/heat2/10a767cc-ead3-4643-9555-baa17fbab677 HTTP/1.1" 200 1066 0.207815 2017-01-08 00:54:54.733 14827 INFO eventlet.wsgi.server [req-b814ea12-bb1c-4a80-b9c5-8fccdc1e270f 6994b730621e4ab1a85dcb4a3088309f 15c30f06d4024134b54e1d3ee284f1ea - default default] 192.168.0.126 - - [08/Jan/2017 00:54:54] "GET /v1/15c30f06d4024134b54e1d3ee284f1ea/stacks HTTP/1.1" 200 1823 2.022724

2017-01-08 00:54:22.202 14792 INFO heat.engine.resource [req-fbaa4446-e2e9-4815-81e1-e132bc86985d 6994b730621e4ab1a85dcb4a3088309f 15c30f06d4024134b54e1d3ee284f1ea - - -] Validating Server "instance2" 2017-01-08 00:54:25.186 14792 INFO heat.engine.resource [req-fbaa4446-e2e9-4815-81e1-e132bc86985d 6994b730621e4ab1a85dcb4a3088309f 15c30f06d4024134b54e1d3ee284f1ea - - -] Validating Server "instance1" 2017-01-08 00:54:29.788 14792 INFO heat.engine.stack [req-fbaa4446-e2e9-4815-81e1-e132bc86985d 6994b730621e4ab1a85dcb4a3088309f 15c30f06d4024134b54e1d3ee284f1ea - - -] Stack CREATE IN_PROGRESS (heat2): Stack CREATE started 2017-01-08 00:54:29.998 14792 INFO heat.engine.stack [req-fbaa4446-e2e9-4815-81e1-e132bc86985d 6994b730621e4ab1a85dcb4a3088309f 15c30f06d4024134b54e1d3ee284f1ea - - -] convergence_dependencies: (Dependencies([((10, True), None), ((9, True), None)]),) 2017-01-08 00:54:30.047 14792 INFO heat.engine.stack [req-fbaa4446-e2e9-4815-81e1-e132bc86985d 6994b730621e4ab1a85dcb4a3088309f 15c30f06d4024134b54e1d3ee284f1ea - - -] Triggering resource 9 for update 2017-01-08 00:54:30.051 14792 INFO heat.engine.stack [req-fbaa4446-e2e9-4815-81e1-e132bc86985d 6994b730621e4ab1a85dcb4a3088309f 15c30f06d4024134b54e1d3ee284f1ea - - -] Triggering resource 10 for update 2017-01-08 00:54:30.476 14792 INFO heat.engine.resource [req-fbaa4446-e2e9-4815-81e1-e132bc86985d 6994b730621e4ab1a85dcb4a3088309f 15c30f06d4024134b54e1d3ee284f1ea - - -] creating Server "instance2" Stack "heat2" [10a767cc-ead3-4643-9555-baa17fbab677] 2017-01-08 00:54:30.768 14792 INFO heat.engine.resource [req-fbaa4446-e2e9-4815-81e1-e132bc86985d 6994b730621e4ab1a85dcb4a3088309f 15c30f06d4024134b54e1d3ee284f1ea - - -] creating Server "instance1" Stack "heat2" [10a767cc-ead3-4643-9555-baa17fbab677] 2017-01-08 00:55:09.731 14792 INFO heat.engine.stack [req-fbaa4446-e2e9-4815-81e1-e132bc86985d 6994b730621e4ab1a85dcb4a3088309f 15c30f06d4024134b54e1d3ee284f1ea - - -] [heat2(10a767cc-ead3-4643-9555-baa17fbab677)] update traversal e0fe064c-94fd-47e3-b895-92d11baa0937 complete 2017-01-08 00:55:09.874 14792 INFO heat.engine.stack [req-fbaa4446-e2e9-4815-81e1-e132bc86985d 6994b730621e4ab1a85dcb4a3088309f 15c30f06d4024134b54e1d3ee284f1ea - - -] Stack CREATE COMPLETE (heat2): Stack CREATE completed successfully

AJNOURI commented 7 years ago

As mentioned in openstack forum, the Resources section is completely under the description section, which makes a template with only description. That's why it doesn't show any errors and and resources created!!

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}

Now, this issue passed, need to work on the template itself which gives error.