Ask Your Question

How to create unique instance name in autoscale template

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

drmike gravatar image

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

mpetason gravatar image


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


edit retag flag offensive close merge delete


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

1 answer

Sort by ยป oldest newest most voted

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

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

Get to know Ask OpenStack

Resources for moderators

Question Tools



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

Seen: 629 times

Last updated: Sep 18 '14