I do backups of (container) instances to another server by running copy --refresh.
Recently I also added some Ubuntu VMs which have been migrated from VMware using incus-migrate. These VMs are working fine so far, including the snapshots created with snapshots.schedule. Now these VMs fail with a subsequent copy --refresh
Error: Failed instance creation: Error transferring instance data: Failed migration on target: Failed creating instance on target: Snapshot "snapshot-27" cannot be restored due to subsequent snapshot(s). Set zfs.remove_snapshots to override
latest snapshot on source is snapshot-29 and latest snapshot on target is snapshot-27
Interestingly such a vm has two devices having different last snapshots (27 vs. 28) on the target:
The two ZFS volumes is normal for VMs, but them not having snapshots be in sync, that part isn’t normal. Can you check what incus snapshot list dc1 shows on the target as well as incus storage volume list zpool1 al on that target?
Basically trying to figure out what Incus thinks is there, then we can make sure that reality lines up and see if that sorts it out.
One additional info: the first copy attempt failed because a source path for a disk device at the target was missing. This has been fixed before the second copy attempt.
On source incus:
[snip of full list]
+-------------+----------------------+----------------------+----------+
| snapshot-26 | 2024/01/29 07:59 CET | 2024/02/28 07:59 CET | NO |
+-------------+----------------------+----------------------+----------+
| snapshot-27 | 2024/01/29 11:59 CET | 2024/02/28 11:59 CET | NO |
+-------------+----------------------+----------------------+----------+
| snapshot-28 | 2024/01/29 15:59 CET | 2024/02/28 15:59 CET | NO |
+-------------+----------------------+----------------------+----------+
| snapshot-29 | 2024/01/29 19:59 CET | 2024/02/28 19:59 CET | NO |
+-------------+----------------------+----------------------+----------+
| snapshot-30 | 2024/01/29 23:59 CET | 2024/02/28 23:59 CET | NO |
+-------------+----------------------+----------------------+----------+
zfs list -t snapshot ssd1/virtual-machines/dc1 ssd1/virtual-machines/dc1.block
ssd1/virtual-machines/dc1@snapshot-snapshot-26 104K - 7.25M -
ssd1/virtual-machines/dc1@snapshot-snapshot-27 104K - 7.25M -
ssd1/virtual-machines/dc1@snapshot-snapshot-28 104K - 7.25M -
ssd1/virtual-machines/dc1@snapshot-snapshot-29 108K - 7.25M -
ssd1/virtual-machines/dc1@snapshot-snapshot-30 108K - 7.25M -
ssd1/virtual-machines/dc1@snapshot-snapshot-26 104K - 7.25M -
ssd1/virtual-machines/dc1@snapshot-snapshot-27 104K - 7.25M -
ssd1/virtual-machines/dc1@snapshot-snapshot-28 104K - 7.25M -
ssd1/virtual-machines/dc1@snapshot-snapshot-29 108K - 7.25M -
ssd1/virtual-machines/dc1@snapshot-snapshot-30 108K - 7.25M -
on target incus:
incus snapshot list dc1
[snip]
+-------------+----------------------+----------------------+----------+
| snapshot-26 | 2024/01/29 06:59 UTC | 2024/02/28 06:59 UTC | NO |
+-------------+----------------------+----------------------+----------+
| snapshot-27 | 2024/01/29 10:59 UTC | 2024/02/28 10:59 UTC | NO |
+-------------+----------------------+----------------------+----------+
zfs list -t snapshot zpool1/virtual-machines/dc1 zpool1/virtual-machines/dc1.block
zpool1/virtual-machines/dc1@snapshot-snapshot-26 104K - 7.25M -
zpool1/virtual-machines/dc1@snapshot-snapshot-27 104K - 7.25M -
zpool1/virtual-machines/dc1@snapshot-snapshot-28 104K - 7.25M -
zpool1/virtual-machines/dc1@snapshot-snapshot-29 108K - 7.25M -
zpool1/virtual-machines/dc1.block@snapshot-snapshot-26 4.48M - 8.52G -
zpool1/virtual-machines/dc1.block@snapshot-snapshot-27 0B - 8.52G -
I will try to delete / copy one of these VMs from scratch having the required paths for disk devices in place.
btw. It would be nice to have a force feature on copy which should not fail to be able to fix config / devices after copy.
very strange: even if I remove these two snapshots the issue persists:
incus copy lxc04:dc1 dc1 --refresh
Error: Failed instance creation: Error transferring instance data: Failed migration on target: Failed creating instance on target: Snapshot "snapshot-27" cannot be restored due to subsequent snapshot(s). Set zfs.remove_snapshots to override
zfs list -t snapshot zpool1/virtual-machines/dc1.block
[snip]
zpool1/virtual-machines/dc1.block@snapshot-snapshot-25 7.21M - 8.31G -
zpool1/virtual-machines/dc1.block@snapshot-snapshot-26 4.48M - 8.52G -
zpool1/virtual-machines/dc1.block@snapshot-snapshot-27 0B - 8.52G -
incus snapshot list dc1
[snip]
+-------------+----------------------+----------------------+----------+
| snapshot-25 | 2024/01/29 03:59 CET | 2024/02/28 03:59 CET | NO |
+-------------+----------------------+----------------------+----------+
| snapshot-26 | 2024/01/29 07:59 CET | 2024/02/28 07:59 CET | NO |
+-------------+----------------------+----------------------+----------+
| snapshot-27 | 2024/01/29 11:59 CET | 2024/02/28 11:59 CET | NO |
+-------------+----------------------+----------------------+----------+
incus storage volume list zpool1|grep dc
[snip]
| virtual-machine (snapshot) | dc1/snapshot-25 | | block | 0 |
| virtual-machine (snapshot) | dc1/snapshot-26 | | block | 0 |
| virtual-machine (snapshot) | dc1/snapshot-27 | | block | 0 |
I tried to delete another VM from the target and copied that one again. The first copy attempts is successfull but the second fails for the same cannot be restored due to subsequent snapshot(s) error although the snapshots and incus db seem to be in sync.
sure - It took me some time to create a reproducible testcase. In the end, it is the missing incus-agent that provokes the error.
btw - since the incus-migrate seems not to configure/install the incus-agent, what are the “official” steps to install it? I found Ship multiple VM agent binaries #263 but not how to do the bind-mount. For my tests I downloaded the deb package from debian sid and installed it inside the ubuntu vm. When creating a vm via cloud image I see incus-agent running from /run/incus_agent/incus-agent but I don’t yet get how this is beeing mounted/started.