LXD VM on ZFS copy fails - is it supported?

When copying an LXD-driven VM from a ZFS-backed host another ZFS-backed host, I am getting:

$ lxc copy h1:vm1 h2:vm1 --refresh --stateless --mode relay
cannot open 'system/lxd/containers/vm1': dataset does not exist
<...>

This would suggest it is trying to make a container fs for the remote VM and fails.

Should lxc copy support this? Would a --vm flag make sense to create a VM on the target too (but suggesting we could transform them on copy which is likely not quite the case)?

It works the same as with containers. Tested with:
lxc copy <vmname> <remote-host>:<vmname>

Not sure about the --mode relay option.

To add, the vm has snapshots. That was the cause of another recent issue with copy, maybe here as well.

With or without --mode relay (but still from remote to remote, not local to remote as @TomvB mentions above), I get:

$ lxc copy h1:vm1 h2:vm1-bak --stateless --refresh
Error: Failed instance creation:
 - https://h1:8443: Error transferring instance data: zfs send failed: [exit status 2] (incremental source must be in same filesystem

It turns out it works when the vm is stopped. So running vm + --stateless is the issue here.

I also tested running local to remote just to make sure, so the mode or hosts involved do not affect the issue as such.

@TomvB are you running on ZFS and able to reproduce with running container and --stateless?

Error transferring instance data: zfs send failed: [exit status 2] (incremental source must be in same filesystem
usage:
        send [-DnPpRvLecwhb] [-[i|I] snapshot] <snapshot>
        send [-nvPLecw] [-i snapshot|bookmark] <filesystem|volume|snapshot>
        send [-nvPe] -t <receive_resume_token>

Did not test the move. But it fails indeed with --stateless.

Edit: I copy and migrate containers and VMs always offline. CRIU doesn’t work well with LXD in my experience. I’m still waiting for a good alternative.

We are now tracking it here:

1 Like