Set default capacity_adjustment instance value.

Hello

Is there a way to set a default value for capacity_adjustment instance settings. It seems it is set to “1” by default. The idea is to override the default value that will be used for all new instances

Thanks

Hi!

if you create instances through awx collection or with an API request, you can set the capacity_adjustment upon creation.

However, through the UI you cannot set the capacity right away, and have to patch the endpoint, or use the UI slider to set capacity_adjustment.

AWX Team

hi.

In fact, we have several instances because we define several replicas in our AWX CRD object, then the awx operator just updates the kubernetes deployment to add new awx pods.
As you said, I can update existing instances with the API or use the UI slider to set capacity_adjustment. If the pods are restarted, the new instances will have the default value capacity_adjustment set to 1. So, there is no way to change this value for instance created in the kubernetes deployment. ?

This can be done by updating the SYSTEM_TASK_ABS_MEM and SYSTEM_TASK_ABS_CPU variables as env variable in awx_task container in the AWX deployment file or updated in the settings info of AWX config map(restart is required after updating it here). These variables are being used in AWX capacity calculation code(getenv/getattr(settings)). You can also increase the number of forks with this env variable: SYSTEM_TASK_FORKS_CPU.

Hope this helps.

Thanks and Regards,
Mani