lxc copy --refresh in ZFS deletes CT target volume after network interruption
Required information
- Distribution: Ubuntu
- Distribution version: 22.04
- LXD version: 5.14
- Storage backend in use: ZFS
Issue description
I use copy --refresh to backup containers daily. LXD 5.14 in both servers. I have autosnapshots in source cts with a 7 day retention.
After a network failure during a lxc copy --refresh, my target instance was deleted on ZFS. Repeating the command:
lxc copy cb2:zammad zammad-backup --refresh Error: Failed instance creation: Error transferring instance data: Failed migration on target: Failed creating instance on target: Volume exists in database but not on storage
The only way to correct is removing this target machine and copy all again.
Steps to reproduce
- lxc copy sourceserver:ct ct-backup --refresh
- disable network to cause a transfer interrupt
- An error occurs and taget volume was deleted, but machine exists in db
https://github.com/lxc/lxd/pull/11823#issuecomment-1604646813
Have same issue on Ubuntu 22.04 and LXD 6.1 with ZFS storage:
- Execute
lxc copy --refresh ct target-host:cton source server - Simulate network interrupt: disable network,reboot target server, etc
- Previously successful backup from target server deleted. Container is present in output of
lxc listbut volume has gone. On source server following error:
Error: Failed instance creation: Error transferring instance data: Failed migration on target: Failed creating instance on target: Volume exists in database but not on storage