Hacker News new | past | comments | ask | show | jobs | submit login

Unless the vm does all its writes synchronously, it's probably better to use zfs on the vm instead of snapshotting the zvol the vm is sitting on.



Could you explain this? I thought snapshots are part of the whole vector chain in zfs? Or do you mean using ZFS in the Guest VM?


So you have zfs on the VM host, that is, where you run your VMs...

When the VM goes to do a write, the VM thinks the data is on disk, but it could still be sitting in the ZIL/SLOG on the host. If you run into issues with the SLOG, you could potentially lose writes and scramble the zvol.

Of course you can get around this somewhat by using sync=always on the zvol, at the cost of write performance. While I've never had issues from incomplete writes, it seems bad to risk leaving the host in charge of when the data actually gets written.

Not to mention, if you're using a filesystem on the VM that writes all over the zvol, you wind up snapshotting more blocks than you need to if you leave it up to the host.

On my setup, I run with sync=always/logbias=throughput/primarycache=none/secondarycache=none for the zvol, and use zfs in the VM... as well as make the snapshots inside the VM.


Interesting, thank you. Did not know this. Maybe my knowledge of ZFS needs some improvement :-)


I won't claim to be a zfs expert, and most of this is based on my interpretation of using zfs for the past ~5 years. If I'm wrong, hopefully someone will correct me. ;-)




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: