Use config replace_on_change flag to decide whether to replace a deployment resource

Bug #1595040 reported by Steve Baker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Wishlist
Zane Bitter

Bug Description

As per the results of the following work session:
https://etherpad.openstack.org/p/heat-newton-sd-refinents

The inputs schema for the following config resources will gain a
'replace_on_change' boolean property:

- http://docs.openstack.org/developer/heat/template_guide/openstack.html#OS::Heat::SoftwareConfig-prop-inputs-*
- http://docs.openstack.org/developer/heat/template_guide/openstack.html#OS::Heat::SoftwareComponent-prop-inputs-*
- http://docs.openstack.org/developer/heat/template_guide/openstack.html#OS::Heat::StructuredConfig-prop-inputs-*

When a deployment resource has an input value which changes during a stack
update, it will trigger resource replacement if the input from the config has
replace_on_change:true.

When the config/deployment represents a self-contained scalable service (such
as a containerized service), replace_on_change can be used to bring up a new
service version before removing the old one.

An example usage would look something like this:

resources:
     backend_component:
       type: OS::Heat::SoftwareComponent
       update_policy: inputs_replacing: [DEPLOY_VERSION] #Option 3
       properties:
         configs:
           - tool: script
             actions:
               - CREATE
               - UPDATE
             config: |
               PORT=$(get_backend_port || random_port)
               stop_backend
               start_backend $DEPLOY_VERSION $PORT $CONFIG
               addr="$(hostname):$(get_backend_port)"
               printf '%s' "$addr" >${heat_outputs_path}.host_and_port
           - tool: script
             actions:
               - DELETE
             config: |
                stop_backend
          inputs:
            - name: DEPLOY_VERSION
              replace_on_change: true # backend resource will be replaced when this changes
            - name: CONFIG
          outputs:
            - name: host_and_port

     backend:
       type: OS::Heat::SoftwareDeployment
       properties:
         server: {get_resource: backend_server}
         name: {get_param: backend_version} # Forces upgrade replacement
         actions: [CREATE, UPDATE, DELETE]
         config: {get_resource: backend_component}
         input_values:
           DEPLOY_VERSION: {get_param: backend_version} # changing this will result in backend replacement
           CONFIG: {get_param: backend_config} # changing this will result in existing resource being updated in-place

Tags: spec-lite
Changed in heat:
milestone: none → newton-2
Changed in heat:
status: New → In Progress
Thomas Herve (therve)
Changed in heat:
milestone: newton-2 → newton-3
Zane Bitter (zaneb)
Changed in heat:
assignee: Steve Baker (steve-stevebaker) → Zane Bitter (zaneb)
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/352605

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

Reviewed: https://review.openstack.org/352605
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=285802bdd5284c2c72d5a5bfd67e7fad26ca5ddb
Submitter: Jenkins
Branch: master

commit 285802bdd5284c2c72d5a5bfd67e7fad26ca5ddb
Author: Zane Bitter <email address hidden>
Date: Tue Mar 22 17:17:42 2016 -0400

    Add a replace_on_change option to the SW Config input schema

    Change-Id: Idf39e48f801de21e63fcceb8dd779f266a07199f
    Co-Authored-By: Steve Baker <email address hidden>
    Closes-Bug: #1595040

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

Related fix proposed to branch: master
Review: https://review.openstack.org/360122

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to heat (master)

Reviewed: https://review.openstack.org/360122
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=bbb1dfb06e074dd6da285723393cea7cf419f9b7
Submitter: Jenkins
Branch: master

commit bbb1dfb06e074dd6da285723393cea7cf419f9b7
Author: Zane Bitter <email address hidden>
Date: Wed Aug 24 18:48:11 2016 -0400

    Fix SoftwareDeployment when dealing with deleted configs

    When a SoftwareConfig has been updated, we can't rely on the previous
    one not having been deleted because TripleO has a habit of putting all
    their SoftwareConfigs inside a nested stack, breaking the UpdateReplace
    workflow by splitting the dependency graph.

    Instead, load the previous derived config from the Software Deployment
    itself.

    Change-Id: I9a399a676836be3106268c3640c5edb0c6d8472c
    Closes-Bug: #1616550
    Related-Bug: #1595040

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

This issue was fixed in the openstack/heat 7.0.0.0b3 development milestone.

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.