network-manager on uc20 gets new ip address in recover mode
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snappy-hwe-snaps |
New
|
Undecided
|
Unassigned |
Bug Description
After building a new image with network-manager in the snaps section of the model and specifying that network-manager should be included in both run mode and recover mode, I notice that the device gets a different IP address when transitioning to recover mode compared to the IP address the device gets on first boot into run mode.
From what I can tell, what I think happens actually is that on the first boot in run mode, systemd-networkd automatically gets an IP address, then after seeding finishes, network-manager takes over and gets a new, different IP address. Then when transitioning to recover mode, again systemd-networkd runs and gets an IP address (which I think is the same IP address that networkd got before network-manager started up in the first boot of run mode), then seeding in the tmpfs of the recover mode proceeds and network-manager starts up again, and network-manager takes over and gets another IP address, but the IP address that it gets is different from the one that network-manager ended up with during the first boot of run mode.
The expectation is that network-manager upon starting up in recover mode gets the same IP address it had in run mode.
I am attaching relevant logs for network-manager, the output of `ip a show` and the config files that are all written to /etc/netplan. I used console-conf to configure the device but it was ethernet so there was nothing to configure for the networking in that part of the setup process.
In order to reproduce this you need to ensure that network-manager is an included recover mode snap, by building your own image with your own model assertion, something like this:
```json
{
"type": "model",
"series": "16",
"authority-id": "some-id",
"brand-id": "some-id",
"model": "ubuntu-
"architecture": "arm64",
"timestamp": "2020-03-
"base": "core20",
"grade": "dangerous",
"snaps": [
{
"name": "pi",
"type": "gadget",
"id": "YbGa9O3dAXl88Y
},
{
"name": "pi-kernel",
"type": "kernel",
"id": "jeIuP6tfFrvAdi
},
{
"name": "core20",
"type": "base",
"id": "DLqre5XGLbDqg9
},
{
"name": "snapd",
"type": "snapd",
"id": "PMrrV4ml8uWuEU
},
{
"name": "network-manager",
]
}
]
}
```
Here are the associated logs from recover mode