Merge lp:~raharper/curtin/trunk.fix-ubuntu-core-network-config into lp:~curtin-dev/curtin/trunk

Proposed by Ryan Harper
Status: Merged
Merged at revision: 494
Proposed branch: lp:~raharper/curtin/trunk.fix-ubuntu-core-network-config
Merge into: lp:~curtin-dev/curtin/trunk
Diff against target: 65 lines (+34/-2)
3 files modified
curtin/commands/curthooks.py (+1/-1)
examples/tests/ubuntu_core.yaml (+32/-0)
tests/unittests/test_curthooks.py (+1/-1)
To merge this branch: bzr merge lp:~raharper/curtin/trunk.fix-ubuntu-core-network-config
Reviewer Review Type Date Requested Status
Scott Moser (community) Approve
Server Team CI bot continuous-integration Approve
Lee Trager (community) Needs Fixing
Review via email: mp+322880@code.launchpad.net

Description of the change

uc16 curthooks: add 'network' key to config file

When deploying UC16 with a network config, ensure that we include the
top-level 'network' key for cloud-init to detect network configuration.

Update vmtest and unittest to exercise network path.

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Scott Moser (smoser) wrote :

This seems reasonable.
It seems also possible that you could shove the ubuntu install path through this path.
You could just provide a config that ahd some late_commands or somethign that removed the network config disabling that curtin does and instead writes the config as done in UC16.

Revision history for this message
Ryan Harper (raharper) wrote :

On Thu, Apr 20, 2017 at 4:26 PM, Scott Moser <email address hidden> wrote:

> This seems reasonable.
> It seems also possible that you could shove the ubuntu install path
> through this path.
> You could just provide a config that ahd some late_commands or somethign
> that removed the network config disabling that curtin does and instead
> writes the config as done in UC16.
>

ACK, we will hit this path when I resume pass-through networking tests.

>
>
> --
> https://code.launchpad.net/~raharper/curtin/trunk.fix-
> ubuntu-core-network-config/+merge/322880
> You are the owner of lp:~raharper/curtin/trunk.fix-
> ubuntu-core-network-config.
>

Revision history for this message
Lee Trager (ltrager) wrote :

I tested this with lp:~ltrager/maas/ubuntu-core-simplestreams. While Curtin successfully deploys Ubuntu Core, sends MAAS the installation output, and reboots the deployed system has no network connectivity. MAAS doesn't mark a machine as deployed until it receives a message from cloud-init on the deployed system so the status stays deploying until it times out and goes into failed deployment.

I booted into rescue mode and poked around /system-data/etc/. No interfaces are configured in /etc/network. /etc/netplan/50-cloud-init.yaml[1] is configured and looks correct but networking never comes up. I monitored network traffic during the deployment and after the system reboots it emits no traffic at all.

[1] http://paste.ubuntu.com/24428726/

review: Needs Fixing
Revision history for this message
Ryan Harper (raharper) wrote :

Turns out we need an updated nplan in the image.

https://bugs.launchpad.net/ubuntu/+source/nplan/+bug/1668693

I've proposed a fix; was approved but not yet landed.

https://code.launchpad.net/~raharper/netplan/+git/netplan/+merge/318545

In the meantime, I'm rebuilding the curtin UC16 image with an updated nplan
with the MTU fix applied.

490. By Ryan Harper

Add MTU in network config to force poke nplan

491. By Ryan Harper

merge from trunk

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Scott Moser (smoser) :
review: Approve
Revision history for this message
Ryan Harper (raharper) wrote :

<rharper> ltrager: did you get a chance to update your streams with the 4/24 curtin-ubuntu-core image and see if that resolved your network config issue?

<ltrager> rharper, roaksoax: Yes I did its available at http://XXXXXXXXX/ubuntu-core/
<ltrager> I tested some basic network configs and those seem to work

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'curtin/commands/curthooks.py'
2--- curtin/commands/curthooks.py 2017-03-24 16:34:05 +0000
3+++ curtin/commands/curthooks.py 2017-04-24 18:13:44 +0000
4@@ -738,7 +738,7 @@
5 ubuntu_core_netconfig = os.path.join(cc_target,
6 "50-network-config.cfg")
7 util.write_file(ubuntu_core_netconfig,
8- content=config.dump_config(netconfig))
9+ content=config.dump_config({'network': netconfig}))
10
11
12 def target_is_ubuntu_core(target):
13
14=== modified file 'examples/tests/ubuntu_core.yaml'
15--- examples/tests/ubuntu_core.yaml 2017-02-17 19:29:33 +0000
16+++ examples/tests/ubuntu_core.yaml 2017-04-24 18:13:44 +0000
17@@ -11,3 +11,35 @@
18 snappy:
19 email: raharper@gmail.com
20 packages: [hello, part-numpy, part-cython]
21+
22+network:
23+ version: 1
24+ config:
25+ # Physical interfaces.
26+ - type: physical
27+ name: interface0
28+ mac_address: "52:54:00:12:34:00"
29+ subnets:
30+ - type: dhcp4
31+ - type: physical
32+ name: interface1
33+ mtu: 1492
34+ mac_address: "52:54:00:12:34:02"
35+ subnets:
36+ - type: static
37+ address: 10.0.2.100/24
38+ - type: static
39+ address: 10.0.3.100/24
40+ - type: static
41+ address: 10.0.4.100/24
42+ - type: static
43+ address: 10.0.5.100/24
44+ - type: static
45+ address: 10.0.2.200/24
46+ dns_nameservers:
47+ - 8.8.8.8
48+ dns_search:
49+ - barley.maas
50+ - type: physical
51+ name: interface2
52+ mac_address: "52:54:00:12:34:04"
53
54=== modified file 'tests/unittests/test_curthooks.py'
55--- tests/unittests/test_curthooks.py 2017-03-22 15:34:21 +0000
56+++ tests/unittests/test_curthooks.py 2017-04-24 18:13:44 +0000
57@@ -284,7 +284,7 @@
58 'system-data',
59 'etc/cloud/cloud.cfg.d',
60 '50-network-config.cfg')
61- netcfg = config.dump_config(cfg.get('network'))
62+ netcfg = config.dump_config({'network': cfg.get('network')})
63 mock_write_file.assert_called_with(netcfg_path,
64 content=netcfg)
65 self.assertEqual(len(mock_del_file.call_args_list), 0)

Subscribers

People subscribed via source and target branches