Heat stack update removes external resource

Bug #1756269 reported by Sami Kärnä
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
Thomas Herve

Bug Description

openstack version: pike 9.03

Given following stack, which has one resource with external_id, the stack update removes the resource every second time. The first update removes the resource and then the second update adds the resource back to the stack.

heat_template_version: pike
description: 'testing external resource'
parameters:
  change_me:
    type: string
    default: change1
  network:
    type: string
    description: UUID of an existing neutron network
    default: a027a807-7f10-4ece-8c50-e09a2c28c378
    constraints:
    - custom_constraint: neutron.network

resources:
  mynet:
    type: OS::Neutron::Net
    external_id: {get_param: network}

outputs:
  mynet:
    description: properties of the external network
    value:
      name: {get_attr: [mynet, name]}

[cloudadmin@controller-1 heat(admin)]$ openstack stack create -t test.yaml --wait test_stack
2018-03-16 07:12:29Z [test_stack]: CREATE_IN_PROGRESS Stack CREATE started
2018-03-16 07:12:30Z [test_stack.mynet]: ADOPT_IN_PROGRESS state changed
2018-03-16 07:12:30Z [test_stack.mynet]: ADOPT_COMPLETE state changed
2018-03-16 07:12:30Z [test_stack.mynet]: CHECK_COMPLETE CHECK not supported for OS::Neutron::Net
2018-03-16 07:12:30Z [test_stack]: CREATE_COMPLETE Stack CREATE completed successfully
+---------------------+--------------------------------------+
| Field | Value |
+---------------------+--------------------------------------+
| id | cce47e1f-145a-4ee3-9514-51775218d5dd |
| stack_name | test_stack |
| description | testing external resource |
| creation_time | 2018-03-16T07:12:28Z |
| updated_time | None |
| stack_status | CREATE_COMPLETE |
| stack_status_reason | Stack CREATE completed successfully |
+---------------------+--------------------------------------+

[cloudadmin@controller-1 heat(admin)]$ openstack stack resource list test_stack
+---------------+--------------------------------------+------------------+-----------------+----------------------+
| resource_name | physical_resource_id | resource_type | resource_status | updated_time |
+---------------+--------------------------------------+------------------+-----------------+----------------------+
| mynet | a027a807-7f10-4ece-8c50-e09a2c28c378 | OS::Neutron::Net | CHECK_COMPLETE | 2018-03-16T07:12:30Z |
+---------------+--------------------------------------+------------------+-----------------+----------------------+

[cloudadmin@controller-1 heat(admin)]$ openstack stack update -t test.yaml --parameter change_me=updated test_stack --wait
2018-03-16 07:23:28Z [test_stack]: UPDATE_IN_PROGRESS Stack UPDATE started
2018-03-16 07:23:28Z [test_stack.mynet]: DELETE_IN_PROGRESS state changed
2018-03-16 07:23:28Z [test_stack.mynet]: DELETE_COMPLETE state changed
2018-03-16 07:23:29Z [test_stack]: UPDATE_COMPLETE Stack UPDATE completed successfully
+---------------------+--------------------------------------+
| Field | Value |
+---------------------+--------------------------------------+
| id | cce47e1f-145a-4ee3-9514-51775218d5dd |
| stack_name | test_stack |
| description | testing external resource |
| creation_time | 2018-03-16T07:12:28Z |
| updated_time | 2018-03-16T07:23:27Z |
| stack_status | UPDATE_COMPLETE |
| stack_status_reason | Stack UPDATE completed successfully |
+---------------------+--------------------------------------+
[cloudadmin@controller-1 heat(admin)]$ openstack stack resource list test_stack

The resource list is empty, although it should show mynet. Also, 'openstack stack show' shows output_value as null.

[cloudadmin@controller-1 heat(admin)]$ openstack stack show test_stack
+-----------------------+-----------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-----------------------+-----------------------------------------------------------------------------------------------------------------------------+
| id | cce47e1f-145a-4ee3-9514-51775218d5dd |
| stack_name | test_stack |
| description | testing external resource |
| creation_time | 2018-03-16T07:12:28Z |
| updated_time | 2018-03-16T07:23:27Z |
| stack_status | UPDATE_COMPLETE |
| stack_status_reason | Stack UPDATE completed successfully |
| parameters | OS::project_id: c15ead6ae28b43a4aa88ca5d62c4d2d5 |
| | OS::stack_id: cce47e1f-145a-4ee3-9514-51775218d5dd |
| | OS::stack_name: test_stack |
| | change_me: updated |
| | network: a027a807-7f10-4ece-8c50-e09a2c28c378 |
| | |
| outputs | - description: properties of the external network |
| | output_key: mynet |
| | output_value: |
| | name: null |
| | |
| links | - href: http://192.168.1.16:8004/v1/c15ead6ae28b43a4aa88ca5d62c4d2d5/stacks/test_stack/cce47e1f-145a-4ee3-9514-51775218d5dd |
| | rel: self |
| | |
| parent | None |
| disable_rollback | True |
| deletion_time | None |
| stack_user_project_id | 8d4d5de167c249df8c15b8fd7ad7adbc |
| capabilities | [] |
| notification_topics | [] |
| stack_owner | None |
| timeout_mins | None |
| tags | None |
+-----------------------+-----------------------------------------------------------------------------------------------------------------------------+

When stack update is run again, the external resource is added back to the stack. It seems that stack update works correctly every second time.

[cloudadmin@controller-1 heat(admin)]$ openstack stack update -t test.yaml --parameter change_me=updated test_stack --wait
2018-03-16 07:24:27Z [test_stack]: UPDATE_IN_PROGRESS Stack UPDATE started
2018-03-16 07:24:27Z [test_stack.mynet]: ADOPT_IN_PROGRESS state changed
2018-03-16 07:24:27Z [test_stack.mynet]: ADOPT_COMPLETE state changed
2018-03-16 07:24:27Z [test_stack.mynet]: CHECK_COMPLETE CHECK not supported for OS::Neutron::Net
2018-03-16 07:24:27Z [test_stack]: UPDATE_COMPLETE Stack UPDATE completed successfully
+---------------------+--------------------------------------+
| Field | Value |
+---------------------+--------------------------------------+
| id | cce47e1f-145a-4ee3-9514-51775218d5dd |
| stack_name | test_stack |
| description | testing external resource |
| creation_time | 2018-03-16T07:12:28Z |
| updated_time | 2018-03-16T07:24:26Z |
| stack_status | UPDATE_COMPLETE |
| stack_status_reason | Stack UPDATE completed successfully |
+---------------------+--------------------------------------+
[cloudadmin@controller-1 heat(admin)]$ openstack stack resource list test_stack
+---------------+--------------------------------------+------------------+-----------------+----------------------+
| resource_name | physical_resource_id | resource_type | resource_status | updated_time |
+---------------+--------------------------------------+------------------+-----------------+----------------------+
| mynet | a027a807-7f10-4ece-8c50-e09a2c28c378 | OS::Neutron::Net | CHECK_COMPLETE | 2018-03-16T07:24:26Z |
+---------------+--------------------------------------+------------------+-----------------+----------------------+
[cloudadmin@controller-1 heat(admin)]$ openstack stack show test_stack
+-----------------------+-----------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-----------------------+-----------------------------------------------------------------------------------------------------------------------------+
| id | cce47e1f-145a-4ee3-9514-51775218d5dd |
| stack_name | test_stack |
| description | testing external resource |
| creation_time | 2018-03-16T07:12:28Z |
| updated_time | 2018-03-16T07:24:26Z |
| stack_status | UPDATE_COMPLETE |
| stack_status_reason | Stack UPDATE completed successfully |
| parameters | OS::project_id: c15ead6ae28b43a4aa88ca5d62c4d2d5 |
| | OS::stack_id: cce47e1f-145a-4ee3-9514-51775218d5dd |
| | OS::stack_name: test_stack |
| | change_me: updated |
| | network: a027a807-7f10-4ece-8c50-e09a2c28c378 |
| | |
| outputs | - description: properties of the external network |
| | output_key: mynet |
| | output_value: |
| | name: testnet |
| | |
| links | - href: http://192.168.1.16:8004/v1/c15ead6ae28b43a4aa88ca5d62c4d2d5/stacks/test_stack/cce47e1f-145a-4ee3-9514-51775218d5dd |
| | rel: self |
| | |
| parent | None |
| disable_rollback | True |
| deletion_time | None |
| stack_user_project_id | 8d4d5de167c249df8c15b8fd7ad7adbc |
| capabilities | [] |
| notification_topics | [] |
| stack_owner | None |
| timeout_mins | None |
| tags | None |
+-----------------------+-----------------------------------------------------------------------------------------------------------------------------+
[cloudadmin@controller-1 heat(admin)]$

Revision history for this message
Thomas Herve (therve) wrote :

Thanks for the detailed reproducer, I was able to see it. Looking at the issue.

Changed in heat:
importance: Undecided → High
assignee: nobody → Thomas Herve (therve)
milestone: none → rocky-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/553723

Changed in heat:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/553723
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=e8f556d6db720e2c11d5aac882118ea812e1964f
Submitter: Zuul
Branch: master

commit e8f556d6db720e2c11d5aac882118ea812e1964f
Author: Thomas Herve <email address hidden>
Date: Fri Mar 16 10:14:50 2018 +0100

    Persist external resources on update

    We were missing a call to update the template for convergence purpose
    when updating an external resource.

    Change-Id: I37e29aaf4110faa00c777c76640be485224720ca
    Closes-Bug: #1756269

Changed in heat:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/557175

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/heat 11.0.0.0b1

This issue was fixed in the openstack/heat 11.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (stable/queens)

Reviewed: https://review.openstack.org/557175
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=e279311ab1907c68af0f27b9f7269990573b8da7
Submitter: Zuul
Branch: stable/queens

commit e279311ab1907c68af0f27b9f7269990573b8da7
Author: Thomas Herve <email address hidden>
Date: Fri Mar 16 10:14:50 2018 +0100

    Persist external resources on update

    We were missing a call to update the template for convergence purpose
    when updating an external resource.

    Change-Id: I37e29aaf4110faa00c777c76640be485224720ca
    Closes-Bug: #1756269
    (cherry picked from commit e8f556d6db720e2c11d5aac882118ea812e1964f)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/heat 10.0.2

This issue was fixed in the openstack/heat 10.0.2 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.