Deregistering from an Operations Center

Is there an actual way to deregister an IncusOS machine from an Operation Center?

IIRC you can maybe do this from the Operations Center itself (>Provisioning >Server >ServerX >Delete) [I don’t have a working one right now, mid teardown atm] but if your Operations Center ends up destroyed for whatever reason then I don’t think there’s a mechanism to deregister via Incus CLI?

I’ve tried incus admin os system provider edit to update the key/token/(url) but the given IncusOS instance complains:
Failed to refresh Operations Center registration err=error from operations center: Failed self-updating from server "X.X.X.X:57182": Failed to find server ( ``https://X.X.X.X:8443``) with cause "" by certificate (fingerprint: XXXXX): Not authorized.

Interestingly, 8443 is not the port I specify in the provider config, it should be 7443 (as this is a proxy-port VM opcenter running on an IncusOS server, so 8443 was taken by the default Incus).

Jumping in. I have a server that was registrered to an old OC (no longer available) and I’d like to register it to a new one. Is this possible ?

It’s possible but not particularly easy. The current way to do it would be through the backup/restore mechanism, effectively getting a backup, altering the state.txt to remove the registration and then restoring that onto the server.

Given it’s possible to do through backup/restore, I don’t really see a reason not to relax the API for this. Feel free to file an issue at Sign in to GitHub · GitHub and we can relax some of the checks around that.

Thanks Stéphane, i’ll give that a whirl and i’ll raise a pull request too ( dwlfrth beat me too it, thanks!) - much appreciated!

Using the latest CLI (there was a recent fix for incus admin os system backup) actually made this fairly quick to sort out.

It turns out that the provider key+token were already updated in the backup file (from previously running incus admin os system provider edit) and so all that needed was changing System.Provider.State.Registered from true to false, and then restoring from backup.

The restoration process must actually trigger that “provider registration” again unlike simply editing Registered via the incus admin os system provider edit command.

Thanks again for the workaround :slight_smile: