Ask Your Question
3

How to create unique instance name in autoscale template

asked 2014-09-04 09:50:00 -0500

drmike gravatar image

updated 2014-09-04 10:01:00 -0500

mpetason gravatar image

HI

I have an autoscale template that can scale from 2 to 10 instances, I need to have then named something like TEST-webserver-1 to 10. For example, when the heat stack creates the first 2 instances you get TEST-webserver-1 and TEST-webserver-2. If an alarm triggers and starts a new instance then i would want the new instance to be named TEST-webserver-3 and so on up to TEST-webserver-10. Also from when an instance is terminated as the alarm has cleared say back down to TEST-webserver-6 I would still like the next alarm to create TEST-webserver-7. Is there anyway of setting this in the heat template with a function

creating the name isnt the problem, its getting the sequential part working

i have so far

name: {"Fn::Join": ["-", [{ get_param: "OS::stack_name" } , "webserver"]]}

what do i need for the sequential numbering

Any help with this would be much appreciated

Cheers

edit retag flag offensive close merge delete

Comments

smaffulli gravatar imagesmaffulli ( 2014-09-05 17:46:03 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-09-18 22:35:12 -0500

Steve Baker gravatar image

By default heat already gives a unique name to instances. Is there a reason you can't just use this?

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

3 followers

Stats

Asked: 2014-09-04 09:50:00 -0500

Seen: 559 times

Last updated: Sep 18 '14