LXD - Failed container creation - No root device could be found
After upgrading LXD from 2.0.x to 3.2, with everything at first looking hunky dory, I discovered after a few days that I couldn't create new containers any more!
$ lxc launch ubuntu:bionic testcontainer
Error: Failed container creation: No root device could be found
WTF!
On another host which received the same upgrade, however, everything still worked fine. After checking if there were any differences in the configuration, I found something missing in the default profile, in the devices section.
On the host where everything worked:
devices:
eth0:
name: eth0
nictype: bridged
parent: br0
type: nic
root:
path: /
pool: default
type: disk
On the one which DIDN'T work:
devices:
eth0:
name: eth0
nictype: bridged
parent: br0
type: nic
AHA! The entire 'root' section is gone! Why didn't it get added in the first place? I don't know.
Adding it was easy though, just did "lxc profile edit default" and pasted it in, and everything works fine.
Weird stuff.