Fix LXD domain name to be ".lxd" to match the default network configuration #6460

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
5 participants
Contributor

dooferlad commented Oct 17, 2016

This is a temporary fix until we can discover the correct domain.

Don't set manage_etc_hosts in cloudconfig/containerinit because it isn't needed for non-LXD provider cases (or so it seems).

Tested by checking that .lxd is the domain used in LXD environments

  1. Bootstrap a lxd environment + add a machine
  2. juju ssh 0 hostname -f
  3. ...should show hostname.lxd

Tested by checking that .lxd is not used in non-LXD environments (I tried MAAS)

  1. Bootstrap a non-LXD environment + add a machine
  2. juju ssh 0 hostname -f
  3. ...should show $hostname.$something where $something != 'lxd'.

I have also tested by deploying a rabbitmq-server cluster on LXD, which needs name resolution to work.

Fixes:
http://pad.lv/1563271
http://pad.lv/1633126

@@ -212,7 +212,7 @@ func (env *environ) newRawInstance(args environs.StartInstanceParams) (*lxdclien
cloudcfg.AddRunTextFile(serverCertPath, serverState.Environment.Certificate, 0600)
}
- cloudcfg.SetAttr("hostname", hostname)
+ cloudcfg.SetAttr("fqdn", hostname+".lxd")
@dimitern

dimitern Oct 17, 2016

Contributor

I'd like to see a test for this please.

@dooferlad

dooferlad Oct 17, 2016

Contributor

👍

@@ -212,7 +212,7 @@ func (env *environ) newRawInstance(args environs.StartInstanceParams) (*lxdclien
cloudcfg.AddRunTextFile(serverCertPath, serverState.Environment.Certificate, 0600)
}
- cloudcfg.SetAttr("hostname", hostname)
+ cloudcfg.SetAttr("fqdn", hostname+".lxd")
cloudcfg.SetAttr("manage_etc_hosts", true)
@frobware

frobware Oct 17, 2016

Contributor

The commit message says this is not needed. Which is correct?

@dooferlad

dooferlad Oct 17, 2016

Contributor

The commit message says manage_etc_hosts in cloudconfig/containerinit isn't needed. It was removed from there.

Commit message is missing QA steps and a link to the bug. Does LXD 2.4 (i.e., 16.10) still use .lxd as a domain? Any tests done against the public clouds?

Fix LXD domain name to be ".lxd" to match the default network configu…
…ration

This is a temporary fix until we can discover the correct domain.

Don't set manage_etc_hosts in cloudconfig/containerinit because it isn't needed for non-LXD provider cases (or so it seems).

Tested by checking that .lxd is the domain used in LXD environments
1. Bootstrap a lxd environment + add a machine
2. juju ssh 0 hostname -f
3. ...should show hostname.lxd

Tested by checking that .lxd is not used in non-LXD environments (I tried MAAS)
1. Bootstrap a non-LXD environment + add a machine
2. juju ssh 0 hostname -f
3. ...should show $hostname.$something where $something != 'lxd'.

I have also tested by deploying a rabbitmq-server cluster on LXD, which needs name resolution to work.

Fixes:
http://pad.lv/1563271
http://pad.lv/1633126
Contributor

dooferlad commented Oct 17, 2016

@frobware LXD > 2.3 has a property you can set to change the domain (lxc network get lxdbr0 dns.domain for example) that uses "lxd" as a default. Earlier versions read /etc/default/lxd-bridge and use the LXD_DOMAIN key (ini format). I intend to add the ability to read that property for later versions of LXD. I don't have a strong opinion about if we should try reading the ini file for older versions. Thoughts?

@mitechie mitechie closed this Oct 18, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment