Use Case
Terraform Enterprise (TFE) or Terraform Cloud (TFC) agents have limited management in the UI once they are deployed. The agents cannot be stopped or started in the UI.
Killing the shell where the agent is running or shutting down the instance may cause an orphan agent in the agent pool. To stop agents gracefully (to avoid orphaned agents in the agent pool) requires accessing the instance where the agent process is running.
Prerequisites (if applicable)
Procedure
To control the TFE or TFC agent stop/start operations gracefully on the instance you can do the following
- Connect to the instance running the agent
-
Run a
docker ps
to list the active agents containers and additional information such as the name of the container. Note the name of the container -
If the container is running execute a
docker stop <container-name>
and checkhttps://$tfe-url-name/app/$orgname/settings/agents
to ensure the agent is no longer reporting in. -
Then run
docker start <container-name>
and to check locally if it's runningdocker ps
and to verifyhttps://$tfe-url-name/app/$orgname/settings/agents
the agents is reporting in.
Additional Information
- For additional assistance please contact HashiCorp Support to request additional assistance