[UC20][NETPLAN] Add net plan configuration to gadget.yaml but still get default configuration in system

Bug #2025737 reported by ChunAnWu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OEM Priority Project
Confirmed
Critical
ChunAnWu
snapd
New
Undecided
Unassigned

Bug Description

we added the configuration below to gadget.yaml

###
    system:
      network:
        netplan:
          network:
            version: 2
            ethernets:
              en1:
                match:
                  driver: imx-dwmac
                addresses:
                  - 192.168.0.200/24
                set-name: en1
              en2:
                match:
                  driver: fec
                dhcp4: true
                dhcp6: true
                set-name: en2
              all-lan:
                match:
                  name: "lan*"
                dhcp4: true
                dhcp6: true
              all-eth:
                match:
                  name: "eth*"
                dhcp4: true
                dhcp6: true
###

but what we got in system by command "snap get -d system" is configuration below
looks like it append our configuration not override.

###
        "system": {
                "hostname": "ubuntu",
                "network": {
                        "netplan": {
                                "network": {
                                        "ethernets": {
                                                "all-en": {
                                                        "dhcp4": true,
                                                        "match": {
                                                                "name": "en*"
                                                        }
                                                },
                                                "all-eth": {
                                                        "dhcp4": true,
                                                        "dhcp6": true,
                                                        "match": {
                                                                "name": "eth*"
                                                        }
                                                },
                                                "all-lan": {
                                                        "dhcp4": true,
                                                        "dhcp6": true,
                                                        "match": {
                                                                "name": "lan*"
                                                        }
                                                },
                                                "en1": {
                                                        "addresses": [
                                                                "192.168.0.200/24"
                                                        ],
                                                        "match": {
                                                                "driver": "imx-dwmac"
                                                        },
                                                        "set-name": "en1"
                                                },
                                                "en2": {
                                                        "dhcp4": true,
                                                        "dhcp6": true,
                                                        "match": {
                                                                "driver": "fec"
                                                        },
                                                        "set-name": "en2"
                                                }
                                        },
                                        "version": 2
                                }
                        }
                },
###

Tags: oem-priority
ChunAnWu (kiya956)
Changed in oem-priority:
assignee: nobody → ChunAnWu (kiya956)
importance: Undecided → Critical
status: New → Confirmed
Revision history for this message
Michael Vogt (mvo) wrote :

Yeah, this is a bug/misfeature. The easiest workaround might be:
"""
    system:
      network:
        netplan:
          network:
            version: 2
            ethernets:
              all-en: null
...
"""

Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

Setting the configuration from cloud.conf from the gadget could be an option to workaround the issue while this get fixed, as snap pack seems to not be very happy about the null entry in all-en.

Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

This seems to be caused by netplan not cleaning up config as expected (by setting network=null):

test@ubuntu:~$ sudo busctl call io.netplan.Netplan /io/netplan/Netplan/config/MIL071 io.netplan.Netplan.Config Set ss 'network=null' "00-snapd-defaults"
b true
test@ubuntu:~$ sudo busctl call io.netplan.Netplan /io/netplan/Netplan/config/MIL071 io.netplan.Netplan.Config Get
s "network:\n version: 2\n ethernets:\n all-en:\n match:\n name: \"en*\"\n dhcp4: true\n all-eth:\n match:\n name: \"eth*\"\n dhcp4: true\n"

Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

There was some misunderstanding on how to use the dbus interface.

https://github.com/snapcore/snapd/pull/12961 has been proposed with a fix.

Rex Tsai (chihchun)
tags: added: oem-priority
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.