Rename cluster members and change address

Hi

I’ve needed to change the domain suffix on the LXD cluster members, so done:

  • the host via hostnamectl set-hostname
  • and lxc cluster rename

These have successfully handled the NAME component of the cluster members but there are still components that are using the old name, e.g. URL in this list:

lxc cluster list
+-------------------------------+--------------------------------------------+------------------+--------------+----------------+-------------+--------+-------------------+
|             NAME              |                   URL                      |      ROLES       | ARCHITECTURE | FAILURE DOMAIN | DESCRIPTION | STATE  |      MESSAGE      |
+-------------------------------+--------------------------------------------+------------------+--------------+----------------+-------------+--------+-------------------+
| clustermember1.new-domain.net | https://clustermember1.old-domain.net:8443 | database-standby | x86_64       | default        |             | ONLINE | Fully operational |
+-------------------------------+--------------------------------------------+------------------+--------------+----------------+-------------+--------+-------------------+
| clustermember2.new-domain.net | https://clustermember2.old-domain.net:8443 | database-leader  | x86_64       | default        |             | ONLINE | Fully operational |
|                               |                                            | database         |              |                |             |        |                   |
+-------------------------------+--------------------------------------------+------------------+--------------+----------------+-------------+--------+-------------------+

and the member’s self-signed certificate CN that was generated during lxd init.

The old domain will not be resolvable in the future so I need to get rid of these references. Is there an in-place method of renaming these references (and others that I’m not aware of), and if so what is the procedure? I see that Stephane answered this question back in 2019 but wondered whether things have changed since then?

Thanks

Hi @mratt,

Unfortunately it is currently not possible to change the address of a cluster member while it is live. You will need to remove each member, remove LXD and reinstall on that member, and rejoin it. Let us know if you need any help with this.

Thanks, Mark.

Hi Mark

Thanks for the reply and advice. Thought as much but it’s good to get this knowledge before I break things. Am fortunate that I’ll be able to follow what you said when the remaining server freed up for LXD, so shifting instances around to do this will be possible.

Have a good evening :slight_smile:

1 Like