Heat autoscale StackValidation failed for authentication
Hi, I'm trying to define a simple autoscaling template for heat. This is how it looks like:
heat_template_version: 2013-05-23
description: Test Template
parameters:
image:
type: string
description: Image use to boot a server
default: "ubuntu-trusty"
flavor:
type: string
description: Flavor for the image
constraints:
- allowed_values: [ m1.tiny, m1.small, m1.medium, m1.large, m1.xlarge ]
default: "m1.large"
network:
type: string
description: Network ID for the server
default: "d7f8f8c4-3ab3-4643-978c-b98bf94567d7"
key:
type: string
description: Public key to be used
resources:
server_group:
type: OS::Heat::AutoScalingGroup
properties:
min_size: 1
max_size: 3
resource:
type: OS::Nova::Server
properties:
flavor: {get_param: flavor}
image: {get_param: image}
key_name: {get_param: key}
networks:
- network: { get_param: network }
metadata: {"metering.stack": {get_param: "OS::stack_id"}}
server_scaleup_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: server_group}
cooldown: 30
scaling_adjustment: 1
server_scaledown_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: {get_resource: server_group}
cooldown: 30
scaling_adjustment: -1
cpu_alarm_high:
type: OS::Ceilometer::Alarm
properties:
description: Scale-up if the average CPU > 15% for 30 seconds
meter_name: cpu_util
statistic: avg
period: 30
evaluation_periods: 1
threshold: 15
alarm_actions:
- {get_attr: [server_scaleup_policy, alarm_url]}
matching_metadata:
'metadata.user_metadata.stack': {get_param: "OS::stack_id"}
comparison_operator: gt
cpu_alarm_low:
type: OS::Ceilometer::Alarm
properties:
description: Scale-down if the average CPU < 10% for 30 seconds
meter_name: cpu_util
statistic: avg
period: 30
evaluation_periods: 1
threshold: 10
alarm_actions:
- {get_attr: [server_scaledown_policy, alarm_url]}
matching_metadata:
'metadata.user_metadata.stack': {get_param: "OS::stack_id"}
comparison_operator: lt
It can successfully create the instance but doesn't scale up when the cpu goes over the threshold. The alarm is triggered but no acton is taken:
2014-12-03 15:42:31.049 21214 INFO heat.engine.resources.openstack.scaling_policy [req-7521a3f0-9873-4dd8-8a87-a898c5669fe5 None] Alarm server_scaleup_policy, new state alarm
2014-12-03 15:42:31.050 21214 INFO heat.engine.resources.openstack.scaling_policy [req-7521a3f0-9873-4dd8-8a87-a898c5669fe5 None] server_scaleup_policy Alarm, adjusting Group server_group with id test-server_group-apysatvxf34k by 1
2014-12-03 15:42:31.055 21214 INFO heat.engine.environment [req-7521a3f0-9873-4dd8-8a87-a898c5669fe5 None] Registering OS::Heat::ScaledResource -> AWS::EC2::Instance
2014-12-03 15:42:31.064 21214 INFO heat.engine.environment [req-7521a3f0-9873-4dd8-8a87-a898c5669fe5 None] Registering OS::Heat::ScaledResource -> AWS::EC2::Instance
2014-12-03 15:42:31.067 21214 INFO heat.engine.resource [req-7521a3f0-9873-4dd8-8a87-a898c5669fe5 None] Validating Server "uxivdelzdf3o"
2014-12-03 15:42:31.115 21214 WARNING heat.common.keystoneclient [req-7521a3f0-9873-4dd8-8a87-a898c5669fe5 None] stack_user_domain_id or stack_user_domain_name not set in heat.conf falling back to using default
2014-12-03 15:42:31.117 21214 INFO urllib3.connectionpool [req-7521a3f0-9873-4dd8-8a87-a898c5669fe5 ] Starting new HTTP connection (1): controller01
2014-12-03 15:42:31.172 21214 INFO heat.engine.stack [req-7521a3f0-9873-4dd8-8a87-a898c5669fe5 None] Property error : uxivdelzdf3o: key_name The request you have made requires authentication. (HTTP 401)
2014-12-03 15:42:31.173 21214 ERROR heat.engine.resource [req-7521a3f0-9873-4dd8-8a87-a898c5669fe5 None] signal AutoScalingPolicy "server_scaleup_policy" [7955b841fdcc4b198abdc61d7968ed0f] Stack "test" [ef131d8d-bfdd-427a-9bba-893b7fe05680] : Property error : uxivdelzdf3o: key_name The request you have made requires authentication. (HTTP 401)
2014-12-03 15:42:31.173 21214 TRACE heat.engine.resource Traceback (most recent call last):
2014-12-03 15:42:31.173 21214 TRACE heat.engine.resource File "/usr/lib/python2.7/dist-packages/heat/engine/resource.py", line 1032, in signal
2014-12-03 15:42:31.173 21214 TRACE heat.engine.resource signal_result = self.handle_signal(details)
2014-12-03 15:42 ...
Check the heat.conf and see if there are values that weren't updated such as user_role and all of that. I think it uses the auth info within heat.conf to run commands that aren't associated with a specific user, such as the initial creation.