Backing up VMs in 25.10+

Hello Everyone,
I’ve been searching around how to backup VMs in TrueNAS 25.10 CE - and didn’t find anything reasonable… (nor any thread here in the forum)

Am I missing something? What’s the recommended way to backup VMs?

Is there something coming up in TrueNAS 26+?

Things I looked into:

  • configuration
    • seems to be backed up up with TrueNAS’ config backup - but restoring an individual VM’s configuration seems to be manual reconfiguring the machine…
    • probably possible using virsh dumpxml - unsure if restore also works …
  • disk images
    (freezing the VM with virsh*, creating a zfs snapshot, thawing with virsh, doing the actual backup and finally removing the snapshot)
    • zsend
      • seems to be fine, as long as you have a secondary ZFS based nas - and don’t want to do any cloud based backup
      • for cloud based backup - using zsend with an image file as an intermediate target could be an option
    • exporting the disk images to qcow2 and backing them up with kopia, borgbackup, …
      would probably work… but adds quite some extra storage requirement (and I’m unsure if kopia’s/borg’s deduplication methods would still work… - exporting to raw would probably solve that part - adding even more storage needs)
    • backing up the block device with something like kopia, borgbackup, …
      this seems to be a possible way to handle it… but I couldn’t find any well tested script to do that (could ask some AI to provide one… untested…) and at least with kopia this doesn’t seem to be an easy to do thing (for many VMs)

Not working/possible (to my knowledge)

  • virsh backup-begin - seems to be unsupported for zvol
  • using qcow2 for the disks in TrueNAS

Ingo

p.s.: coming from Proxmox, I know, that VM functionality is somewhat limited in comparison… that’s fine - or at least accepted… but no backup seems to be the deal breaker for me.

*I’m aware, that TrueNAS tries to hide virsh… but I didn’t find corresponding functionality in TrueNAS api, closest I could find was: clone VM, backup, delete clone

There is none.

I just back up my VMs from “inside”. Then if i have to restore a VM, I boot the corresponding restore ISO.

Not quite true:

  • Place all your VMs’ virtual disk ZVOLs in a common parent dataset.
  • Create a recursive snapshot task for that dataset, define frequency and retention as fits your needs.
  • Create a replication task based on that snapshot task to another system running at least ZFS and SSH.

Backup in TrueNAS is generally implemented by ZFS’ builtin mechanisms. The whole orchestration is accessible from the UI.

1 Like

True.

But whats the deal with taking snapshots of a running VM ? Is that ok ?

@pmh thanks for your suggestion - but wouldn’t that be more or less what I described with zsend? including the limitations of not being able to do a cloud backup?

@Farout you’re right… I missed that one. Doing backups from “within” the VM would probably give the best suited backup. at the expense of having to configure (and monitor) all of them individually - this I would want to avoid. (yeah.. I’m lazy…)

as for creating snaptshots from running machines causing issues - as usual, it probably depends. I wouldn’t want to do that on a high load database, but I’d probably take the risk of doing the same on a rarely used windows client VM,

Well it could potentially lead to data loss of data in RAM not having been written to disk when the snapshot occurs. Is it likely to cause a real problem ? Probably not really. But to be on the safe side: shut down the vm, snapshot the zvol and start it again.

Yes. Would be convenient to have a GUI option that shuts down the VM and restarts it after the snapshot/replication task.

Kind of like proxmox does it.