Hi! This is an open discussion and I'm mostly curious about your general ideas and thoughts about the subject and a few struggles I'm having on my way. It's going to be a bit wall-of-texty. Sorry about that, I'll try to make it as easily digested as possible
It's about using small static VM images and provide persistent storage by other means.
Current bhyve guest storage
I currently use zvols for bhyve guests and extend storage by setting the zfs property
Build bare-minimal images instead of using official VM images
For the bhyve guests I use the official VM-IMAGES. This gives me a fullblown FreeBSD system with everything from finger(1), kerberos(8) and specialized drivers for bluetooth, atm, wireless etc. etc. Since my guests usually serves one very specific function, such as "share this filesystem", "run this webapp", "provide this network service" etc. This makes me tempted to use something like NanoBSD to build small images. With the existent helper functions and possibly with some small modifications I can build my own customized images. Either by providing static ones with prebuilt packages or do customizations when deploying new guests. NanoBSD is built on the idea of a read-only filesystem, where persistent storage for /etc is stored in a special /cfg filesystem. Any modifications made to /etc during runtime should be synchronized with /cfg to provide persistence between boots. /usr/local/etc is linked to /etc/local.
Struggle of customizing NanoBSD images
One thing that just have created problems for my self has been customizing the NanoBSD build. It's very easy breaking your build by setting various src.conf(5) variables. I wouldn't recommend anyone disabling stuff if you don't know what you are doing. I'm also a bit uncertain to which variables to use for installworld, buildworld and for both of them. As demonstrated in the example in the NanoBSD howto you have
Keeping things simple would be continuing to use the full FreeBSD release image. It isn't big problem, but I feel just because I have a big house doesn't mean I want to keep furniture around that I never use.
Persistent storage for bhyve guests
The workflow of using static images to deploy various functionality in virtual or various containerized environments isn't something new. I've seen a few where iSCSI provides raw block storage, or NFS for a network mountable system etc. There are also things like GlusterFS and Ceph. But I feel a bit lost in all of this and I'm not sure about to what extent FreeBSD support is provided.
Even though I like keeping things simple, I want something flexible. This is still a single node environment so I'm not sure about the enteprise scale storage systems is the way to go.
Using one guest that provides storage for other guests
The most simple idea I can come up with is to use a large zvol attached to a file server guest that provides NFS for other guests. Something like /exports/host/local could be used to mount /usr/local for example. Maybe something like vale(4) would be interesting to look into to provide fast communication between guests and the NFS file server?
But how would a mounted NFS share perform for things like databases? I'm also a bit concerned about setting up a single point of failure where I'm exposing an NFS service to both DMZ guests and guests on a vlan used for internal services.
EOT
I would be happy hear your thoughts and experiences on storage for bhyve and also possible ways of finding a workflow with stateless virtual machines (even though this part might be a bit off-topic for the storage sub forum).
It's about using small static VM images and provide persistent storage by other means.
Current bhyve guest storage
I currently use zvols for bhyve guests and extend storage by setting the zfs property
volsize
in the host and use growfs(8) in the guest. This has worked flawlessly so far, but growfs(8) spits out some warnings. Should I be concerned about the reliability of this procedure? Are there any UFS tunable I should be aware of that could support in this?Build bare-minimal images instead of using official VM images
For the bhyve guests I use the official VM-IMAGES. This gives me a fullblown FreeBSD system with everything from finger(1), kerberos(8) and specialized drivers for bluetooth, atm, wireless etc. etc. Since my guests usually serves one very specific function, such as "share this filesystem", "run this webapp", "provide this network service" etc. This makes me tempted to use something like NanoBSD to build small images. With the existent helper functions and possibly with some small modifications I can build my own customized images. Either by providing static ones with prebuilt packages or do customizations when deploying new guests. NanoBSD is built on the idea of a read-only filesystem, where persistent storage for /etc is stored in a special /cfg filesystem. Any modifications made to /etc during runtime should be synchronized with /cfg to provide persistence between boots. /usr/local/etc is linked to /etc/local.
Struggle of customizing NanoBSD images
One thing that just have created problems for my self has been customizing the NanoBSD build. It's very easy breaking your build by setting various src.conf(5) variables. I wouldn't recommend anyone disabling stuff if you don't know what you are doing. I'm also a bit uncertain to which variables to use for installworld, buildworld and for both of them. As demonstrated in the example in the NanoBSD howto you have
CONF_BUILD
, CONF_INSTALL
and CONF_WORLD
. The first is exclusively used for the buildworld stage, the second for installworld and the third for both of them.Keeping things simple would be continuing to use the full FreeBSD release image. It isn't big problem, but I feel just because I have a big house doesn't mean I want to keep furniture around that I never use.
Persistent storage for bhyve guests
The workflow of using static images to deploy various functionality in virtual or various containerized environments isn't something new. I've seen a few where iSCSI provides raw block storage, or NFS for a network mountable system etc. There are also things like GlusterFS and Ceph. But I feel a bit lost in all of this and I'm not sure about to what extent FreeBSD support is provided.
Even though I like keeping things simple, I want something flexible. This is still a single node environment so I'm not sure about the enteprise scale storage systems is the way to go.
Using one guest that provides storage for other guests
The most simple idea I can come up with is to use a large zvol attached to a file server guest that provides NFS for other guests. Something like /exports/host/local could be used to mount /usr/local for example. Maybe something like vale(4) would be interesting to look into to provide fast communication between guests and the NFS file server?
But how would a mounted NFS share perform for things like databases? I'm also a bit concerned about setting up a single point of failure where I'm exposing an NFS service to both DMZ guests and guests on a vlan used for internal services.
EOT
I would be happy hear your thoughts and experiences on storage for bhyve and also possible ways of finding a workflow with stateless virtual machines (even though this part might be a bit off-topic for the storage sub forum).