May 25, 20242 yr Hello! I'm using Unraid 6.12.10 and recently started using ZFS on one of the pools. I'm now facing a small issue with backing up virtual machines stored in the ZFS pool: I haven't found a simple way of making a "consistent" backup of the virtual machine disks. To elaborate, when using XFS I had a scheduled User script like this: echo "Backing up machine XXX" cp --reflink=always "/mnt/disk1/domains/XXX/vdisk1.img" "/mnt/disk1/domains/XXX/vdisk1-SNAPSHOT.img" cp "/mnt/disk1/domains/XXX/vdisk1-SNAPSHOT.img" /mnt/backuppool/virtualmachines rm "/mnt/disk1/domains/XXX/vdisk1-SNAPSHOT.img" It makes a consistent snapshot of the disk image and copies it into another pool, so no matter how hard I screw up the original pool, the backup can be found from the other pool. With ZFS the "--reflink=always" does not work, and I'm afraid that without using it, the copies might become corrupted. I've watched the ZFS videos by Spaceinvader One, where the backup script plays the Imperial march tune and all kinds of cool features, but that seems overly complicated for my use case. I want to KISS. Any tips on what kind of script should I use with ZFS?
May 25, 20242 yr If you have a backup pool also using zfs you can snapshot them and incrementally send/receive to that volume.
May 25, 20242 yr Author Thanks for the suggestion! The backup pool is not currently ZFS, but I could convert it to be. Do you think these commands would work on Unraid as well or should I use something else: https://serverfault.com/questions/812351/synchronize-zfs-pools-fast ?
May 25, 20242 yr ? run the plugin to backup the vm> appdat backup and/or: full disk data backups: Edited May 25, 20242 yr by bmartino1
May 26, 20242 yr 14 hours ago, Iivo said: Do you think these commands would work on Unraid Yes, Unraid uses standard zfs.
May 27, 20242 yr Author Thanks for the suggestions! I'll start experimenting and will get back with the results. The VM Backup plugin is not as "production grade" as I would like it to be (it's in beta and the only developer is quite busy). Due to the plugin status I actually made a feature request for Lime back in 2022 to help make it stable or include similar features in Unraid, and the response was "That's a very requested feature and one we plan on adding in the future, but no ETA for now"
May 28, 20242 yr 6.13 will support VM snapshots, and you can take native zfs snapshots if they are stored on zfs, will still need to run a script to send/receive to a different device/server.
December 29, 20241 yr Author Finally I had the time to finish the backup configuration during the Xmas vacations. I installed the QEMU guest agent to all VMs I could to enable the snapshot feature in the VM Backup plugin - the snapshot feature is a must. I moved any problematic VMs back to the Array (XFS) and I'll use the old User script backup script for these. For example pfSense has the QEMU guest agent installed and the network interface listing is visible in Unraid, but when the backup starts, an error occurs: "failure: snapshot command failed on pfsense-vdisk2.snap for pfSenseXXX." "failure: snapshot_fallback is 0. skipping backup for pfSenseXX to prevent data loss. no cleanup will be performed for this vm.". I checked that the virtual disk paths are not using /mnt/user, but didn't investigate much further. Edit: under the "Number of backups to keep" tooltip it mentions that if multiple vdisks are present, they need to be sequentially numbered - there is only one vdisk in this VM, but it ends with 2, could maybe be an issue... This solution is good enough for now, let's see if something changes with Unraid 7. Have a happy new year! Edited December 29, 20241 yr by Iivo
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.