I built one a few months ago. Very nice by the way.
Here is the link to it.
PART 1: WHY A ESXi SERVER? I have a personal preference for virtualization and it started a long time ago while using VMWare Workstation, it was easy to operate on my Windoze computer and I'm accustom to it. While this thread is mainly how to select the right components and put together a...
www.truenas.com
That depends on what the goal is.
Fast data throughput, M.2 Gen 5 today, but if you wait a few years Gen 7 will be much faster. You can search the internet for data on these things. I'm not sure if Gen 6 is even available, I have not looked into it.
With speed comes heat, be very aware of that. If you want a cooler system a Gen 3 M.2 is good as you should not need a heatsink for those, but jump up to Gen 4 or Gen 5, a heatsink is required.
If you want cost effective then look into SATA 2.5" drives, they are easy to use and make connectivity easy.
Either way you will need to determine what the purpose of the drives are for and capacity, then figure it out through a lot of research, that is what I needed to do. My 4TB M.2 Gen 4 modules cost me $200 each. BUT I just located 8TB Gen 4 M.2 for $58.25 (USD) from AliExpress, Samsung 980 Pro. That definitely sounds wrong. I want to buy four and see what I get. If they are 4TB or 8TB, I'd be happy. Except I don't need them.