bhyve Homelab hypervisor and NFS setup pattern

Hi,
I am setting up a very simple FreeBSD hypervisor in my homelab mainly for learning purpose as I am new to FreeBSD, Bhyve and ZFS.
- The host is pretty small: 12Gb of RAM and 500Gb of disk
- I opted for a very simple setup for now: ZFS with one disk and one zpool (zroot).
- I use vm-bhyve
- Simplicity is the goal for now, over performance
- I do care a bit about security
As I would prefer keeping the hypervisor/host very simple, so I plan to setup a first Freebsd guest running the NFS server and Syncthing (to share with mobile clients).
My question is:
What would be the best way to access the underlying storage from the guest VM?
After some research my initial idea is I should:
- Create an encrypted zvol on the host
- Attach it to the guest vm as explained here https://github.com/churchers/vm-bhyve/wiki/Virtual-Disks#custom-zvol-disk
- Format it to UFS from the guest gpart add -t freebsd-ufs -l data vtbd0

My first idea is to use UFS from the guest VM because I do not immediately see the benefits of doing ZFS on a zvol... apart from:
- the benefits of using zfs share
- it forces me to do the backups from the hypervisor/host (but I already need to backup the VMs from the host)
Are there any flaws in my reasoning and design?
If yes please tell me how you would do it.


Many thanks
 
Greetings.

- Create an encrypted zvol on the host
Optional you could install the guest encrypted Root-on-ZFS.

My first idea is to use UFS from the guest VM because I do not immediately see the benefits of doing ZFS on a zvol... apart from:
- the benefits of using zfs share
I wouldn't necessarily call zfs-share(8) a eminent benefit for using ZFS. It makes little difference if the NFS share is configured with "sharenfs" ( zfsprops(7) ) or /etc/exports.

What makes ZFS an outstanding file system is one of its abilities to create boot environments ( for details see bectl(8). Alternative tool sysutils/beadm ).

Furthermore, easy (automated) backups (zfs-snapshot(8) ), stored locally or on remote host (on another VM or bhyve(8) host - zfs-send(8), zfs-receive(8) ), the ability to zfs-rollback(8), to name a few. (For automated ZFS backup see ports for tools, or create your own script.)

You are planning to use Syncthing, easy regular backups can be important ( if some data accidentally gets deleted for example and Syncthing is not configured to keep all send data).

Once you get familiar with ZFS, you may not want to miss it as I do.

I have on all my devices (including VMs) ZFS. I am sure that most users of the forum will agree that ZFS is the file system of choice, except for special situations when UFS is the better choice.

Except for the file system, I don't see other recommandations to improve the setup. Perhaps other forums users may want to add a comment.
 
Thank you for your explanations ?


And yes the top ZFS support is one of the main reasons I am now working on migrating my infrastructure to FreeBSD.


I have on all my devices (including VMs) ZFS. I am sure that most users of the forum will agree that ZFS is the file system of choice, except for special situations when UFS is the better choice.

I have been reading a lot about whether one should use ZFS both for hosts and guests in a virtualization scenario (Meaning root on ZFS on both host and guest).
It does seems people have different opinions on this and I am trying to understand if I am in one of those special situation where UFS makes more sense for the guests.

In my case I understand I can just snapshot and rollback the whole zvol from the host and I do not necessarily need boot environments for lightweight VMs.
Also memory (12Gb or RAM) is my main constraint so I was rather considering formatting my zvols (root and NFS storage) to UFS. Because I do not yet have a feel on the memory overhead of ZFS and doing ZFS on ZFS might get it out of control...

But those are just my very novice assumptions...
 
Back
Top