Search code examples
openstackautoscalingopenstack-heat

How to dynamically change autoscaling instance names


I have created a heat stack which autoscales depending on CPU use. Each time a new instance is created, it is given a random name.

Is there a way to set a specific name with a counter added to the end of it so that each time a new instance is created it increases by 1?

E.g. Myinstance1, Myinstance2, Myinstance3 ... MyinstanceX

Thanks in advance!


Solution

  • In Openstack HEAT, stack resource names are manipulated with stack_name and suffixed with a short_id. That's why on every autoscaled up instance you could see the instance name as such. This is how the implementation done in overall HEAT project and it is not possible to define instance name suffixed with incremental number.