update asg resource which in FAILED state shouldn't enter UpdateReplace flow

Bug #1383618 reported by huangtianhua
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
huangtianhua
Juno
Fix Released
Undecided
Unassigned

Bug Description

1. create a stack with template:
heat_template_version: 2013-05-23

resources:
  her_policy_group:
    type: OS::Nova::ServerGroup
    # A Nova ServerGroup
    properties:
      name: nova-server-group
      policies: [affinity]

  her_asg:
    type: OS::Heat::AutoScalingGroup
    properties:
      resource:
        type: OS::Nova::Server
        properties:
            image: 74f50a38-1786-4ad0-8c12-5a5b9ba52c36
            flavor: m1.tiny
            scheduler_hints: {group: {get_resource: her_policy_group}}
      min_size: 1
      desired_capacity: 3
      max_size: 11

2. the stack create successful, and the nova instances are all active

3. update the template, change desired_capacity to 7(exceed the quota 5)

4. update the stack

5. the stack is update failed, and there are 5 instances in group, and also nova list show 5 instances in active

6. update the stack again, change desired_capacity back to 3

7. then the resource 'her_asg' will enter the UpdateReplace flow, and to re-create instances, I think it's incorrect to re-create new instances.

Found that: if a resource in 'FAILED' state will enter the UpdateReplace flow, I'm thinking if the resource has nested_stack, we should enter the resource.update not the UpdateReplace flow.

Revision history for this message
huangtianhua (huangtianhua) wrote :

the test depends on the change https://review.openstack.org/#/c/129177/

Changed in heat:
assignee: nobody → huangtianhua (huangtianhua)
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/130107

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

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

Steven Hardy (shardy)
Changed in heat:
importance: Undecided → High
milestone: none → kilo-1
tags: added: juno-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

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

commit 9b0a940a6f8d06105840ce3139789da133edb560
Author: huangtianhua <email address hidden>
Date: Wed Oct 22 11:22:02 2014 +0800

    Failed res no need UpdateReplace which has nested_stack

    Now update the resources in FAILED status will enter UpdateReplace
    flow, but it's not fit for resources which has nested stack.
    Especially for autoscaling group, if there is one or more server
    were created/deleted failed, we shouldn't destroy all the servers
    and then create new servers for the group while updation.

    Change-Id: Ib53f66fe481acc282123dc1743ef8310456a1d69
    Closes-bug: #1383618

Changed in heat:
status: In Progress → Fix Committed
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/141497

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

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

commit 35ac781db3d529317bac691eae3fb08d208d1e56
Author: Zane Bitter <email address hidden>
Date: Fri Dec 12 15:20:24 2014 -0500

    Always update nested stacks

    There's no reason to not issue an update to a nested stack, so don't bother
    trying to decide if its inputs have changed (and especially don't replace
    it because it's in a failed state). Overriding _needs_update() also allows
    us to remove what was effectively an isinstance check from the previous
    handling of failed states.

    Change-Id: Ia48ebfcb6c1b3a904f01a83f8f34d8c7a13bb2be
    Related-Bug: #1383618

Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

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

commit 1eabdaf45f03295be19386140603e00c701a7b17
Author: huangtianhua <email address hidden>
Date: Wed Nov 19 15:12:51 2014 +0800

    Correct group's updates from a failed state

    This patch modifies autoscaling/instance group to
    handle updates from a failed state.

    Change-Id: I235b3e97276361022e708266bf06bca6556bcf76
    Closes-Bug: #1383618

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to heat (stable/juno)

Related fix proposed to branch: stable/juno
Review: https://review.openstack.org/145332

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

Reviewed: https://review.openstack.org/145332
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=d8abdfd34ff089d0173da525da03cfbb20412c83
Submitter: Jenkins
Branch: stable/juno

commit d8abdfd34ff089d0173da525da03cfbb20412c83
Author: Zane Bitter <email address hidden>
Date: Fri Dec 12 15:20:24 2014 -0500

    Always update nested stacks

    There's no reason to not issue an update to a nested stack, so don't bother
    trying to decide if its inputs have changed (and especially don't replace
    it because it's in a failed state).

    Change-Id: Ia48ebfcb6c1b3a904f01a83f8f34d8c7a13bb2be
    Related-Bug: #1383618
    (cherry picked from commit 35ac781db3d529317bac691eae3fb08d208d1e56)

tags: added: in-stable-juno
Thierry Carrez (ttx)
Changed in heat:
milestone: kilo-1 → 2015.1.0
Zane Bitter (zaneb)
tags: removed: juno-backport-potential
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.