Ask Your Question
0

Heat AutoScalingGroup not returning outputs

asked 2018-01-19 13:18:30 -0500

alp317 gravatar image

updated 2018-01-23 11:00:40 -0500

zaneb gravatar image

I am using AutoScalingGroup to auto scale a galera cluster. This also includes load balancing. I found an autoscaling example at https://github.com/openstack/heat-templates/blob/master/hot/autoscaling.yaml. I am successfully able to run this, however the challenge i am facing is that AutoScalingGroup is not getting any outputs from the nested "lb_server.yaml" template. The outputs are defined but they are not delivered to the AutoScalingGroup.

A similar question has been asked before, but its pretty old and there is no answer on that one.

edit retag flag offensive close merge delete

Comments

Are you using gnocchi as backend?

pablobrunetti gravatar imagepablobrunetti ( 2018-01-19 21:29:36 -0500 )edit

Yes. And the scaling part is working. But i am more concerned about the outputs. As i am planning to pass the outputs to other SoftwareConfigs. I am using OpenStack Newton.

alp317 gravatar imagealp317 ( 2018-01-19 22:04:13 -0500 )edit

Can you give an example of how you're trying to get the outputs?

zaneb gravatar imagezaneb ( 2018-01-23 11:02:13 -0500 )edit

If the autoscaling group resource name is "asg", then i do get_attr: [asg]. This shows that attributes like outputs and outputs_list are empty along with the current_size. I am using nested templates. Nested template contains a load balanced server. There are outputs declared in that template.

alp317 gravatar imagealp317 ( 2018-01-26 05:30:13 -0500 )edit

From Horizon when i view all the resources. I can see the "asg", when i open that up it further contains another resource which points to the nested template. If i open that nested resource i can see that it generated the outputs, however, they are not passed to "asg".

alp317 gravatar imagealp317 ( 2018-01-26 05:35:54 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
1

answered 2018-01-31 13:41:59 -0500

zaneb gravatar image

The short answer is, don't use {get_attr: [asg]}.

The outputs and outputs_list attributes are only valid when the actual attribute requested is specified explicitly, so no data shows up when getting 'all' attributes.

So e.g. {get_attr: [asg, server_ip]} or {get_attr: [asg, outputs, server_ip]} should work as expected.

edit flag offensive delete link more

Comments

Thank for your answer, it is very helpful for me.

But I have another problem about returned value. The returned value is a dict, for example: {"sbd64gvtrheu": "cef9937b-e152-4c02-b8d6-2de2bbdb0675"}. What I need is the value "cef9937b-e152-4c02-b8d6-2de2bbdb0675". I don't know how to get that id.

hoangphuoc gravatar imagehoangphuoc ( 2018-06-02 09:16:55 -0500 )edit

I tried {get_attr: [asg, outputs, server_id, 0]} but I got {"sbd64gvtrheu": "c"} (I modified the template to get nova instance id). I am not using Heat to much, forgive me if my question is dummy.

Thank you.

hoangphuoc gravatar imagehoangphuoc ( 2018-06-02 09:21:19 -0500 )edit

@hoangphuoc If you don't care which member matches up to which ID, you can use the outputs_list attribute: {get_attr: [asg, outputs_list, server_id]}.

zaneb gravatar imagezaneb ( 2018-07-16 14:38:17 -0500 )edit

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: 2018-01-19 13:18:30 -0500

Seen: 352 times

Last updated: Jan 31 '18