Re: [Openstack-operators] [openstack-operators][Ceilometer vs Monasca] Alarms: Ceilometer vs Monasca

2017-08-17 Thread Curtis
On Wed, Aug 16, 2017 at 6:44 AM, Krzysztof Świątek
 wrote:
> Hi,
>
> i have a question about alarms in openstack.
>
> I want autoscaling with heat, and I'm looking for metric/alarm project
> which I can use with heat.
> I found that I can use Monasca or Ceilometer (with Aodh).
> My question is:
> Is any of you using heat (autoscaling) in production?
> If yes what are you using (Monasca, Ceilometer, other) for metric and
> alarms, and why?

I don't think many people know that Monasca can be used with heat for
autoscaling, so it's good that you know. :)

That said, I think it's fairly safe to say that the most common of the
two in production for autoscaling will be ceilometer, and that is the
only one I've used in production. So, it's not to say that one is
better than the other, but rather that Ceilometer is more commonly
used. If it was me I would probably use Ceilometer unless I knew I
also wanted to provide monitoring as a service to my end users and did
not need to provide telemetry to them. Usually ceilometer is useful in
other areas, such as billing, etc.

Ceilometer and it's related systems have changed a lot recently for
the better to separate out some components into other projects like
panko and gnocchi and aodh. There are definitely retention and backend
storage type and tuning that have to be considered.

Thanks,
Curtis.

>
> --
> Pozdrawiam,
> Krzysztof Świątek
>
> ___
> OpenStack-operators mailing list
> OpenStack-operators@lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators



-- 
Blog: serverascode.com

___
OpenStack-operators mailing list
OpenStack-operators@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators


Re: [Openstack-operators] [openstack-operators][Ceilometer vs Monasca] Alarms: Ceilometer vs Monasca

2017-08-16 Thread Pedro Sousa
Hi,

I use Aodh + Gnocchi for autoscaling. I also use Mistral + Zaqar for
auto-healing. See the example below, hope it helps.


Main template:

(...)
mongocluster:
type: OS::Heat::AutoScalingGroup
properties:
  cooldown: 60
  desired_capacity: 2
  max_size: 3
  min_size: 1
  resource:
type: ./mongocluster.yaml
properties:
  network: { get_attr: [ voicis_network, be_om_net ] }
  flavor: { get_param: flavor }
  image: { get_param: image }
  key_name: { get_param: key_name }
  base_mgmt_security_group: { get_attr: [ security_groups,
base_mgmt ] }
  mongodb_security_group: { get_attr: [ security_groups, mongodb ] }
  root_stack_id: {get_param: "OS::stack_id"}
  metadata: {"metering.server_group": {get_param: "OS::stack_id"}}


mongodb_scaleup_policy:
type: OS::Heat::ScalingPolicy
properties:
  adjustment_type: change_in_capacity
  auto_scaling_group_id: {get_resource: mongocluster}
  cooldown: 60
  scaling_adjustment: 1

  mongodb_scaledown_policy:
type: OS::Heat::ScalingPolicy
properties:
  adjustment_type: change_in_capacity
  auto_scaling_group_id: {get_resource: mongocluster}
  cooldown: 60
  scaling_adjustment: -1

cpu_alarm_high:
type: OS::Aodh::GnocchiAggregationByResourcesAlarm
properties:
  description: Scale-up if the average CPU > 95% for 1 minute
  metric: cpu_util
  aggregation_method: mean
  granularity: 300
  evaluation_periods: 1
  threshold: 80
  resource_type: instance
  comparison_operator: gt
  alarm_actions:
- str_replace:
template: trust+url
params:
  url: {get_attr: [mongodb_scaleup_policy, signal_url]}
  query:
str_replace:
  template: '{"=": {"server_group": "stack_id"}}'
  params:
stack_id: {get_param: "OS::stack_id"}

  cpu_alarm_low:
type: OS::Aodh::GnocchiAggregationByResourcesAlarm
properties:
  metric: cpu_util
  aggregation_method: mean
  granularity: 300
  evaluation_periods: 1
  threshold: 5
  resource_type: instance
  comparison_operator: lt
  alarm_actions:
- str_replace:
template: trust+url
params:
  url: {get_attr: [mongodb_scaledown_policy, signal_url]}
  query:
str_replace:
  template: '{"=": {"server_group": "stack_id"}}'
  params:
stack_id: {get_param: "OS::stack_id"}

outputs:
  mongo_stack_id:
description: UUID of the cluster nested stack
value: {get_resource: mongocluster}
  scale_up_url:
description: >
  This URL is the webhook to scale up the autoscaling group.  You
  can invoke the scale-up operation by doing an HTTP POST to this
  URL; no body nor extra headers are needed.
value: {get_attr: [mongodb_scaleup_policy, alarm_url]}
  scale_dn_url:
description: >
  This URL is the webhook to scale down the autoscaling group.
  You can invoke the scale-down operation by doing an HTTP POST to
  this URL; no body nor extra headers are needed.
value: {get_attr: [mongodb_scaledown_policy, alarm_url]}
  ceilometer_query:
value:
  str_replace:
template: >
  ceilometer statistics -m cpu_util
  -q metadata.user_metadata.stack=stackval -p 60 -a avg
params:
  stackval: { get_param: "OS::stack_id" }
description: >
  This is a Ceilometer query for statistics on the cpu_util meter
  Samples about OS::Nova::Server instances in this stack.  The -q
  parameter selects Samples according to the subject's metadata.
  When a VM's metadata includes an item of the form metering.X=Y,
  the corresponding Ceilometer resource has a metadata item of the
  form user_metadata.X=Y and samples about resources so tagged can
  be queried with a Ceilometer query term of the form
  metadata.user_metadata.X=Y.  In this case the nested stacks give
  their VMs metadata that is passed as a nested stack parameter,
  and this stack passes a metadata of the form metering.stack=Y,
  where Y is this stack's ID.




mongocluster.yaml

heat_template_version: ocata

description: >
  MongoDB cluster node


metadata:
type: json

  root_stack_id:
type: string
default: ""

conditions:
is_standalone: {equals: [{get_param: root_stack_id}, ""]}


resources:

mongodbserver:
type: OS::Nova::Server
properties:
  name: { str_replace: { params: { random_string: { get_resource:
random_str }, __zone__: { get_param: zone } }, template:
mongodb-random_string.__zone__ } }
  image: { get_param: image }
  flavor: { get_param: flavor }
  metadata: {get_param: metadata}
  key_name: { get_param: key_name }
  networks:
- port: { get_resource: om_port }
  user_data_format: SOFTWARE_CONFIG
  user_data: { get_resource: server_clu_init 

[Openstack-operators] [openstack-operators][Ceilometer vs Monasca] Alarms: Ceilometer vs Monasca

2017-08-16 Thread Krzysztof Świątek
Hi,

i have a question about alarms in openstack.

I want autoscaling with heat, and I'm looking for metric/alarm project
which I can use with heat.
I found that I can use Monasca or Ceilometer (with Aodh).
My question is:
Is any of you using heat (autoscaling) in production?
If yes what are you using (Monasca, Ceilometer, other) for metric and
alarms, and why?

-- 
Pozdrawiam,
Krzysztof Świątek

___
OpenStack-operators mailing list
OpenStack-operators@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators