How to add another lxd-host as a separate region for a juju controller

I have setup a second lxd-host which I would like to place as a separate region rather than a cloud.

How do I add this new lxd-host to my already running controller in my first lxd-host?

I’m not sure if it’s possible. There might be lxd magic to combine the two lxd hosts into a cluster. But would juju then understand?

Will a multi-cloud controller work as an alternative? Depending on why you would prefer not to have the new lxd-host as a separate cloud.

You must specify a region when creating a model to use one other than the default. At model creation you’d specify the second lxd cloud instead.

Absolutely! How do I do this given that I already have one normal controller up?

Check out the section " Managing multiple clouds with one controller" of Juju | Add clouds

Additional details on the feature can be found: Feature Highlight: Multi-cloud controller

1 Like

Studying the docs, I see that by running “juju add-cloud”, I could specify multiple regions api endpoints…

Perhaps the downside is that I wouldn’t perhaps be able to use differet credentials for different regions?

But the above image tells me that I would in fact be able to use a second remote on a different lxd-host?

Consider:

clouds:
  my-lxd-cloud:
    type: lxd
    auth-types: [certificate]
    regions:
      region-1:
        endpoint: https://lxd1.localdomain:8443
      region-2:
        endpoint: https://lxd2.localdomain:8443

Would this cause problems?

@hallback have you done this in your end ?

It’s expected the all regions in a cloud use the same credentials. I’d be surprised if this worked as expected. Multi-cloud controllers would allow for different credentials.

1 Like

For update.

I managed to add the lxd host as a separate cloud and it works just fine for me.

But this lead up to thoughts about what is the manifestation really is for “regions”?

Questions like:

  • What does it mean really for a controller/juju to specify a region?
  • What it the underlying primitives for a cloud-region?
  • Is it only a meta construct without meaning to some clouds or what is it?
  • Adding/removing regions - what does that mean?

Yeah, I can’t get my head around it.

In general, this tells juju which region of a cloud to use deploying machines in a model. You can specify which model to use in a specific model. Typically machines cannot span regions in public clouds. Regions are constructs of most public clouds. You can checkout juju regions aws for some well known regions in AWS.

It gets murky with some private clouds juju enables use of, such as localhost and microk8s, especially when they are run on your local machine. OpenStack and MaaS do have regions.

For lxd/localhost, a region isn’t yet well defined. Some thoughts on the topic were included in the original pr, but have not been mapped out and tested yet.

1 Like