From bc081a1031ec6de4161f5ede0eb7221f46354d0d Mon Sep 17 00:00:00 2001 From: Thomas Herve Date: Wed, 2 Apr 2014 17:31:01 +0200 Subject: [PATCH] Fix alarm metadata in new autoscaling template The new autoscaling template used old implicit metadata for creating alarm: the patch fixes that by properly passing a new value to both the alarms and the servers. Change-Id: Ia5d99dd08cf02954ce78ef661fbe9f627948f9db --- hot/autoscaling.yaml | 5 +++-- hot/lb_server.yaml | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hot/autoscaling.yaml b/hot/autoscaling.yaml index a18f7233..f4626fae 100644 --- a/hot/autoscaling.yaml +++ b/hot/autoscaling.yaml @@ -68,6 +68,7 @@ resources: image: {get_param: image} key_name: {get_param: key} pool_id: {get_resource: pool} + metadata: {"metering.stack": {get_param: "OS::stack_id"}} user_data: str_replace: template: | @@ -115,7 +116,7 @@ resources: threshold: 50 alarm_actions: - {get_attr: [web_server_scaleup_policy, alarm_url]} - matching_metadata: {'metadata.user_metadata.groupname': {get_resource: web_server_group}} + matching_metadata: {'metadata.user_metadata.stack': {get_param: "OS::stack_id"}} comparison_operator: gt cpu_alarm_low: type: OS::Ceilometer::Alarm @@ -128,7 +129,7 @@ resources: threshold: 15 alarm_actions: - {get_attr: [web_server_scaledown_policy, alarm_url]} - matching_metadata: {'metadata.user_metadata.groupname': {get_resource: web_server_group}} + matching_metadata: {'metadata.user_metadata.stack': {get_param: "OS::stack_id"}} comparison_operator: lt monitor: type: OS::Neutron::HealthMonitor diff --git a/hot/lb_server.yaml b/hot/lb_server.yaml index f455ce54..960bddb5 100644 --- a/hot/lb_server.yaml +++ b/hot/lb_server.yaml @@ -16,6 +16,8 @@ parameters: user_data: type: string description: Server user_data + metadata: + type: json resources: server: type: OS::Nova::Server @@ -23,6 +25,7 @@ resources: flavor: {get_param: flavor} image: {get_param: image} key_name: {get_param: key_name} + metadata: {get_param: metadata} user_data: {get_param: user_data} user_data_format: RAW member: