Copying VM Snapshot to other host not working (attempts to create a container(?))

Hey there,

I was testing my backup strategy today.
As I created VMs as well recently, i wanted to test, whether they can be copied easy to another host running LXD.

Both hosts run LXD 4.0.x LTS with ZFS file system.

But strange is, that a I cannot copy a VM instance snapshot to another host while the instance is running.

I mean it is clear that I cannot copy the raw (non-snapshot) instance while running (Error: Unable to perform VM live migration: Not implemented), but I thought copying a snapshot would work (at least there is no error message). Is this supposed to work?

When issueing lxc copy test/snap0 backup:test while the instance is running, the process starts as usual, but the disk is not copied over and the process takes forever (printing no error messages), while the instance is at least created in the database on the remote host.

When running lxc list on the backup host, it seems that the instance created is of type container instead of VM… Very strange behavior.

+--------------+---------+-------------------+-----------------------------------------------+-----------------+-----------+
|     NAME     |  STATE  |       IPV4        |                     IPV6                      |      TYPE       | SNAPSHOTS |
+--------------+---------+-------------------+-----------------------------------------------+-----------------+-----------+
| test3        | STOPPED |                   |                                               | CONTAINER       | 0         |
+--------------+---------+-------------------+-----------------------------------------------+-----------------+-----------+

Attempting to copy a stopped VM instance, copying of the raw instance (not a snapshot) works flawless (the created instance type is VM).

However it is also not possible to copy the snapshot of a stopped VM (same behavior as stated before).

If it is not possible to copy a VM-instance’s snapshot while running, it would be nice to see an according error message there…

It should be fine to do it, probably just a small bug in the receiving logic.
Do you get the same problem when performing a local copy from test/snap0 to test1 or something?

@tomp can you take a look at this one? should be an easy one to resolve.

@stgraber yep looks similar to

Nope, locally everything works. Copying succeeds if the VM is running or stopped.

Sounds similar to our situation:

The PR working to enable the parent volume to be mounted to enable copying ZFS VM snapshots is being worked on here: