ZFS snapshots of docker.img, libvirt.img and vdisks


Ruato
Go to solution Solved by JorgeB,

Recommended Posts

Long-time satisfied Unraid user here. I am planning on migrating my two SSD brtfs cache pool to ZFS based on the excellent and informative videos by SpaceinvaderOne. In the videos, he explains how to setup appdata snapshots. However, I am wondering whether ZFS snapshots can be utilized also for docker.img, libvirt.img and vdisk images. That is, is it safe to take uncorrupted ZFS snapshots on them while VMs and docker containers are running?

Link to comment
  • Solution

Any btrfs/zfs snapshot taken of a running VM will be crash consistent, it's better than nothing but ideally would also create some snapshots with the VMs off/hibernated, I for example take automatic live snapshots everyday but once a week hibernate the VMs and take a manual snapshot.

 

Libvirt should not be a problem having the service running, dockers also not as much, but it may depend on the containers.

  • Thanks 1
Link to comment
  • 5 months later...
On 9/6/2023 at 5:39 AM, JorgeB said:

Any btrfs/zfs snapshot taken of a running VM will be crash consistent, it's better than nothing but ideally would also create some snapshots with the VMs off/hibernated, I for example take automatic live snapshots everyday but once a week hibernate the VMs and take a manual snapshot.

 

Libvirt should not be a problem having the service running, dockers also not as much, but it may depend on the containers.

I'm starting my new build (new to unraid) and been researching about the best file system to use for the cache pool with my use case.  Either BTRFS or ZFS, I will only be using 2 x 2TB SSDs on Raid1/Mirror.  This will be my forever cache pool 2TB (total size) as it is more than enough for my needs, frankly an overkill.

 

I also bought another 2TB ssd and initially planned to format that to ZFS and will be used for replication of the 2TB mirrored ZFS SSD.

 

Which brings me to my concern and question and since I stumbled on this reply, maybe you can help or suggest on this.

 

I will have two VMs (Windows VM and Home Assistant HAOS) and probably 3-4 dockers and that is it.  If I will add more in the future, it will only be docker containers and no more VMs.

 

I've been doing some research and was told that VM snapshot in ZFS is only good for data at rest.  The VMs I plan to install don't fall on that "data at rest" category. 

 

This became a real concern of mine as VM snapshot restore is essential to me because it had saved me multiple times in the past. I currently use VMWare Workstation on a Windows Server but want to ditch it in favor of unraid.

 

However, I do have the luxury of shutting them both down before doing a snapshot (via script or automation) like you mentioned it being ideal.  I won't even entertain the idea of doing Live snapshots as to me each snapshot created should be valid and restore-able if needed. 

 

My Home Assistant VM will probably do 2x a week snapshot and the Windows VM probably once every 2 weeks (right before patch Tuesday).

 

Will I get better results of a VM snapshot in ZFS when they are both turned off before doing so?

 

Should I just ditch ZFS and go with BTRFS instead for a more reliable VM Snapshot restore?

 

Thanks!

Edited by war_pig
spelling
Link to comment
1 hour ago, war_pig said:

Will I get better results of a VM snapshot in ZFS when they are both turned off before doing so?

Like mentioned above snapshots with the VMs off is better since they won't be in a crash consistent state.

 

1 hour ago, war_pig said:

Should I just ditch ZFS and go with BTRFS instead for a more reliable VM Snapshot restore?

They are both the same regarding this issue.

 

  • Thanks 1
Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.