No I don't want to trick LXD, I'm just looking for a way to delete the container while keeping its rootfs. In LXC you could tell the hipervisor to load the rootfs from a specific directory with the -P argument, however in LXD there's the
source option under the
disk type devices, but that parameter cannot be used for
rootfs disk. It seems LXD always expect to find the rootfs mounted on
/var/lib/lxd/containers/container_name/rootfs and I'm thinking in the possibility of launching a container from a different rootfs something like this, with -R being the rootfs argument.
lxc start container1 -R /tmp/rootfs1
I'm pretty sure you cannot do this using the CLI, but I don''t know if via the API it's possible. It would be like creating a container, via the CLI you always need to start the container from a base image, but with the API you can create a container wiht an empty rootfs.