" I naturally want the datastore to be fault tolerant, but I can't get
the funds for a separate storage machine, nor expensive hardware RAID
solutions, so I would like to use some software RAID (lvm/mdadm, most
likely). How can this be implemented?
esxi will not work without a REAL HW Based RAID for the Datastore. Not even BIOS based software raid will work.
I run a HW backed 2x1TB SSD datastore for VMS
Got my raid controller Adaptec 6405e for 100$ on Ebay!
BUT in regards to the next part,
My only idea so far would be to
create a VM which has the storage adapter as passthrough, puts some
software RAID on top of the disks and then presents the resulting
volumes "back" to the ESXi host which then creates a datastore from
which other VMs get their storage presented."
My "FileServer" consists of 4x5TB HD's passed directly to a VM. I then built mdadm Raid 5 for a total of about 14TB and exported that over NFS to all my VM's. About 15/20 any given time, with 10/20 dev VM's that are off unless being used. This has worked well for me, but this is not with a large group of users. Infact I am really the only local user, but I do host websites which generate some traffic, but again, they are static mostly.
A good question to ask in this scenario, if you are thinking of using this idea is, what is the FileServer for?
In my case, 90% of my VM's if not all, host all the necessary data inside the VM (linux) and are less than 20GB's in size. I use the FileServer as a central repo for backups, also, any media applications like Plex will read from the FileServer, and my P2P saves directly to the FileServer, but non of my hosts have a Database or anything that resides on the FileServer. They do however do all their backups to the FileServer. My fileserver is my only VM which hosts 2 services, and that is NFS for VM's and also SMB for Windows access via GUI. This has worked wonderfully for me. I also have mounted the FileServer via NFS as a datastore and I can mount ISO's to new VM's from within the datastore. I also backup OVA snapshopts over SMB in windows directly to the FileServer. Running VM's on an exported NFS software raid would be nuts, but Exporting a large NFS datastore back to the esXi host has many benifits.