Alarms refs are None when they need to be resolved

Bug #1192814 reported by Steve Baker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
Steve Baker

Bug Description

See the attached template which shows the problem.

On the instance, cat /tmp/stats-crontab.txt
MAIL=""
* * * * * /opt/aws/bin/cfn-push-stats --watch None --mem-util
* * * * * /opt/aws/bin/cfn-push-stats --watch None --mem-util

It appears that CloudWatchAlarm.FnGetRefId is being called before that resource has been persisted, so there is no self.id to build the physical_resource_name with.

Revision history for this message
Steve Baker (steve-stevebaker) wrote :
description: updated
Changed in heat:
assignee: Steve Baker (steve-stevebaker) → Zane Bitter (zaneb)
summary: - Alarms are created after the instance that Refs them
+ Alarms refs are None when they need to be resolved
Revision history for this message
Steve Baker (steve-stevebaker) wrote :

Setting strict_dependency on the alarm causes a circular dependency error

Revision history for this message
Angus Salkeld (asalkeld) wrote :

see for context:
- bug 1078779
- https://github.com/openstack/heat/blame/master/heat/engine/resources/cloud_watch.py#L116

If you kill the strict_dependency, you get a CircularDependencyException, I think we need to break this
at the autoscaling group as it only returns a name from the RefId. It seems to me like we the base Resource class
should return name from FnGetRefId() and we resolve these static references at the earlier "resolve_static_references"
stage.

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/33779

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

The problem is that the CloudWatchAlarm resource type is not designed to be referenced from an Instance (this is why we have a circular dependency without the "strict_dependency = False" thing). The long-term fix is to move to Ceilometer for alarms, then cfn-push-stats goes away and we won't have this circular reference.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Changed in heat:
assignee: Angus Salkeld (asalkeld) → Steve Baker (steve-stevebaker)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/33902
Committed: http://github.com/openstack/heat/commit/3204dea9f7a6cb0e88955ace0a6a014db546e89c
Submitter: Jenkins
Branch: master

commit 3204dea9f7a6cb0e88955ace0a6a014db546e89c
Author: Steve Baker <email address hidden>
Date: Fri Jun 21 12:21:51 2013 +1200

    Give alarm a physical_resource_name which need no id.

    This restores previous behaviour, including workarounds for
    circular dependencies.

    Fixes bug: #1192814

    Change-Id: I33e8e4d7806fb397553944dbd6ebb85b575b9cb5

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-2 → 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.