Ask Your Question
0

Heat Stack Creation Failing on Ceilometer Alarm Check

asked 2017-08-07 07:55:01 -0500

anonymous user

Anonymous

We were trying to create a heat stack using the below template but ceilometer alarm is failing with below error

ERROR While Creating Stack Resource Create Failed: Badrequest: Resources.Cpu Alarm High: Expecting To Find Domain In Project - The Server Could Not Comply With The Request Since It Is Either Malformed Or Otherwise Incorrect. The Client Is Assumed To Be In Error. (Http 400)

The template for reference as below.

heat_template_version: 2013-05-23
description: AutoScaling Simple
parameters:
  image:
    type: string
    description: Image used for servers
    default: Cirros-0.3.4
  flavor:
    type: string
    description: flavor used by the web servers
    default: m1.tiny
  public_net_id:
    type: string
    description: network on which the instances
    default: 1828994e-9498-4020-b770-32d2f1da61cf
  key_name:
    type: string
    description: Name of an existing key pair to use for the template
    default: tojdg_key
  security_group_id:
    type: string
    description: Security group used for the servers
    default: default


resources:
# auto_scale_group autoscale group and it's init contents to generate load
  auto_scale_group:
    type: OS::Heat::AutoScalingGroup
    properties:
      min_size: 1
      max_size: 6
      resource:
        type: OS::Nova::Server
        properties:
          flavor: {get_param: flavor}
          image: {get_param: image}
          key_name: {get_param: key_name}
          metadata: {"metering.stack": {get_param: "OS::stack_id"}}
          networks:
            - network: { get_param: public_net_id }
          config_drive: True
          security_groups: [get_param: security_group_id]
          user_data: |
            #!/bin/sh
            nohup dd if=/dev/zero of=/dev/null &


# Scaling policies
  server_scaleup_policy:
    type: OS::Heat::ScalingPolicy
    properties:
      adjustment_type: change_in_capacity
      auto_scaling_group_id: {get_resource: auto_scale_group}
      cooldown: 60
      scaling_adjustment: 1
  server_scaledown_policy:
    type: OS::Heat::ScalingPolicy
    properties:
      adjustment_type: change_in_capacity
      auto_scaling_group_id: {get_resource: auto_scale_group}
      cooldown: 60
      scaling_adjustment: -1


# Ceilometer alarms for CPU usage
  cpu_alarm_high:
    type: OS::Ceilometer::Alarm
    properties:
      description: Scale-up if the average CPU > 50% for 1 minute
      meter_name: cpu_util
      statistic: avg
      period: 60
      evaluation_periods: 1
      threshold: 50
      alarm_actions:
        - {get_attr: [server_scaleup_policy, alarm_url]}
      matching_metadata: {'metadata.user_metadata.stack': {get_param: "OS::stack_id"}}
      comparison_operator: gt
</verbose>
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-08-08 21:56:23 -0500

Shaoman Zhang gravatar image
edit flag offensive delete link more

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

Stats

Asked: 2017-08-07 07:55:01 -0500

Seen: 395 times

Last updated: Aug 08 '17