Passthrough TrueNAS VM

moreramneeded

New Member
Sep 30, 2024
12
1
3
Created a TrueNAS VM. Before booting it, I want to passthrough storage.

My server has 4 HDD, which I configured in RAID10 when installing proxmox. This obviously created rpool, local, and local-zfs (im assuming local-zfs is a dataset within rpool?).

I created 3 datasets: Backups, ISO, and VM-Drives. (think these are self explanatory).

I created an Ubuntu VM, just to play around with.

I am now wanting to work on my first real project in my homelab, which is filesharing.

Downloaded TrueNAS iso and put it in the ISO dataset. Used that to create the VM. I used VM-Drives for the os boot drive.

I created a new dataset: NAS-storage.

I want to add this as a storage drive for the VM to recognize. Can't figure out how to do this.

I thought about adding each drive individually to the VM (as shown by countless youtubers), but everyone that i saw do this method was using drives that were not already configured in a zfs raid. So, i wasnt sure if this would mess things up.

I am sure there is a much better way to go about this and I am open to hearing those. Eventually I am going to wipe everything I have and build it back better from lessons learned along the way. In the meantime, is there a way to accomplish what I am trying. If so, how?
 
Hi!

I created a new dataset: NAS-storage.

You would need to elaborate further what you created and where.

Overall I would recommend you to put Proxmox VE on a separate disk (RAID1 is more than enough, the PVE configuration can be replaced quite easily) and pass through the drives directly to the VM for optimal disk performance - that's why you find those setups in the videos :)
 
Overall I would recommend you to put Proxmox VE on a separate disk (RAID1 is more than enough, the PVE configuration can be replaced quite easily) and pass through the drives directly to the VM for optimal disk performance - that's why you find those setups in the videos :)
completely agree. im going to look into upgrading my server with 2 drives, preferably nvme, and use those for proxmox boot loader in raid 1. my server (and the disks contained within) sat for the past 3 years waiting for me to be ready - on top of being a refurbished unit. so for redundencey and speed purposed, i want to use raid10. With only 4 drives, that forces me to put proxmox on there for the time being. im also not that smart when it comes to proper file storage, datsets, and zfs pools, so i am open to any knowledge on how to do things better! (honestly in the future when i get things where i really want, i am going to build proxmox on top of debian so i can do full disk encryption. someone helped me in another posted and they mention ceph and a few other things that i am going to look into)

You would need to elaborate further what you created and where.
sounds good. not sure what level of detail you want, so i will explain all i have done so far to the best of my ability.

i have 4 (2TB) drives and for the reasons i listed above i want to have them in zfs raid 10. when selecting disk when installing proxmox i choose the option of all 4 in zfs raid10. went through the rest of install, no issue - other than turning off hw raid controller (which is what my other ticket was about).

used web browser to connect to proxmox this is what was showing under datacenter > proxmox node:
1729382238498.png

i created an ubuntu vm, just because (the iso image was saved under local-zfs):
1729382445371.png

i then created 3 datasets (i think i am using that word right) by going to datacenter > storage > add > directory (for id: backups, iso, and vm-drives; for directory: /rpool/[idname]; you can see in the image how else they were configured):
1729382729746.png

that gave me:
1729382918299.png

i then created nas-storage using the same method above and you can see how it is configured above. my hope is to pass this through as a hard drive(s), like ive seen in youtube videos - more on this in a moment:
1729383097219.png

finally i created my truenas vm:
1729383269818.png

before booting the vm for the first time, under the hardware tab i clicked on "add" to create the drive i wanted to pass through. under storage i can select nas-storage, but then i have to set the disk size. i (think i) want it to have access to all of the available space. i also tried the cli to see if in some janky way i could add the pool, similar to the proper way to add true physical drives as passthrough - that obviously failed.

in the future i think i would like to have proxmox raid1 on nvmes, the 4 drives i currently have to be in some form of raid host backups, isos, and vm-drives, and to have an actual nas setup with dozens of drives.

but for now, i have 4 drives and just want to get something up and running after all these years. thanks for the help!
 
What you set up in Datacenter -> Storage is only available to the Proxmox Host(s), your VMs cant access this Storage directly. I want you to think about it physically: What would that storage even be? You can't attach a directory to a server - but you can attach drives to it. For NAS or database systems, it's recommended to pass through the drives directly. So as you've already realized: You need to create virtual disks.

in the future i think i would like to have proxmox raid1 on nvmes, the 4 drives i currently have to be in some form of raid host backups, isos, and vm-drives, and to have an actual nas setup with dozens of drives.

I highly recommend you to add at least one disk for the Proxmox VE root system, changing things afterwards will require a lot of work which you can prevent now with a tiny budget.

Also (while not implied, I want to make sure this is not done): Don't back up your VMs on a NAS that is hosted on the same system - that's not a backup :)
 
Also (while not implied, I want to make sure this is not done): Don't back up your VMs on a NAS that is hosted on the same system - that's not a backup :)
oh trust me, i know nothing about this current setup is "best practice." right now everything is just putting to practice all the theory i know (and dont know). :)

I highly recommend you to add at least one disk for the Proxmox VE root system, changing things afterwards will require a lot of work which you can prevent now with a tiny budget.
this is high on the to-do list, but still probably a couple of months down the road. for now, are there workarounds? in the name of learning, i am okay with doing things not the "right way" at first and then putting in the time / extra work to make it right - kind of the reason i wanted to build a lab - as long as i have good people, like you, who are willing to help teach (cannot overstate enough how grateful i am)!

What you set up in Datacenter -> Storage is only available to the Proxmox Host(s), your VMs cant access this Storage directly
this makes sense. my only question then is for the ones that are setup for disk image / container. since these are what hold boot files and what the vms see as their hard disks its a bit confusing. but i guess i can make sense of it. these are just partitions on the physical drive that proxmox manages. the vm thinks it is a hard disk, but any of that data is just passed to proxmox, which in turn stores it nicely - not the vm itself. if thats all true, that makes sense. but it does make me wonder, if we can virtualize one disk for the vm, why cant we virtualize more? which is what i think you are saying later in your statement. (sorry im all over the place as i try to wrap my head around everything).

You can't attach a directory to a server - but you can attach drives to it
so when you say "directory" what i am creating in data center > storage is only a directory within my zfs pool and therefore cannot be attached to vms? so what is a virtual disk, if it isnt just a directory / partition that is set aside on the physical drive?

You need to create virtual disks.
this makes sense (kind of, just need to understand how a virtual disk is different from what i already tried). i look into creating virtual disks within proxmox and attaching them to vms.


appreciate all of the insight so far and any future input as well!
 
awesome. i was actually going to go this route, but i didnt like how i had to set the disk size. i just wanted all disk space to be available to truenas.
but i just toyed around with this and it looks like i was able to get a virtual disk added. i can see how passing through physical disks is the better option - cant wait to get to that point. quick question:

are these drives dynamic? meaning, if i set it to 2TB is that just the limit or does it set aside that amount leaving no room for other data?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!