i am using the command awx-manage (version 12.0.0, awx version 12.0.0) to add and remove instances automatically in the first case (adding an instance) the command works just fine:
awx-manage register_queue --queuename=MY_INCTANCE_GROUP --hostname=$HOSTNAME
after issuing the command above i can see that my new instance is added in the AWX GUI and also can see that the list "policy_instance_list" of my MY_INCTANCE_GROUP is updated via calling the api
https://awx_url/api/v2/instance_groups/MY_INCTANCE_GROUP_ID/
Now the problem is when i remove the instance, i can see that is removed from AWX GUI but it stays in the list "policy_instance_list" of my MY_INCTANCE_GROUP which can cause sometimes errors like AWX trying to execute a job on non existing instance
#the command i use to remove an instance
awx-manage remove_from_queue --queuename=MY_INCTANCE_GROUP --hostname=$HOSTNAME
#or
awx-manage deprovision_instance --hostname=$HOSTNAME
NB: if i use the AWX GUI the instance is removed successfully, plus i can't find any api to delete an instance without using awx-manage
any help will be appreciated