Copy LXD container to another host

Yes. I am getting the same error both way. Is there any specific rsync or zfs setting required for live migration of LXD containers?

Can you try stopping the container and see if that helps, Iā€™m wondering if this is an issue with transferring the CRIU data, as the error ā€œ/tmp/lxd_restoreā€ is only mentioned in the source code for live transfer.

I am able to migrate the stopped container but facing difficulty in migrating a running container.

OK thanks Iā€™ve re-created your issue now, will take a look into solving it.

Thanks a lot.

Iā€™ve added a fix here:

Note that live migration with CRIU doesnā€™t work well with AppArmor, systemd or NICs, so you may still have a different error even with this fix.

Thanks!!
Are these changes/updates available on snap or i need to install lxc/lxd using source code?

We try to backport as much as we can, though weā€™ll slow down soon as LXD 3.20 is due on Thursday.

Thanks a lot guys for your support. I have one more question.
When we live migrate a virtual machine from one host to another, only VMā€™s memory state is transferred from host to destination. The disk state need not to be transferred as it is stored in a network attached storage. If live migration for container works, does it supports a similar setup where disk state is in a network attached storage and we can just transfer the memory states of the container to reduce the down time?

I refreshed the lxd to version 3.20 using snap. I tried to live migrate container after disabling apparmor then it gives message:
cannot change profile for the next exec call: No such file or directory
snap-update-ns failed with code 1: File exists
Then i enabled the apparmor and tried to live migrate then i get message:
Error: Failed instance creation: Error transferring container data: Failed to run: /snap/lxd/current/bin/lxd forkmigrate cont2 /var/snap/lxd/common/lxd/containers /var/snap/lxd/common/lxd/logs/cont2/lxc.conf /tmp/lxd_restore_846816044/final true:

How can we migrate by disabling apparmor as mentioned earlier by Thomas Parrott when snap is dependent upon apparmor i think?