Copying storage volume snapshot only to another host. Am I missing something?

I am trying the following command:

lxc storage volume copy data/gitlab/2019121901 node20:data/gitlab

where I have:

root@node12:/data/bpool/custom# lxc storage volume list data
+----------------------+------------------------------------------------------------------+-------------+---------+
|         TYPE         |                               NAME                               | DESCRIPTION | USED BY |
+----------------------+------------------------------------------------------------------+-------------+---------+
| container (snapshot) | os-client/lxd-init                                               |             | 1       |
+----------------------+------------------------------------------------------------------+-------------+---------+
| custom               | gitlab                                                           |             | 1       |
+----------------------+------------------------------------------------------------------+-------------+---------+
| custom               | gitlab-artifacts                                                 |             | 1       |
+----------------------+------------------------------------------------------------------+-------------+---------+
| custom               | storage-test                                                     |             | 1       |
+----------------------+------------------------------------------------------------------+-------------+---------+
| custom (snapshot)    | gitlab-artifacts/2019121901                                      |             | 0       |
+----------------------+------------------------------------------------------------------+-------------+---------+
| custom (snapshot)    | gitlab/2019121901                                                |             | 0       |
+----------------------+------------------------------------------------------------------+-------------+---------+
| image                | 412fb387e01d8130016d300bbc33fbaee84c1b17ddfb7cb9f85ae63e0c4fa618 |             | 1       |
+----------------------+------------------------------------------------------------------+-------------+---------+
root@node12:/data/bpool/custom# lxc storage volume copy data/gitlab/2019121901 node20:data/gitlab
Error: not found

and on node20:

root@node12:/data/bpool/custom# lxc storage volume list node20:data
+--------+--------------+-------------+---------+
|  TYPE  |     NAME     | DESCRIPTION | USED BY |
+--------+--------------+-------------+---------+
| custom | storage-test |             | 1       |
+--------+--------------+-------------+---------+
| custom | test         |             | 16      |
+--------+--------------+-------------+---------+
root@node12:/data/bpool/custom#

Copying the storage volume entirely seems to work (it copies the snapshots also)

root@node12:/data/bpool/custom# lxc storage volume copy data/gitlab node20:data/gitlab # Works fine.

Is it because I am trying to copy the snapshot only and the base storage volume doesn’t exists in the destination node?

I am trying to do the same I would do for a container. Create a snapshot, and copy the snapshot alone, not the entire storage volume and all its snapshots

thanks
Luis

Snapshots cannot be copied independently from their parent.
I believe LXD 3.19 will have much better error handling around that kind of cases.

You can copy a snapshot into a new volume, but you can’t copy a snapshot from one existing volume to another.

OK. Thanks for the info.

I was using a different zfs dataset for storing my GIT repositories, attached as a path in the gitlab container, and have set daily snapshots and incremental backups to another host.

What I can see then is that the same is not possible if I use storage volumes right? Or can I, now that I have copied the parent volume, copy daily snapshots of it?

It seems to me that even after I have copied the parent storage volume I can’t copy the snapshots to another host.

I can’t copy the snapshot to a new volume in another host:


root@node12:~# lxc storage volume list node20:data