Removing a unit agent manually to reuse a server

I have a dead controller and a few models with machines/units attached.

Maas cloud, physical servers.

I want to re-use some of these nodes without reinstalling them from ground up but rather just use ‘juju add-machine ssh@xxxx’ once I have managed to remove completely the juju-agent on the machines.

How do I remove the unit-agent to allow this to happen and be able to reuse the server with a new juju controller ?

Do the servers have the /sbin/remove-juju-services script?

I think that’s what you’re looking for, but you should have a quick read of the script (it’s quite short) to make sure it doesn’t remove anything you’d like to keep.

2 Likes

Thats a great lead!

I’m also trying to wrestle myself into a controller that has a certificate expired for candid.

As I’m not really interested in recovering the whole thing, I’m however trying to extract a list of all nodes that are atteched to the controller in one way or the other.

I need to get this information from the mongodb database I assume, I’m just not sure on how to do that. Is this something you know how to do? I’ll ask also in char.charmhub.io

Thanx for helping me out.

Nope, that script isnt available… perhaps I can rip it from somewhere?

https://github.com/juju/juju/blob/develop/scripts/removejujuservices.bash

2 Likes

Thanx!

It worked.