[Resolved] Removed Machine from Cattle and cannot re-add it

I deleted a host and tried to re-add it but it will not show up. I removed all images from the host and all running containers.

I then re-did the command to add the host (from Step 5 on the Add host screen) but it will not show up in the Hosts pages with the others.

I checked the running containers on the host I am trying to add and the agent is running properly:

CONTAINER ID        IMAGE                  COMMAND                  CREATED             STATUS                      PORTS               NAMES
549bee6114c6        rancher/agent:v1.0.2   "/run.sh run"            24 minutes ago      Up 24 minutes                                   rancher-agent
335050e60ea7        rancher/agent:v1.0.2   "/run.sh state"          24 minutes ago      Exited (0) 24 minutes ago                       rancher-agent-state
3bc1f194df5c        rancher/agent:v1.0.2   "/run.sh http://opens"   24 minutes ago      Exited (0) 24 minutes ago                       sharp_babbage

Remove the agent containers, rm -rf /var/lib/rancher/state (on the host), then run the registration command again. The state dir contains a UUID for the host and the server is ignoring the registration because it’s coming from “the same” host that it knows was deleted.

1 Like

Awesome that worked.