Renaming a node in a cluster

I messed up my naming convention a bit when rolling out my cluster. I’d like to change the name of one of my nodes. Is there any way to do this without interrupting service?

I don’t think there is any official way to do this but I can’t think of any real issue with renaming nodes either.

@freeekanayaka should we just allow renames in the API?

For now, you can try lxd sql global "UPDATE nodes SET name='new-name' WHERE name='old-name';"

I would expect this to work fine but you may want to do a systemctl reload snap.lxd.daemon on all the cluster members once done with the renames, just in case we’re tracking some in-memory state based on their names.

Worked, thanks :slight_smile:

For those who want to do this now there is an “lxc cluster rename old-name new-name”.

For some reason it doesn’t “systemctl reload snap.lxd.daemon” or clean up its internal cruft automagically but it works.