Ask Your Question
0

Autoscaling with Heat and Ceilometer

asked 2016-08-23 11:59:37 -0600

yas gravatar image

updated 2016-08-23 12:02:38 -0600

Guys ,I'm working on auto-scaling using Heat and ceilometer , but I face a problem : When an alarm was triggered , Heat didn't launch a new instance here is my template :

cirros.yaml

    heat_template_version: 2016-04-08
description: autoscaling using cirros image.
resources:
  server:
    type: OS::Nova::Server
    properties:
      flavor: m1.nano
      image:cirros
      networks:
        - network: private

env.yaml

resource_registry:
    "OS::Nova::Server::Cirros": "cirros.yaml"

scale.yaml

heat_template_version: 2015-04-30
description: A simple auto scaling group.
resources:
  group:
    type: OS::Heat::AutoScalingGroup
    properties:
      cooldown: 600
      desired_capacity: 1
      max_size: 3
      min_size: 1
      resource:
        type: OS::Nova::Server::Cirros
 scaleup_policy:
    type: OS::Heat::ScalingPolicy
    properties:
      adjustment_type: change_in_capacity
      auto_scaling_group_id: { get_resource: group }
      cooldown: 600
      scaling_adjustment: 1

  alarm:
    type: OS::Ceilometer::Alarm
    properties:
      meter_name: cpu_util
      statistic: avg
      period: 600
      evaluation_periods: 1
      threshold: 1
      alarm_actions:
        - {get_attr: [scaleup_policy, alarm_url]}
      comparison_operator: ge

when i start the stack heat created one instance and an alarm named mystack-alarm-lq...bu, I waited 10 min then i gave a look to ceilometer alarm-list . I noticed that the alarm State changed to alarm but unfortunately there is no new instance launched .

Additional informations:

>I installed openstack using packstack
>openstack release : Mitaka
>openstack services status :

== Nova services ==
openstack-nova-api:                     active
openstack-nova-compute:                 active
openstack-nova-network:                 inactive  (disabled on boot)
openstack-nova-scheduler:               active
openstack-nova-cert:                    active
openstack-nova-conductor:               active
openstack-nova-console:                 inactive  (disabled on boot)
openstack-nova-consoleauth:             active
openstack-nova-xvpvncproxy:             inactive  (disabled on boot)
== Glance services ==
openstack-glance-api:                   active
openstack-glance-registry:              active
== Keystone service ==
openstack-keystone:                     inactive  (disabled on boot)
== Horizon service ==
openstack-dashboard:                    active
== neutron services ==
neutron-server:                         active
neutron-dhcp-agent:                     active
neutron-l3-agent:                       active
neutron-metadata-agent:                 active
neutron-openvswitch-agent:              active
neutron-metering-agent:                 active
== Cinder services ==
openstack-cinder-api:                   active
openstack-cinder-scheduler:             active
openstack-cinder-volume:                active
openstack-cinder-backup:                inactive  (disabled on boot)
== Ceilometer services ==
openstack-ceilometer-api:               inactive  (disabled on boot)
openstack-ceilometer-central:           active
openstack-ceilometer-compute:           active
openstack-ceilometer-collector:         active
openstack-ceilometer-notification:      active
== Heat services ==
openstack-heat-api:                     active
openstack-heat-api-cfn:                 inactive  (disabled on boot)
openstack-heat-api-cloudwatch:          inactive  (disabled on boot)
openstack-heat-engine:                  active
== Support services ==
mysqld:                                 inactive  (disabled on boot)
openvswitch:                            active
dbus:                                   active
target:                                 active
rabbitmq-server:                        active
memcached:                              active
edit retag flag offensive close merge delete

Comments

1

Hi, first ensure all your .yaml files are proper with indentation. Also install heat-api-cfn service by executing the below commands:

yum install openstack-heat-api-cfn -y
systemctl enable  openstack-heat-api-cfn.service 
systemctl start  openstack-heat-api-cfn.service
Praveen N gravatar imagePraveen N ( 2016-08-23 22:56:48 -0600 )edit
1

Also service and service endpoint needs to created for heat-api-cfn service. FYI http://docs.openstack.org/mitaka/inst... --Regards

Praveen N gravatar imagePraveen N ( 2016-08-23 23:02:02 -0600 )edit

Thank u so much @Praveen for commenting , I fix my issue by installing heat-api-cfn , now heat works like a charm

yas gravatar imageyas ( 2016-08-24 10:33:35 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2016-08-24 03:58:47 -0600

yprokule gravatar image

@yas - I'd recommend enable debug/verbose in aodh.conf ( or ceilometer.conf) and restart alarms services.

Then check aodh/notifier.log or ceilometer/alarm-notifier.log

If scale up request is sent - check the Heat's logs

edit flag offensive delete link more
0

answered 2016-08-24 10:45:33 -0600

yas gravatar image

updated 2016-08-24 10:48:25 -0600

I fix my issue by:

  1. creating heat-cfn service :
$ openstack service create --name heat-cfn --description "Orchestration" cloudformation

2.Create the Orchestration service API endpoint:

$ keystone endpoint-create \
      --service-id $(keystone service-list | awk '/ cloudformation / {print $2}') \
      --publicurl http://controllerIP:8000/v1 \
      --internalurl http://controllerIP:8000/v1 \
      --adminurl http://controllerIP:8000/v1 \
      --region regionOne

3.Installing openstack-heat-api-cfn:

# yum install openstack-heat-api-cfn

4.Starting the Orchestration service:

# systemctl enable openstack-heat-api-cfn.service 
# systemctl start openstack-heat-api-cfn.service

REF:http://docs.openstack.org/juno/install-guide/install/yum/content/heat-install-controller-node.html

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: 2016-08-23 11:59:37 -0600

Seen: 1,043 times

Last updated: Aug 24 '16