Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Heat doesn't recreate deleted resource on stack update

If I start a stack that creates a Keystone user, then manually delete the user, and then update the stack, the user will not be recreated. Is this expected behaivor? Isn't Heat supposed to recreate resource when stack update operation is run.

Here is an example. Notice at the end that the stack is in UPDATE_COMPLETE status, but the user was not created.

root@server1:~# cat s1.yaml
heat_template_version: pike
description: Template 1
resources:
  r1:
    type: OS::Keystone::User
    properties:
      description: Desc 5
      name: u1
      password: p2

root@server1:~# openstack stack create s1 -t s1.yaml
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| id                  | 011eb0c9-cf51-4dc9-a97b-238f098800c3 |
| stack_name          | s1                                   |
| description         | Template 1                           |
| creation_time       | 2017-10-13T10:28:26Z                 |
| updated_time        | None                                 |
| stack_status        | CREATE_IN_PROGRESS                   |
| stack_status_reason | Stack CREATE started                 |
+---------------------+--------------------------------------+
root@server1:~# openstack stack list
+--------------------------------------+------------+----------------------------------+-----------------+----------------------+--------------+
| ID                                   | Stack Name | Project                          | Stack Status    | Creation Time        | Updated Time |
+--------------------------------------+------------+----------------------------------+-----------------+----------------------+--------------+
| 011eb0c9-cf51-4dc9-a97b-238f098800c3 | s1         | 24383c68b68b4b838ee778c52459601f | CREATE_COMPLETE | 2017-10-13T10:28:26Z | None         |
+--------------------------------------+------------+----------------------------------+-----------------+----------------------+--------------+
root@server1:~# openstack user list | grep u1
| 73dc60ea185148cca5275f0bb1ab6e2e | u1    |
root@server1:~# openstack user delete u1
root@server1:~# openstack stack update s1 -t s1.yaml
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| id                  | 011eb0c9-cf51-4dc9-a97b-238f098800c3 |
| stack_name          | s1                                   |
| description         | Template 1                           |
| creation_time       | 2017-10-13T10:28:26Z                 |
| updated_time        | 2017-10-13T10:29:23Z                 |
| stack_status        | UPDATE_IN_PROGRESS                   |
| stack_status_reason | Stack UPDATE started                 |
+---------------------+--------------------------------------+
root@server1:~# openstack stack list
+--------------------------------------+------------+----------------------------------+-----------------+----------------------+----------------------+
| ID                                   | Stack Name | Project                          | Stack Status    | Creation Time        | Updated Time         |
+--------------------------------------+------------+----------------------------------+-----------------+----------------------+----------------------+
| 011eb0c9-cf51-4dc9-a97b-238f098800c3 | s1         | 24383c68b68b4b838ee778c52459601f | UPDATE_COMPLETE | 2017-10-13T10:28:26Z | 2017-10-13T10:29:23Z |
+--------------------------------------+------------+----------------------------------+-----------------+----------------------+----------------------+
root@server1:~# openstack user list | grep u1
root@server1:~#