Ask Your Question

Wrong ScalingPolicy alarm_url

asked 2014-09-22 04:48:15 -0500

PatRock gravatar image

I wrote a minimal example for a triggered ScalingGroup, but with the alarm_url is something wrong.

   heat_template_version: 2013-05-23

    type: string
    default: demo-key
    type: string
    default: m1.small
    type: string
    default: cirros-0.3.2-x86_64
    type: string
    default: int-net1

    type: OS::Heat::AutoScalingGroup
      max_size: 5
      desired_capacity: 1
      min_size: 1
        type: OS::Nova::Server
          key_name: {get_param: key}
          image: {get_param: image}
          flavor: {get_param: flavor}
          networks: [ {network: {get_param: network}} ]

    type: OS::Heat::ScalingPolicy
      adjustment_type: change_in_capacity
      auto_scaling_group_id: { get_resource: myServerGroup }
      cooldown: 10
      scaling_adjustment: 1

    value: {get_attr: [scale_UP_policy, alarm_url]}

The output is: http://controller:8000/v1/signal/arn%3Aopenstack%3Aheat%3A%3Aad948ee0c33749508d76b95f33e7e02d%3Astacks%2Ftest%2F9ec989d2-ce9d-4d73-be6c-06ba7702b60a%2Fresources%2Fscale_UP_policy?Timestamp=2014-09-22T09%3A27%3A52Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=ec9371233baf46bd95b3150ff00f79d4&SignatureVersion=2&Signature=p0zVObaO5wMpniREfOrZs4jfFrCH9UIvfcCmHqG35vM%3D (http://controller:8000/v1/signal/arn%...)

I see that there is html-code in it ( %3A = ":" %2F = "/" ), but how can i fix this? And even when i change all the HTML code to the correct symbols the Link doesn't work.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-09-22 07:56:50 -0500

larsks gravatar image


First, there is absolutely nothing wrong with finding encoded characters in a URL. If I want to include one URL (say, as a parameter in another URL, i.e.:

I need to encode the special characters (such as :, /, etc) inside the first URL, giving me something like this:

...and hopefully that explains some of what you're seeing above.


With that out of the way, the URL that you've posted look entirely valid. You don't say why you believe the URL is invalid, but it is possible you are calling it incorrectly. Given an alarm URL from my own environment:


If I naively try to call that using curl I get an error:

curl "$alarm_url"
HTTP/1.1 403 AccessDenied
Content-Type: application/xml; charset=UTF-8
Content-Length: 149
Date: Mon, 22 Sep 2014 12:55:48 GMT

<Message>User is not authorized to perform action</Message>

That's because Heat expects a POST request:

$ curl -XPOST -i "$alarm_url"
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Content-Length: 0
Date: Mon, 22 Sep 2014 12:56:22 GMT

And that successfully triggers the scaling policy.

edit flag offensive delete link more


"$ curl -XPOST -i (")

"$ curl: (7) couldn't connect to host"

Do i need to add some special rules to the security groups?

I have allready allowed TCP at Port 8000 for

PatRock gravatar imagePatRock ( 2014-09-22 10:16:15 -0500 )edit

Is the appropriate ip address for the instance to use? You can change the address used in these URLs via the heat_metadata_server_url option in /etc/heat/heat.conf. Is something actually listening on port 8000 on that host? You must be running the heat-api-cfn service.

larsks gravatar imagelarsks ( 2014-09-22 10:37:33 -0500 )edit

ok i changed the ip adress and added some Ceilometer::Alarms to it. Now it scales up and down. Thank you for your help.

PatRock gravatar imagePatRock ( 2014-09-23 02:01:33 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2014-09-22 04:48:15 -0500

Seen: 806 times

Last updated: Sep 22 '14