lxd icon indicating copy to clipboard operation
lxd copied to clipboard

lxc copy --refresh in ZFS deletes CT target volume after network interruption

Open alepaes1975 opened this issue 2 years ago • 2 comments

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

  1. lxc copy sourceserver:ct ct-backup --refresh
  2. disable network to cause a transfer interrupt
  3. An error occurs and taget volume was deleted, but machine exists in db

alepaes1975 avatar Jun 12 '23 13:06 alepaes1975

https://github.com/lxc/lxd/pull/11823#issuecomment-1604646813

tomponline avatar Jun 26 '23 02:06 tomponline

Have same issue on Ubuntu 22.04 and LXD 6.1 with ZFS storage:

  1. Execute lxc copy --refresh ct target-host:ct on source server
  2. Simulate network interrupt: disable network,reboot target server, etc
  3. Previously successful backup from target server deleted. Container is present in output of lxc list but 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

Doublefull avatar Jul 15 '24 10:07 Doublefull