HARestarter does not recreate resources

Bug #1202492 reported by JunJie Nan
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
JunJie Nan

Bug Description

Steps to reproduce:
1. heat stack-create -f WordPress_Single_Instance_With_IHA.template iha -P "..."
2. heat resource-list iha
    | CfnUser | AWS::IAM::User
    | WebServerKeys | AWS::IAM::AccessKey
    | WikiDatabase | AWS::EC2::Instance
    | HeartbeatFailureAlarm | AWS::CloudWatch::Alarm
    | WaitCondition | AWS::CloudFormation::WaitCondition
    | WaitHandle | AWS::CloudFormation::WaitConditionHandle
    | WebServerRestartPolicy | OS::Heat::HARestarter
3. kill WikiDatabase kvm instance
4. Wait 5 minutes and check result
Expected result:
Resources WebServerRestartPolicy, WaitCondition, HeartbeatFailureAlarm and WikiDatabase should be destroyed and recreated.
Actual result:
Resources WebServerRestartPolicy, WaitCondition, HeartbeatFailureAlarm and WikiDatabase were destroyed but NOT recreated.

Found `WordPress_Single_Instance_With_IHA.template' at
https://github.com/openstack/heat-templates/blob/master/cfn/WordPress_Single_Instance_With_IHA.template

In heat-engine log we can see below error:
below error:
  File "/usr/local/lib/python2.7/dist-packages/eventlet/greenthread.py", line 194, in main
    result = function(*args, **kwargs)
  File "/opt/stack/heat/heat/engine/service.py", line 588, in run_alarm_action
    action()
  File "/opt/stack/heat/heat/engine/resources/instance.py", line 63, in alarm
    self.stack.restart_resource(victim.name)
  File "/opt/stack/heat/heat/engine/parser.py", line 519, in restart_resource
    res.create()
  File "/opt/stack/heat/heat/engine/resource.py", line 384, in create
    assert None in (self.action, self.status), 'invalid state for create'
AssertionError: invalid state for create

JunJie Nan (nanjj)
description: updated
JunJie Nan (nanjj)
Changed in heat:
assignee: nobody → JunJie Nan (nanjj)
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/37637

Changed in heat:
status: New → In Progress
Changed in heat:
importance: Undecided → High
milestone: none → havana-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/37637
Committed: http://github.com/openstack/heat/commit/f0b6b550d97464a6de2c15838475132dbbe022cd
Submitter: Jenkins
Branch: master

commit f0b6b550d97464a6de2c15838475132dbbe022cd
Author: JUN JIE NAN <email address hidden>
Date: Thu Jul 18 15:39:10 2013 +0800

    Reset state before resource recreation

    So the destroyed resource can be recreated, and HARestarted main logic
    resource destory and create can work.

    Change-Id: Id79988560e105c254d304e30d598427a2bbc5b26
    Fixes: bug #1202492

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: havana-3 → 2013.2
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.