Copying container from 3.0 to 2.0 host

This must be a very unusual use case, but I actually want to copy a container from a host running LXD 3.0.2 (18.04 stable) to one running 2.0.11 (16.04 stable). I needed push migration support to do an lxd-p2v, but now want to move the container to another host. Despite many options to override configuration, I couldn’t get rid of the unknown key pool when migrating.

lxc copy container host:
Error: Failed container creation: Invalid device configuration key for disk: pool

I was able to solve this by creating a profile and attaching it to my container, then moving the root device to the profile and removing it from the container config. I made a copy of the profile with the same name on the destination host, but without the offending pool key. Posting here in case it helps someone else.

Indeed LXD’s API and config is backward compatible but not forward compatible, so 3.0 to 2.0 isn’t exactly supported and you may indeed need to resort to tricks like profiles so you can remove some device keys or config keys during the transfer.

Glad that it worked well for you though!