Lxd in clustered configuration: lxc copy makes full copy on same machine with btrfs, is it normal?

Ubuntu 18.04 from apt, lxd version 3.0.3

TL/DR Update:
Just tested on virtualbox on new ubuntu installation and 3.0.3 with single cluster node, no weird mounts nothing, everything defaults except cluster=yes and lxc copy does full copy, and doesnt use btrfs snapshoting features.

Thats “killer” bug?feature?(i guess it works as intended) right here and in here https://lxd.readthedocs.io/en/latest/ it doesnt even mention that, I dont know any technical details why cluster works this way, but at least with btrfs driver there is just no point in using clustered mode at all as it works as with “dir” driver.

Hello, I made lxd cluster from two machines with btrfs. Now realised that “lxc copy xx xx2” does full copy (on same storage pool), it show transfer speeds like I would transfer to some remote. Lxc snapshot works fine.

I checked with

btrfs subvolume show xx ; btrfs subvolume show xx2

on test machine with default(no cluster) configuration and parent UUID matches just fine, but on clustered machine btrfs subvolume UUIDS doesnt match.
Clustered lxd actually uses “btrfs send” commands

Problem is I dont even know if this is normal lxd behavior (doubt it) or my configuration is fundamentally wrong or its a bug, sadly systems went semi “live”, I was about to add more machines to cluster. If you need any more info I can provide.

Info about storage
root@cluster-linux: lxc storage show ssd
config: {}
description: ""
name: ssd
driver: btrfs
used_by:
- /1.0/containers/salt-del
- /1.0/images/6700bee14eb3034ba4bd0c3d0165f938faa161d2690e919465aab2946490689b
- /1.0/profiles/default
- /1.0/profiles/disable_internet
status: Created
locations:
- cluster-linux
- dragon-ball-radar

root@cluster-linux: lxc storage show hdd
config: {}
description: ""
name: hdd
driver: btrfs
used_by:
- /1.0/containers/wiki
- /1.0/containers/zabbix
- /1.0/profiles/default_hdd
status: Created
locations:
- cluster-linux
- dragon-ball-radar

FSTAB
 There is two  two storages "ssd" and "hdd"
/ is on hdd
UUID=SSD /var/lib/lxd    btrfs   relatime,subvol=@var-lxd
UUID=HDD /var/lib/lxd/storage-pools/hdd  btrfs   relatime,subvol=@hdd-lxd
/var/lib/

I’d have to check. It could be that we unconditionally go through the migration API when copying containers on a cluster, which would then use send/receive rather than snapshotting. This obviously makes sense when going across node but not so much sense for the local case.

I’d have to test on LXD 3.11 to see how it’s behaving there and whether something needs to be tweaked (I also can’t recall if that behavior is decided by the client or by the daemon).

Just tested on same virtualbox with ubuntu snap lxd 3.11 version. (first purged all apt packages)

Same behavior. Uses btrfs send /receive.

I guess it’s an optimization that we’d want to put in place.

Should I register bug? I want to track status on this case.

Yeah, you can file a bug for it, I’ll take a look at it soon, hopefully it will be pretty straightforward.