I wrote a simple script for backing up containers on a remote LXD instance. What it does is simple: it stops containers, snapshots them, copies them to remote and starts them again. However, I have a problem with a single VM instance. If it doesn’t exist on the remote, it gets copied just fine. But the next time the script will run, I’m getting:
Error: Failed instance creation: Error transferring instance data: Failed migration on target: Failed creating instance on target: More recent snapshots must be deleted: [snapshot-2023-06-13_2
2-19-59]
It references the snapshot that was created right before the copy operation. I’m using copy --refresh. What’s going on here? What’s weird is that this issue appears to be affecting only a single VM instance, but it’s a single one on my list. The rest of instances are containers. Why would this happen only to VM? I would expect the same copy behavior for all instances. Do you guys have any idea what’s going on here?
But it seems to get copied. However, after performing the snapshot and copying again, I’m getting:
Error: Failed instance creation: Error transferring instance data: Failed migration on target: Failed creating instance on target: Snapshot "snapshot-2023-06-14_04-00-45" cannot
be restored due to subsequent snapshot(s). Set zfs.remove_snapshots to override
And after setting: volume.zfs.remove_snapshots: "true" on the remote’s pool I’m going back to:
Error: Failed instance creation: Error transferring instance data: Failed migration on target: Failed creating instance on target: More recent snapshots must be deleted: [snap0]
I got this Set zfs.remove_snapshots to override error before, I just forgot that I set this value, and yesterday I unset it, as an experiment.
BTW. There seems to be something wrong with snap channels:
Notice that 5.14/stable is empty, but it’s latest/stable points into 5.14. I had to use candidate. That’s why I didn’t upgrade to 5.14, I didn’t realize that it’s available because 5.14/stable was empy.