Merge lp:~rvb/maas/fix-etc-hosts-bug-1087183-2 into lp:~maas-committers/maas/trunk

Proposed by Raphaël Badin
Status: Merged
Approved by: Raphaël Badin
Approved revision: no longer in the source branch.
Merged at revision: 3253
Proposed branch: lp:~rvb/maas/fix-etc-hosts-bug-1087183-2
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 28 lines (+6/-2)
2 files modified
src/maasserver/compose_preseed.py (+5/-1)
src/maasserver/tests/test_compose_preseed.py (+1/-1)
To merge this branch: bzr merge lp:~rvb/maas/fix-etc-hosts-bug-1087183-2
Reviewer Review Type Date Requested Status
Christian Reis (community) Approve
Graham Binns (community) Approve
Review via email: mp+236709@code.launchpad.net

Commit message

Use the default /etc/hosts/ instead of having cloud-init override it.

Description of the change

For a long discussion about why we need this change, see the related bug. In short: we want dns_resolve(hostname) to return the node's IP address instead of 127.0.0.1.

Packages built using this branch are available for testing in https://code.launchpad.net/~rvb/+archive/ubuntu/maas.

To post a comment you must log in.
Revision history for this message
Graham Binns (gmb) :
review: Approve
Revision history for this message
Raphaël Badin (rvb) wrote :

I'm not landing this just now as we want people to test it first.

fwiw, this is what happens on a deployed node with the current config: http://paste.ubuntu.com/8473237/

This is what happens with this change: http://paste.ubuntu.com/8473238/

The only difference is on the last line.

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Lets aslk the Landscape team to test this please!
On Oct 1, 2014 4:26 PM, "Raphaël Badin" <email address hidden> wrote:

> The proposal to merge lp:~rvb/maas/fix-etc-hosts-bug-1087183-2 into
> lp:maas has been updated.
>
> Description changed to:
>
> For a long discussion about why we need this change, see the related bug.
> In short: we want dns_resolve(hostname) to return the node's IP address
> instead of 127.0.0.1.
>
> Packages built using this branch are available for testing in
> https://code.launchpad.net/~rvb/+archive/ubuntu/maas.
>
> For more details, see:
>
> https://code.launchpad.net/~rvb/maas/fix-etc-hosts-bug-1087183-2/+merge/236709
> --
>
> https://code.launchpad.net/~rvb/maas/fix-etc-hosts-bug-1087183-2/+merge/236709
> You are subscribed to branch lp:maas.
>

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I couldn't get nodes to work, see https://bugs.launchpad.net/maas/+bug/1378479

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Bug was marked as invalid, because this code isn't merged yet, but it has the details.

Revision history for this message
Christian Reis (kiko) wrote :

Andreas retested later with the beta in the testing PPA:

<andreas> kiko: so, https://bugs.launchpad.net/maas/+bug/1378479 also happened with a fresh install from the testing ppa. Can't get a working node.

The symptom is as he described in bug 1378479; basically networking comes up dead. It feels to me like it's actually an unrelated issue, given that the beta version works. I'll ask for more information in the bug.

Revision history for this message
Christian Reis (kiko) wrote :

I will deploy your PPA branch tomorrow and will report back on what the effect was.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

https://bugs.launchpad.net/maas/+bug/1378479 has all the latest. I reproduced it on a brand new maas installation first by installing an older version and confirming maas works. Then I upgraded to the version in the testing ppa and it broke. I believe it's not related to the change in this MP, you just happen to have branched off a trunk version that had the problem already. But until that is fixed, I can't verify it for you.

Revision history for this message
Raphaël Badin (rvb) wrote :

1379591 is fixed now. I just merged trunk into my lp:~rvb/maas/fix-etc-hosts-bug-1087183-2/ branch. The new packages are available in https://code.launchpad.net/~rvb/+archive/ubuntu/maas.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Ok, I will give it a run

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

The package in maas-maintainers/experimental is more recent than yours, fyi.
     1.7.0~beta6+bzr3246-0ubuntu1~trusty1 0
        500 http://ppa.launchpad.net/maas-maintainers/experimental/ubuntu/ trusty/main amd64 Packages

     1.7.0~beta5+bzr3199+3166+318~ppa0~ubuntu14.04.1 0
        500 http://ppa.launchpad.net/rvb/maas/ubuntu/ trusty/main amd64 Packages

And I have 1.7.0~beta6+bzr3232-0ubuntu1~trusty1 installed. I'll try a downgrade.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Got some oopses during a deployment, not sure if related to the changes in this branch:

https://pastebin.canonical.com/118726/

Revision history for this message
Gavin Panella (allenap) wrote :

> Got some oopses during a deployment, not sure if related to the
> changes in this branch:
>
> https://pastebin.canonical.com/118726/

I think you can ignore these. This code hasn't changed in an age so it's almost certainly not related.

Revision history for this message
Gavin Panella (allenap) wrote :

Filed as bug 1381129.

Revision history for this message
Raphaël Badin (rvb) wrote :

> The package in maas-maintainers/experimental is more recent than yours, fyi.

Arg, rebuilding packages now…

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I deployed Landscape using this version of MAAS into containers on node 0, and all worked fine (including rabbitmq-server, notoriously picky about hostnames). I cannot test a cloud installer yet, since we are in a sprint week and people might need to demo a cloud in a hurry, so I can't risk breaking our MAAS clusters this week.

I also of course verified that /etc/hosts does NOT have the 127.0.1.1 entry.

Revision history for this message
Christian Reis (kiko) wrote :

Merge it.

review: Approve
Revision history for this message
Raphaël Badin (rvb) wrote :

Thanks for testing this Andreas!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/compose_preseed.py'
2--- src/maasserver/compose_preseed.py 2014-08-17 10:42:28 +0000
3+++ src/maasserver/compose_preseed.py 2014-10-14 15:50:53 +0000
4@@ -37,7 +37,11 @@
5 })
6
7 local_config_yaml = yaml.safe_dump({
8- "manage_etc_hosts": "localhost",
9+ # Do not let cloud-init override /etc/hosts/: use the default
10+ # behavior which means running `dns_resolve(hostname)` on a node
11+ # will query the DNS server (and not return 127.0.0.1).
12+ # See bug 1087183 for details.
13+ "manage_etc_hosts": False,
14 "apt_preserve_sources_list": True,
15 })
16 # this is debconf escaping
17
18=== modified file 'src/maasserver/tests/test_compose_preseed.py'
19--- src/maasserver/tests/test_compose_preseed.py 2014-09-20 15:42:12 +0000
20+++ src/maasserver/tests/test_compose_preseed.py 2014-10-14 15:50:53 +0000
21@@ -115,7 +115,7 @@
22 data = yaml.safe_load(value)
23
24 self.assertIn("manage_etc_hosts", data)
25- self.assertEqual(data["manage_etc_hosts"], "localhost")
26+ self.assertEqual(data["manage_etc_hosts"], False)
27 self.assertIn("apt_preserve_sources_list", data)
28 self.assertEqual(data["apt_preserve_sources_list"], True)
29