As the metric cpu_util is now deprecated, how can someone use heat to auto scale up and down using cpu usage of the instance?
Any insight is appreciated.
Edited: We used to have transformers that did the calculation and generated cpu_util but as from stein release the transformers section has been completely removed so what it the way to get cpu_util metric and use it in heat template to scale up and scale down the instances based on cpu usage.
**gnocchi aggregates command only give the cpu usage in %age but we cannot use it in heat template.
Solution:
the cpu_util in percentage can be calculated using the gnocchi aggregates command.
- Then we need to create a metric named cpu_util or cpu_usage against each resource type instance.
- Use gnocchi aggregates command for each resource type instance ID to get the cpu_util in percentage unit.
- Use gnocchi measures add --resource-id -m timestamp@value metric name command to add the measure to the metric.
- Lastly use the metric to deploy heat template when there is high cpu usage.
Convert the above process to a bash script and run a cronjob to collect the measures automatically.