delete a updating stack may cause that some resources can't be deleted

Bug #1304277 reported by Zhang Yang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Triaged
Medium
Unassigned

Bug Description

if delete a updating stack before the new template ID is updated,
the new resources added in stack won't be deleted, I think
we need save the new template earlier.

I have a autoscalinggroup, and it have a scaleout policy which add 2 VMs
everytime. and if you delete the stack which is scaling, the added VMs won't be
deleted.

heat=> select resource_name, resource_action,resource_status,resource_type,created_at from event where stack_id='3ea4e2d1-4506-459a-a582-adc7708cab07' order by created_at;
  resource_name | resource_action | resource_status | resource_type | created_at
------------------+-----------------+-----------------+--------------------+----------------------------
 WebServerGroup-0 | CREATE | IN_PROGRESS | AWS::EC2::Instance | 2014-04-04 11:27:49.916327
 WebServerGroup-0 | CREATE | COMPLETE | AWS::EC2::Instance | 2014-04-04 11:27:57.586147
 WebServerGroup-1 | CREATE | IN_PROGRESS | AWS::EC2::Instance | 2014-04-04 11:28:34.832987
 WebServerGroup-1 | CREATE | COMPLETE | AWS::EC2::Instance | 2014-04-04 11:28:42.827186
 WebServerGroup-2 | CREATE | IN_PROGRESS | AWS::EC2::Instance | 2014-04-04 11:29:34.886439
 WebServerGroup-3 | CREATE | IN_PROGRESS | AWS::EC2::Instance | 2014-04-04 11:29:36.098389
 WebServerGroup-1 | DELETE | IN_PROGRESS | AWS::EC2::Instance | 2014-04-04 11:29:43.906241
 WebServerGroup-0 | DELETE | IN_PROGRESS | AWS::EC2::Instance | 2014-04-04 11:29:44.523359
 WebServerGroup-2 | CREATE | COMPLETE | AWS::EC2::Instance | 2014-04-04 11:29:44.638489
 WebServerGroup-3 | CREATE | COMPLETE | AWS::EC2::Instance | 2014-04-04 11:29:44.90781
 WebServerGroup-1 | DELETE | COMPLETE | AWS::EC2::Instance | 2014-04-04 11:29:47.702711
 WebServerGroup-0 | DELETE | COMPLETE | AWS::EC2::Instance | 2014-04-04 11:29:50.058942
(12 rows)

heat=> select resource_name, resource_action,resource_status,resource_type,created_at from event where stack_id='3ce80dd6-aba2-4108-b142-7d68fe63df21' order by created_at;
     resource_name | resource_action | resource_status | resource_type | created_at
------------------------+-----------------+-----------------+---------------------------------------+----------------------------
 LaunchConfig | CREATE | IN_PROGRESS | AWS::AutoScaling::LaunchConfiguration | 2014-04-04 11:27:49.408229
 LaunchConfig | CREATE | COMPLETE | AWS::AutoScaling::LaunchConfiguration | 2014-04-04 11:27:49.448942
 WebServerGroup | CREATE | IN_PROGRESS | AWS::AutoScaling::AutoScalingGroup | 2014-04-04 11:27:49.482674
 WebServerGroup | CREATE | COMPLETE | AWS::AutoScaling::AutoScalingGroup | 2014-04-04 11:27:57.63526
 WebServerScaleUpPolicy | CREATE | IN_PROGRESS | AWS::AutoScaling::ScalingPolicy | 2014-04-04 11:27:57.667967
 WebServerScaleUpPolicy | CREATE | COMPLETE | AWS::AutoScaling::ScalingPolicy | 2014-04-04 11:27:58.88479
 CPUAlarmHigh | CREATE | IN_PROGRESS | OS::Ceilometer::Alarm | 2014-04-04 11:27:58.951199
 CPUAlarmHigh | CREATE | COMPLETE | OS::Ceilometer::Alarm | 2014-04-04 11:28:00.052574
 WebServerScaleUpPolicy | signal | COMPLETE | AWS::AutoScaling::ScalingPolicy | 2014-04-04 11:28:34.259004
 WebServerScaleUpPolicy | signal | COMPLETE | AWS::AutoScaling::ScalingPolicy | 2014-04-04 11:29:34.035764
 CPUAlarmHigh | DELETE | IN_PROGRESS | OS::Ceilometer::Alarm | 2014-04-04 11:29:42.424311
 CPUAlarmHigh | DELETE | COMPLETE | OS::Ceilometer::Alarm | 2014-04-04 11:29:42.490193
 WebServerScaleUpPolicy | DELETE | IN_PROGRESS | AWS::AutoScaling::ScalingPolicy | 2014-04-04 11:29:42.540389
 WebServerScaleUpPolicy | DELETE | COMPLETE | AWS::AutoScaling::ScalingPolicy | 2014-04-04 11:29:43.692144
 WebServerGroup | DELETE | IN_PROGRESS | AWS::AutoScaling::AutoScalingGroup | 2014-04-04 11:29:43.74047
 WebServerGroup | DELETE | COMPLETE | AWS::AutoScaling::AutoScalingGroup | 2014-04-04 11:29:51.208128
 LaunchConfig | DELETE | IN_PROGRESS | AWS::AutoScaling::LaunchConfiguration | 2014-04-04 11:29:51.274372
 LaunchConfig | DELETE | COMPLETE | AWS::AutoScaling::LaunchConfiguration | 2014-04-04 11:29:51.32382
(18 rows)

Changed in heat:
assignee: nobody → Zhang Yang (neil-zhangyang)
Revision history for this message
Sergey Kraynev (skraynev) wrote :

Could you please upload example for reproducing this problem.

Revision history for this message
Zhang Yang (neil-zhangyang) wrote :

the reason is that we won't save the new template until the stack update finish, so if delete a updating stack, the loaded stack will use the old template which don't have the new resources.

description: updated
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/86043

Changed in heat:
status: New → In Progress
Revision history for this message
Zane Bitter (zaneb) wrote :
Revision history for this message
Angus Salkeld (asalkeld) wrote :

resetting state as no activity for a year.

Changed in heat:
status: In Progress → Triaged
assignee: Zhang Yang (neil-zhangyang) → nobody
Angus Salkeld (asalkeld)
Changed in heat:
importance: Undecided → Medium
Rico Lin (rico-lin)
Changed in heat:
milestone: none → no-priority-tag-bugs
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

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