field link-local not found in type netplan.Ethernet

Bug #1919144 reported by Arif Ali
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Medium
Achilleas Anagnostopoulos

Bug Description

juju version: 2.8.9
MAAS verwsion: 2.9.2
series: bionic

# Problem

When creating an LXD container by running the following command

juju add-machine lxd:0 --constraints "spaces=oam"

I get an error below

machine 0/lxd/1 failed to start: failed to bridge devices: bridge activation error: yaml: unmarshal errors:
  line 5: field link-local not found in type netplan.Ethernet
  line 7: field link-local not found in type netplan.Ethernet
  line 9: field link-local not found in type netplan.Ethernet
  line 11: field link-local not found in type netplan.Ethernet
  line 13: field link-local not found in type netplan.Ethernet
  line 15: field link-local not found in type netplan.Ethernet
  line 17: field link-local not found in type netplan.Ethernet

# What I expect

I expect that the LXD container to be created

# What I did to get to this point

I have been trying to get around the issue for LP 1831892. When you have a machine deployed with bridges already deployed on the spaces, and then create LXD container as above, the container is created, and there is no problems.

# Steps to re-produce

1. Add a new machine using "juju add-machine"
2. juju ssh to the machine, and update all the interfaces so that "link-local: []", similar to [1]
3. Then run "netplan apply"
4. Now, run the command below, and we will get the error as shown above

juju add-machine lxd:0 --constraints "spaces=oam"

# Logs

Enabled TRACE logging using the command below, and the relevant logs from the machine are in [2]

juju model-config logging-config="<root>=TRACE"

# Workaround

1. Remove the link-local configuration from netplan configuration (without re-applying, as the link-local configuration would gave been applying by netplan originally)
2. Add the lxd container as per usual (This will now create the bridge)
3. Add the netplan configuration again (without-reapplying)

Now, all LXD containers will work as expected

[1] https://paste.ubuntu.com/p/tB35m3BwYp/
[2] https://paste.ubuntu.com/p/87JjDXFbn5/

Related Bug: #1831892

Changed in juju:
importance: Undecided → Medium
assignee: nobody → Achilleas Anagnostopoulos (achilleasa)
status: New → In Progress
Revision history for this message
Achilleas Anagnostopoulos (achilleasa) wrote :

PR https://github.com/juju/juju/pull/12772 adds `link-local` to the supported set of fields when unmarshalling netplan configurations. This should allow the above 'juju add-machine' invocation to work as expeected.

Changed in juju:
milestone: none → 2.8.11
Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
milestone: 2.8.11 → 2.8.10
Changed in juju:
status: Fix Committed → Fix Released
Revision history for this message
Arif Ali (arif-ali) wrote :

Hi @achilleasa,

Thanks for this, and have gotten around to test this today

I have, unfortunatley encountered a problem. When I have a seperate file in /etc/netplan with the extra configuration for netplan with link-local, adding the lxd machine fails, and the hypervisor loses all networking

Below is the log from the hypervisor (I added a password, and logged in manually after the fact, to get the details)
https://paste.ubuntu.com/p/kCs9CXdWWw/

Below is my juju model-config cloudinit-userdata
https://paste.ubuntu.com/p/prcc586HfY/

As you can see, I am adding an extra file called /etc/netplan/99-post-juju.yaml, and adding the link-local there.

But, when the lxd container is created, and the bridging re-done by juju, I get the following in /etc/netplan/99-juju.yaml

https://paste.ubuntu.com/p/SwfRh7K3h2/

Which is unexpected. I would expect it to combine the configs together.

Further on, when I add the link-local: [] to 50-cloud-init.yaml, after I have deployed it. juju does not respect the updated configuration, and the new configuration created as 99-juju.yaml will not have link-local, as shown below

root@as2-maas-node-06:/etc/netplan# grep link 99-juju.yaml
root@as2-maas-node-06:/etc/netplan# grep link 50-cloud-init.yaml.bak.1617018956
            link-local: []
            link-local: []
            link-local: []
            link-local: []
            link-local: []
            link-local: []
            link-local: []

Any thoughts on this would be appreciated

Happy to test this, as this is a local lab environment where I have deployed

Revision history for this message
Achilleas Anagnostopoulos (achilleasa) wrote :

AFAICT juju does not currently support merging of multiple netplan config files (https://github.com/juju/juju/blob/2.9/network/netplan/netplan.go#L360-L363) and instead replaces any entries it has read so far (last read wins).

There is a relevant old bug about this https://bugs.launchpad.net/juju/+bug/1701429 but it is marked as wont-fix. I will ask around to see why this was never implemented.

Revision history for this message
Achilleas Anagnostopoulos (achilleasa) wrote :

I have re-opened https://bugs.launchpad.net/juju/+bug/1701429 to support merging of netplan configurations.

Revision history for this message
Arif Ali (arif-ali) wrote :

Thanks for your effort on this :)

that will help with the first issue I had.

The second issue was, although juju did not complain about "link-local: []" in the netplan from /etc/netplan/50-cloud-init.yaml (with my manual changes), it did not carry over the config to 99-juju.yaml.

Revision history for this message
Achilleas Anagnostopoulos (achilleasa) wrote :

@arif-ali I proposed a PR for LP1701429 that should take care of these issues.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.