@spkie regarding what “LXD clustering requires a majority of the nodes to be online” means, see @stgraber reply.
about 2, there is a “lxc cluster enable” command which lets you turn a non-clustered LXD instance (with or without existing configuration, containers, storage pools, etc, it doesn’t matter) into the first node of a new LXD cluster. However to join other nodes currently there is no “lxc cluster join” command, the only way is to use “lxd init” (either interactively or non-interactively by passing --preseed). The difficulty here is that at the very moment a new node requests to join a cluster, that node needs to have exactly the same storage pools and networks of the other nodes in the cluster, possibly with some configuration that is specific to the joining node (for instance if there’s a zfs pool defined, the joining node might want to specify its own backing disk device for it). This is described in the documentation. Now, since there can be any number of networks and storage pools, and since there are several per-node container config keys, coming up with a simple “lxc cluster join” command line is not straightforward, however it’s not impossible. Also, I don’t see a “lxc cluster join” command adding that much value compared to “lxd init --preseed < your-conf.yaml”, it would just be a different syntax (i.e. you’d have the yaml contained in “your-conf.yaml” turned into command line flags). Is there a reason why “lxc cluster join” would make your life easier? It seems to me that both “lxd init --preseed” and a possible “lxc cluster join” alternative work fine with ansible. @stgraber do we want to plan adding such a command?
Regarding joining nodes with existing containers, yes, that’s still the case, it’s not possible to have them join a cluster. Only the first node of the cluster can have existing configuration, new nodes must be “clean”.
I think there is room to improve the documentation about all this, although every bit I mentioned should be already in there, please correct me if I am wrong and we’ll amend the docs.