LXD: 4.0.5
I have two servers, one is Ubuntu with ZFS and another is Ubuntu with BTRFS. (I think the two server is not relevant since the issue is repeatable with just one server).
BTRFS server setup: When installing Ubuntu server, i created a separate partition and formatted with BTRFS during Ubuntu install.
During the LXD initialisation process, I did this.
Name of the storage backend to use (ceph, btrfs, dir, lvm) [default=btrfs]:
Create a new BTRFS pool? (yes/no) [default=yes]: no
Name of the existing BTRFS pool or dataset: /btrfs
I created an ubuntu container on my Ubuntu server with ZFS, created a dummy file using
head -c 20GB /dev/urandom > data.bin
I then took a snapshot then copied to a ubuntu server with BTRFS, and now when I check the disk usage, it reports it as only 14MB.
Results from lxc info dummy
Probably related to this: https://github.com/lxc/lxd/issues/8468