Heat update - replaced or not?

asked 2020-08-11 04:59:41 -0500

tonda gravatar image

updated 2020-08-12 11:09:39 -0500

Hello, I would like to know, if theres way to tell, which resources will be replaced when running stack update. Mostly interested in knowing behaviour of Nova::server.

For testing ive created stack with 2 vms and immediately ran stack update

 $ openstack stack update -e devci1-env.yaml --wait -t prod_ci/sandbox/tonda_test.yaml tonda_test --timeout 3600 --os-project-id d7ab62d3c3f1415ab99b2d2cb9a8de19 --show-nested --dry-run
+-----------+----------------------------------------------------------------------------------------------------------------+
| Field     | Value                                                                                                          |
+-----------+----------------------------------------------------------------------------------------------------------------+
| added     | []                                                                                                             |
| deleted   | []                                                                                                             |
| replaced  | [                                                                                                              |
|           |   {                                                                                                            |
|           |     "updated_time": null,                                                                                      |
|           |     "creation_time": null,                                                                                     |
|           |     "resource_name": "server_with_volume",                                                                     |
|           |     "physical_resource_id": "",                                                                                |
|           |     "resource_action": "INIT",                                                                                 |
|           |     "resource_status": "COMPLETE",                                                                             |
|           |     "resource_status_reason": "",                                                                              |
|           |     "resource_type": "OS::Nova::Server",                                                                       |
|           |     "resource_identity": {                                                                                     |
|           |       "tenant": "d7ab62d3c3f1415ab99b2d2cb9a8de19",                                                            |
|           |       "stack_name": "tonda_test-tonda-test1",                                                                  |
|           |       "stack_id": "None",                                                                                      |
|           |       "path": "/resources/server_with_volume"                                                                  |
|           |     },                                                                                                         |
|           |     "stack_identity": {                                                                                        |
|           |       "tenant": "d7ab62d3c3f1415ab99b2d2cb9a8de19",                                                            |
|           |       "stack_name": "tonda_test-tonda-test1",                                                                  |
|           |       "stack_id": "None",                                                                                      |
|           |       "path": ""                                                                                               |
|           |     },                                                                                                         |
|           |     "stack_name": "tonda_test-tonda-test1",                                                                    |
|           |     "required_by": [                                                                                           |
|           |       "wait_condition"                                                                                         |
|           |     ],                                                                                                         |
|           |     "parent_resource": "tonda-test1",                                                                          |
|           |     "description": "",                                                                                         |
|           |     "metadata": {},                                                                                            |
|           |     "attributes": {                                                                                            |
|           |       "accessIPv6": null,                                                                                      |
|           |       "name": null,                                                                                            |
|           |       "accessIPv4": null,                                                                                      |
|           |       "tags": null,                                                                                            |
|           |       "instance_name": null,                                                                                   |
|           |       "networks": null,                                                                                        |
|           |       "os_collect_config": null,                                                                               |
|           |       "console_urls": null,                                                                                    |
|           |       "addresses": null,                                                                                       |
|           |       "first_address": null                                                                                    |
|           |     }                                                                                                          |
|           |   },                                                                                                           |
|           |   {                                                                                                            |
|           |     "updated_time": null,                                                                                      |
|           |     "creation_time": null,                                                                                     |
|           |     "resource_name": "wait_condition",                                                                         |
|           |     "physical_resource_id": "",                                                                                |
|           |     "resource_action": "INIT",                                                                                 |
|           |     "resource_status": "COMPLETE",                                                                             |
|           |     "resource_status_reason": "",                                                                              |
|           |     "resource_type": "OS::Heat::WaitCondition",                                                                |
|           |     "resource_identity": {                                                                                     |
|           |       "tenant": "d7ab62d3c3f1415ab99b2d2cb9a8de19",                                                            |
|           |       "stack_name": "tonda_test-tonda-test1",                                                                  |
|           |       "stack_id": "None",                                                                                      |
|           |       "path": "/resources/wait_condition"                                                                      |
|           |     },                                                                                                         |
|           |     "stack_identity": {                                                                                        |
|           |       "tenant": "d7ab62d3c3f1415ab99b2d2cb9a8de19",                                                            |
|           |       "stack_name": "tonda_test-tonda-test1",                                                                  |
|           |       "stack_id": "None",                                                                                      |
|           |       "path": ""                                                                                               |
|           |     },                                                                                                         |
|           |     "stack_name": "tonda_test-tonda-test1",                                                                    |
|           |     "required_by": [],                                                                                         |
|           |     "parent_resource": "tonda-test1",                                                                          |
|           |     "description": "",                                                                                         |
|           |     "metadata": {},                                                                                            |
|           |     "attributes": {                                                                                            |
|           |       "data": "{}"                                                                                             |
|           |     }                                                                                                          |
|           |   },                                                                                                           |
|           |   {                                                                                                            |
|           |     "updated_time": null,                                                                                      |
|           |     "creation_time": null,                                                                                     |
|           |     "resource_name": "default_init",                                                                           |
|           |     "physical_resource_id": "",                                                                                |
|           |     "resource_action": "INIT",                                                                                 |
|           |     "resource_status": "COMPLETE",                                                                             |
|           |     "resource_status_reason": "",                                                                              |
|           |     "resource_type": "OS::Heat::SoftwareConfig",                                                               |
|           |     "resource_identity": {                                                                                     |
|           |       "tenant": "d7ab62d3c3f1415ab99b2d2cb9a8de19",                                                            |
|           |       "stack_name": "tonda_test-tonda-test1-cloud_init",                                                       |
|           |       "stack_id": "None",                                                                                      |
|           |       "path": "/resources/default_init"                                                                        |
|           |     },                                                                                                         |
|           |     "stack_identity": {                                                                                        |
|           |       "tenant": "d7ab62d3c3f1415ab99b2d2cb9a8de19",                                                            |
|           |       "stack_name": "tonda_test-tonda-test1-cloud_init",                                                       |
|           |       "stack_id": "None",                                                                                      |
|           |       "path": ""                                                                                               |
|           |     },                                                                                                         |
|           |     "stack_name": "tonda_test-tonda-test1-cloud_init",                                                         |
|           |     "required_by": [                                                                                           |
|           |       "cloud_init"                                                                                             |
|           |     ],                                                                                                         |
|           |     "parent_resource": "cloud_init",                                                                           |
|           |     "description": "",                                                                                         |
|           |     "metadata": {},                                                                                            |
|           |     "attributes": {                                                                                            |
|           |       "config": null                                                                                           |
|           |     }                                                                                                          |
|           |   },                                                                                                           |
|           |   {                                                                                                            |
|           |     "updated_time": null,                                                                                      |
|           |     "creation_time": null,                                                                                     |
|           |     "resource_name": "cloud_init",                                                                             |
|           |     "physical_resource_id": "",                                                                                |
|           |     "resource_action": "INIT",                                                                                 |
|           |     "resource_status": "COMPLETE",                                                                             |
|           |     "resource_status_reason": "",                                                                              |
|           |     "resource_type": "OS::Heat::MultipartMime",                                                                |
|           |     "resource_identity": {                                                                                     |
|           |       "tenant": "d7ab62d3c3f1415ab99b2d2cb9a8de19",                                                            |
|           |       "stack_name": "tonda_test-tonda-test1-cloud_init",                                                       |
|           |       "stack_id": "None",                                                                                      |
|           |       "path": "/resources/cloud_init"                                                                          |
|           |     },                                                                                                         |
|           |     "stack_identity": {                                                                                        |
|           |       "tenant": "d7ab62d3c3f1415ab99b2d2cb9a8de19",                                                            |
|           |       "stack_name": "tonda_test-tonda-test1-cloud_init",                                                       |
|           |       "stack_id": "None",                                                                                      |
|           |       "path": ""                                                                                               |
|           |     },                                                                                                         |
|           |     "stack_name": "tonda_test-tonda-test1-cloud_init",                                                         |
|           |     "required_by": [],                                                                                         |
|           |     "parent_resource": "cloud_init",                                                                           |
|           |     "description": "",                                                                                         |
|           |     "metadata": {},                                                                                            |
|           |     "attributes": {                                                                                            |
|           |       "config": null                                                                                           |
|           |     }                                                                                                          |
|           |   },                                                                                                           |
|           |   {                                                                                                            |
|           |     "updated_time": null,                                                                                      |
|           |     "creation_time": null,                                                                                     |
|           |     "resource_name": "server_with_volume",                                                                     |
|           |     "physical_resource_id": "",                                                                                |
|           |     "resource_action": "INIT",                                                                                 |
|           |     "resource_status": "COMPLETE",                                                                             |
|           |     "resource_status_reason": "",                                                                              |
|           |     "resource_type": "OS::Nova::Server",                                                                       |
|           |     "resource_identity": {                                                                                     |
|           |       "tenant": "d7ab62d3c3f1415ab99b2d2cb9a8de19",                                                            |
|           |       "stack_name": "tonda_test-tonda-test2",                                                                  |
|           |       "stack_id": "None",                                                                                      |
|           |       "path": "/resources/server_with_volume"                                                                  |
|           |     },                                                                                                         |
|           |     "stack_identity": {                                                                                        |
|           |       "tenant": "d7ab62d3c3f1415ab99b2d2cb9a8de19",                                                            |
|           |       "stack_name": "tonda_test-tonda-test2",                                                                  |
|           |       "stack_id": "None",                                                                                      |
|           |       "path": ""                                                                                               |
|           |     },                                                                                                         |
|           |     "stack_name": "tonda_test-tonda-test2",                                                                    |
|           |     "required_by": [                                                                                           |
|           |       "wait_condition"                                                                                         |
|           |     ],                                                                                                         |
|           |     "parent_resource": "tonda-test2",                                                                          |
|           |     "description": "",                                                                                         |
|           |     "metadata": {},                                                                                            |
|           |     "attributes": {                                                                                            |
|           |       "accessIPv6": null,                                                                                      |
|           |       "name": null,                                                                                            |
|           |       "accessIPv4": null,                                                                                      |
|           |       "tags": null,                                                                                            |
|           |       "instance_name": null,                                                                                   |
|           |       "networks": null,                                                                                        |
|           |       "os_collect_config": null,                                                                               |
|           |       "console_urls": null,                                                                                    |
|           |       "addresses": null,                                                                                       |
|           |       "first_address": null                                                                                    |
|           |     }                                                                                                          |
|           |   },                                                                                                           |
|           |   {                                                                                                            |
|           |     "updated_time": null,                                                                                      |
|           |     "creation_time": null,                                                                                     |
|           |     "resource_name": "wait_condition",                                                                         |
|           |     "physical_resource_id": "",                                                                                |
|           |     "resource_action": "INIT",                                                                                 |
|           |     "resource_status": "COMPLETE",                                                                             |
|           |     "resource_status_reason": "",                                                                              |
|           |     "resource_type": "OS::Heat::WaitCondition",                                                                |
|           |     "resource_identity": {                                                                                     |
|           |       "tenant": "d7ab62d3c3f1415ab99b2d2cb9a8de19",                                                            |
|           |       "stack_name": "tonda_test-tonda-test2",                                                                  |
|           |       "stack_id": "None",                                                                                      |
|           |       "path": "/resources/wait_condition"                                                                      |
|           |     },                                                                                                         |
|           |     "stack_identity": {                                                                                        |
|           |       "tenant": "d7ab62d3c3f1415ab99b2d2cb9a8de19",                                                            |
|           |       "stack_name": "tonda_test-tonda-test2",                                                                  |
|           |       "stack_id": "None",                                                                                      |
|           |       "path": ""                                                                                               |
|           |     },                                                                                                         |
|           |     "stack_name": "tonda_test-tonda-test2",                                                                    |
|           |     "required_by": [],                                                                                         |
|           |     "parent_resource": "tonda-test2",                                                                          |
|           |     "description": "",                                                                                         |
|           |     "metadata": {},                                                                                            |
|           |     "attributes": {                                                                                            |
|           |       "data": "{}"                                                                                             |
|           |     }                                                                                                          |
|           |   },                                                                                                           |
|           |   {                                                                                                            |
|           |     "updated_time": null,                                                                                      |
|           |     "creation_time": null,                                                                                     |
|           |     "resource_name": "default_init",                                                                           |
|           |     "physical_resource_id": "",                                                                                |
|           |     "resource_action": "INIT",                                                                                 |
|           |     "resource_status": "COMPLETE",                                                                             |
|           |     "resource_status_reason": "",                                                                              |
|           |     "resource_type": "OS::Heat::SoftwareConfig",                                                               |
|           |     "resource_identity": {                                                                                     |
|           |       "tenant": "d7ab62d3c3f1415ab99b2d2cb9a8de19",                                                            |
|           |       "stack_name": "tonda_test-tonda-test2-cloud_init",                                                       |
|           |       "stack_id": "None",                                                                                      |
|           |       "path": "/resources/default_init"                                                                        |
|           |     },                                                                                                         |
|           |     "stack_identity": {                                                                                        |
|           |       "tenant": "d7ab62d3c3f1415ab99b2d2cb9a8de19",                                                            |
|           |       "stack_name": "tonda_test-tonda-test2-cloud_init",                                                       |
|           |       "stack_id": "None",                                                                                      |
|           |       "path": ""                                                                                               |
|           |     },                                                                                                         |
|           |     "stack_name": "tonda_test-tonda-test2-cloud_init",                                                         |
|           |     "required_by": [                                                                                           |
|           |       "cloud_init"                                                                                             |
|           |     ],                                                                                                         |
|           |     "parent_resource": "cloud_init",                                                                           |
|           |     "description": "",                                                                                         |
|           |     "metadata": {},                                                                                            |
|           |     "attributes": {                                                                                            |
|           |       "config": null                                                                                           |
|           |     }                                                                                                          |
|           |   },                                                                                                           |
|           |   {                                                                                                            |
|           |     "updated_time": null,                                                                                      |
|           |     "creation_time": null,                                                                                     |
|           |     "resource_name": "cloud_init",                                                                             |
|           |     "physical_resource_id": "",                                                                                |
|           |     "resource_action": "INIT",                                                                                 |
|           |     "resource_status": "COMPLETE",                                                                             |
|           |     "resource_status_reason": "",                                                                              |
|           |     "resource_type": "OS::Heat::MultipartMime",                                                                |
|           |     "resource_identity": {                                                                                     |
|           |       "tenant": "d7ab62d3c3f1415ab99b2d2cb9a8de19",                                                            |
|           |       "stack_name": "tonda_test-tonda-test2-cloud_init",                                                       |
|           |       "stack_id": "None",                                                                                      |
|           |       "path": "/resources/cloud_init"                                                                          |
|           |     },                                                                                                         |
|           |     "stack_identity": {                                                                                        |
|           |       "tenant": "d7ab62d3c3f1415ab99b2d2cb9a8de19",                                                            |
|           |       "stack_name": "tonda_test-tonda-test2-cloud_init",                                                       |
|           |       "stack_id": "None",                                                                                      |
|           |       "path": ""                                                                                               |
|           |     },                                                                                                         |
|           |     "stack_name": "tonda_test-tonda-test2-cloud_init",                                                         |
|           |     "required_by": [],                                                                                         |
|           |     "parent_resource": "cloud_init",                                                                           |
|           |     "description": "",                                                                                         |
|           |     "metadata": {},                                                                                            |
|           |     "attributes": {                                                                                            |
|           |       "config": null                                                                                           |
|           |     }                                                                                                          |
|           |   }                                                                                                            |
|           | ]                                                                                                              |

Why are those resources marked as replaced, even though there are no changes at all? When I run stack update in this state, VMs are not replaced. Update finishes immediately.

When for example I change AZ for those servers, dry run shows the exact same ... (more)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2020-08-12 08:21:03 -0500

zaneb gravatar image

That looks like a bug in the --dry-run output. Unfortunately the dry-run capability had a number of limitations from the start and isn't well maintained. Judging by the fact that it says the resource statuses are INIT_COMPLETE, I suspect that it's failing to even notice the existing resources in the stack. Feel free to raise a bug.

The most accurate way to tell what resources will be replaced is by looking at the documentation for the resource type and checking for each property that might change whether it says "Updates cause replacement".

Obviously it would be ideal if this process could be automated, although it's a surprisingly complex problem - a harmless update of one resource could cause its attributes to change, and if those attributes are referenced by another resource then that could cause the second resource to be replaced. Heat can't tell when attributes are going to change, so the best it could do even in principle is to say that some resources will definitely be replaced, some will not, and some are undetermined (and in practical templates it will be common for many resources to fall in the latter group). And the current output is not rich enough to tell you even that much.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2020-08-11 04:59:41 -0500

Seen: 66 times

Last updated: Aug 12