MIgrated to snap, containers not getting IPs

Migrated to LXD 3.0 on snap, but now the containers are not getting any IPv4 addresses. I managed to get the containers working after the migration but now after a reboot the containers are not getting addresses anymore. It seems that the LXD dnsmasq is not running but i cannot find any logs that would indicate why…

I have set most of the containers to use static IPs like this:

devices:
eth0:
ipv4.address: 10.4.73.100
name: eth0
nictype: bridged
parent: lxdbr0
type: nic

but containers with static IPs or DHCP are not getting anything according to lxc list:

±----------±--------±-----±-----±-----------±----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
±----------±--------±-----±-----±-----------±----------+
| atlassian | RUNNING | | | PERSISTENT | 1 |
±----------±--------±-----±-----±-----------±----------+
| kemvit | STOPPED | | | PERSISTENT | 0 |
±----------±--------±-----±-----±-----------±----------+
| mariadb | RUNNING | | | PERSISTENT | 0 |
±----------±--------±-----±-----±-----------±----------+
| meteor | RUNNING | | | PERSISTENT | 0 |
±----------±--------±-----±-----±-----------±----------+
| neos-dev | RUNNING | | | PERSISTENT | 1 |
±----------±--------±-----±-----±-----------±----------+
| tamlk | RUNNING | | | PERSISTENT | 0 |
±----------±--------±-----±-----±-----------±----------+
| tbox | RUNNING | | | PERSISTENT | 0 |
±----------±--------±-----±-----±-----------±----------+
| test | RUNNING | | | PERSISTENT | 0 |
±----------±--------±-----±-----±-----------±----------+
| top20 | STOPPED | | | PERSISTENT | 1 |
±----------±--------±-----±-----±-----------±----------+
| webmindev | RUNNING | | | PERSISTENT | 0 |
±----------±--------±-----±-----±-----------±----------+
| zabbix | STOPPED | | | PERSISTENT | 0 |
±----------±--------±-----±-----±-----------±----------+

Hmm, seems that creating a new bridged network and removing the old lxdbr0 did the trick…

Odd. Would have been interesting to see the network config prior to that reset.

Network didn’t really change between 2.21 and 3.0, assuming that’s the upgrade you did. If you upgraded from 2.0 to 3.0, then there may be more migration bits that could have gone wrong.

My usual suspect with those symptoms is dnsmasq failing to start for some reason, can be ip/port conflict or can be some files it couldn’t read. In either case, deleting and creating a new network would have reset that.

The odd thing was that after the migration, it worked with lxdbr0 and then it did not, I noticed that one container had lost it’s eth0 address but was still connected to it’s tun0 iface… then after rebooting the host, lxdbr0 did not work at all…

Hmm, now that i think of it… I had a remnant of 2.0 network config in the lxdbr0 config, it was looking for the file /etc/lxd-dnsmasq.conf which the snap of course could not find… Might that be the reason?

When you migrate to the snap, you run

lxd.migrate

You are asked whether to remove the deb LXD. There might have been an issue there, where the old LXD have left its dnsmasq running.