I recently migrated my 4-node LXD cluster to Incus. Since then I’ve had issues with refreshing storage volumes backed by ZFS across nodes in the cluster. This is the error:
$ incus storage volume cp local/apache2 local/apache2 --target=daphne --destination-target=yogi --refresh
Error: Failed to run: zfs destroy -r local/custom/default_apache2: exit status 1 (cannot destroy 'local/custom/default_apache2': dataset is busy)
If I detach the volume from the instance, delete it, and try a full copy, it works without issue. After attaching the volume to the instance and trying to refresh, I get the same error.
If I don’t attach the volume to the instance first and try to refresh, I get this error:
$ incus storage volume cp local/apache2 local/apache2 --target=daphne --destination-target=yogi --refresh
Error: Failed to run: zfs snapshot -r local/custom/default_apache2@copy-4684ffb1-fbe7-47a7-8af1-8431be5f70e9: exit status 2 (cannot open 'local/custom/default_apache2': dataset does not exist
usage:
snapshot [-r] [-o property=value] ... <filesystem|volume>@<snap> ...
For the property list, run: zfs set|get
For the delegated permission list, run: zfs allow|unallow)
It looks like the correct ZFS path should be local/lxd/custom/default_apache2. This is something that worked before the migration and I haven’t changed the storage pool location since then.
When I run the refresh copy without a full copy first, it gives:
Error: Failed generating volume copy config: Storage volume "test-refresh" in project "default" of type "custom" does not exist on pool "local": Storage volume not found
Then, trying again with a full copy, then a refresh:
$ incus storage volume copy local/test-refresh local/test-refresh --target daphne --destination-target yogi
Storage volume copied successfully!
$ incus storage volume copy local/test-refresh local/test-refresh --target daphne --destination-target yogi --refresh
Error: Failed to transfer main volume: Failed to wait for receiver: cannot receive: failed to read from stream cannot restore to local/custom/default_test-refresh@snapshot-52a9bddd-988f-49fd-a603-8fe0037bd37e: destination already exists : exit status 1
Same error each time after trying to create and then delete a snapshot.