metering tagging fails in AutoScalingCeilometer.yaml

Bug #1290980 reported by Mike Spreitzer
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Heat Templates
Fix Committed
Undecided
William C. Arnold

Bug Description

cfn/f17/AutoScalingCeilometer says

  WebServerGroup:
    Type: AWS::AutoScaling::AutoScalingGroup
    Properties:
      ...
      Tags:
      - {Key: metering.server_group, Value: WebServerGroup}

and

  CPUAlarmHigh:
    Type: OS::Ceilometer::Alarm
    Properties:
      ...
      matching_metadata: {'metadata.user_metadata.groupname': {Ref: 'WebServerGroup'}}
      ...

The members get tagged with the string literal "WebServerGroup". The relevant logic is in the _tags method of the InstanceGroup class in the heat/engine/resources/autoscaling.py file. It reads like this:

        for t in tags:
            if t[self.TAG_KEY].startswith('metering.'):
                # the user has added one, don't add another.
                return tags
        return tags + [{self.TAG_KEY: 'metering.groupname',
                        self.TAG_VALUE: self.FnGetRefId()}]

In the template at hand, that first return is used, and so the literal tag is returned. However, the alarm is looking for the ID of the group, not its stack-local name. The alarm fails to work properly due to this mismatch.

The template can be fixed by simply removing the Tags property from the ASG. In that case the last line of _tags is used, which tags the group's members with the group's ID, which is what the alarm looks for.

Changed in heat-templates:
status: New → In Progress
Revision history for this message
Mike Spreitzer (mike-spreitzer) wrote :

Bill Arnold has submitted a fix, I do not understand why it is not listed here.

https://review.openstack.org/#/c/82158/

Revision history for this message
Tom Fifield (fifieldt) wrote :

Mike,

As far as I can tell, the syntax in the commit message is correct, and the patch should have been noted here.

I'd get in touch with the infrastructure team at #openstack-infra on IRC, or by submitting a bug at https://bugs.launchpad.net/openstack-ci

Changed in heat-templates:
assignee: nobody → William C. Arnold (barnold-8)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat-templates (master)

Reviewed: https://review.openstack.org/82158
Committed: https://git.openstack.org/cgit/openstack/heat-templates/commit/?id=454491d6da2e8c7156ff0b9cd6e857db58fcca27
Submitter: Jenkins
Branch: master

commit 454491d6da2e8c7156ff0b9cd6e857db58fcca27
Author: Bill Arnold <email address hidden>
Date: Fri Mar 21 14:07:57 2014 -0400

    Remove tag to allow default resolved group id

    Change-Id: I2ff271cc0c41fd7801e18cf6795d4fb9134adc18
    Closes-Bug: #1290980

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