ZFS Replication for CT and VM with Incus?

Let me invite you to try to use syncoid/sanoid in parallel with Incus-created snapshots from instances or storage volumes.

To copy or move an instance, using the snapshots of its storage volume under the hood, is currently possible.

copy also allows to --refresh an instance, --stateless, if so desired.

      --refresh                 Perform an incremental copy
      --refresh-exclude-older   During incremental copy, exclude source snapshots earlier than latest target snapshot

One could use a task scheduler with an engine of your choice to run this command repeatingly.


Looking at the existing implementation: Adding a --schedule=<CronSpec> option there could also be made available to configure regular execution of the job. Then this could also be added as a configuration option to the instance.

To Schedule snapshots of a custom storage volume a snapshots.schedule configuration option per volume is offered. We can reuse its syntax example.

In dream code:

copy:
  # either
  destination: [[<remote>:]<destination>]
  # or
  destination:
    name: [[<remote>:]<destination>]
    schedule: "0 0 * * *"
  # or
  destination:
    # when given, issues a one-off copy
    # if schedule: is also given, repeat
    - [[<remote>:]<destination>]
    - name: [[<remote>:]<destination>]
      # optional schedule, takes precedence over default schedule
      schedule: "0 6 * * *"
    - # …
  # optional default schedule
  schedule: @daily
  # [flags] as keys

copy: statements in the configuration also invite to allow a shorter syntax for one-time invocations of incus copy [<remote>:]<source>[/<snapshot>] without specifying additional parameters.

Maybe this is something we would like to schedule development time for?