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
=== modified file 'curtin/commands/curthooks.py'
--- curtin/commands/curthooks.py 2017-03-24 16:34:05 +0000
+++ curtin/commands/curthooks.py 2017-04-24 18:13:44 +0000
@@ -738,7 +738,7 @@
738 ubuntu_core_netconfig = os.path.join(cc_target,738 ubuntu_core_netconfig = os.path.join(cc_target,
739 "50-network-config.cfg")739 "50-network-config.cfg")
740 util.write_file(ubuntu_core_netconfig,740 util.write_file(ubuntu_core_netconfig,
741 content=config.dump_config(netconfig))741 content=config.dump_config({'network': netconfig}))
742742
743743
744def target_is_ubuntu_core(target):744def target_is_ubuntu_core(target):
745745
=== modified file 'examples/tests/ubuntu_core.yaml'
--- examples/tests/ubuntu_core.yaml 2017-02-17 19:29:33 +0000
+++ examples/tests/ubuntu_core.yaml 2017-04-24 18:13:44 +0000
@@ -11,3 +11,35 @@
11 snappy:11 snappy:
12 email: raharper@gmail.com12 email: raharper@gmail.com
13 packages: [hello, part-numpy, part-cython]13 packages: [hello, part-numpy, part-cython]
14
15network:
16 version: 1
17 config:
18 # Physical interfaces.
19 - type: physical
20 name: interface0
21 mac_address: "52:54:00:12:34:00"
22 subnets:
23 - type: dhcp4
24 - type: physical
25 name: interface1
26 mtu: 1492
27 mac_address: "52:54:00:12:34:02"
28 subnets:
29 - type: static
30 address: 10.0.2.100/24
31 - type: static
32 address: 10.0.3.100/24
33 - type: static
34 address: 10.0.4.100/24
35 - type: static
36 address: 10.0.5.100/24
37 - type: static
38 address: 10.0.2.200/24
39 dns_nameservers:
40 - 8.8.8.8
41 dns_search:
42 - barley.maas
43 - type: physical
44 name: interface2
45 mac_address: "52:54:00:12:34:04"
1446
=== modified file 'tests/unittests/test_curthooks.py'
--- tests/unittests/test_curthooks.py 2017-03-22 15:34:21 +0000
+++ tests/unittests/test_curthooks.py 2017-04-24 18:13:44 +0000
@@ -284,7 +284,7 @@
284 'system-data',284 'system-data',
285 'etc/cloud/cloud.cfg.d',285 'etc/cloud/cloud.cfg.d',
286 '50-network-config.cfg')286 '50-network-config.cfg')
287 netcfg = config.dump_config(cfg.get('network'))287 netcfg = config.dump_config({'network': cfg.get('network')})
288 mock_write_file.assert_called_with(netcfg_path,288 mock_write_file.assert_called_with(netcfg_path,
289 content=netcfg)289 content=netcfg)
290 self.assertEqual(len(mock_del_file.call_args_list), 0)290 self.assertEqual(len(mock_del_file.call_args_list), 0)

Subscribers

People subscribed via source and target branches