Passing a Volume(ZFS Pool) through to a VM?

axlrose

New Member
Jul 31, 2017
6
1
3
54
Here is what I want to do. Tell me if my thinking is flawed.

I have a ZFS Pool Created on the host that I keep all my media on. For various reasons I need to share this media locally to other VM's and physical machines. So I'm using a NFS server on the host to share out the media.

Ideally I would like to have the NFS server in a VM so I can restrict resources a bit better. But I'm having a hard time figuring out how to pass the pool to the VM. The only thing I've seen is adding the Pool as a Storage option the Node.

Here is where I'm confused. If I do this, all the media will then be put inside a VM-100-Disk(correct?) or whatever the ID is and not written directly to the ZFS Pool. When I do ZFS Scrub it's just going to see a really large virtual disk instead of individual files. This doesn't seem desirable to me? If I had an error that ZFS had to recover wouldn't I rather have it repair an individual file than a large virtual disk?

Second problem is, if the VM explodes for some reason, how would I mount that Virtual Disk on something else?
 
Hi,

you can use disk pass through.
The disk must be unused.

Code:
qm set <vmid> --scsi0 /dev/sdx
 
Export you ZFS on the host and import it later in the VM.
Yes you need the memory for ZFS in the VM.
 
Export you ZFS on the host and import it later in the VM.
Yes you need the memory for ZFS in the VM.

Is there anyway of sharing just the directory on the host with the guest? And then have the guest run the NFS server? I would like the host to handle the ZFS duties. Similar to a bind mount but with KVM?
 
In my opinion, the best you can du is this:
- create a dedicated dataset for this pool on the node
- export this zfs dataset via nfs on the same node
- restrict this nfs share with iptables for your desired KVM guest(maybe use a secondary interface for them with with a separate ip address )
- create on the desired guest a nfs client
 
Export you ZFS on the host and import it later in the VM.
Yes you need the memory for ZFS in the VM.

Dear wolfgang,


My DISKs and Pool information as follows.

1​
AMD Ryzen 5 3600 Desktop Processors With Wraith Stealth Cooler
2​
Asus ROG Strix B550-F Gaming Motherboard
3​
VENGEANCE® LPX 32GB (2 x 16GB) DDR4 DRAM 3200MHz C16 Memory Kit - Black
4​
Corsair CV650 - 650 WATT 80 Plus Bronze Certified Power Supply
5​
Antec P101 Silent
6​
Raidmax NV-R120B 120mm RGB Case Fan
7​
GIGABYTE 128GB M.2 PCIe NVMe SSD
8​
SSD 120GB
9​
Keyboard and Mouse
10​
Switch 8 port
11​
UPS
13​
WD Red HDD ( 4 )

Once I export the pool, can I use the same HDD with data to the VM added through passthrough to import the pool.


View attachment 24047

View attachment 24047

Thanks and regards,
 
Last edited:
My computer configuration as follows.


1​
AMD Ryzen 5 3600 Desktop Processors With Wraith Stealth Cooler
2​
Asus ROG Strix B550-F Gaming Motherboard
3​
VENGEANCE® LPX 32GB (2 x 16GB) DDR4 DRAM 3200MHz C16 Memory Kit - Black
4​
Corsair CV650 - 650 WATT 80 Plus Bronze Certified Power Supply
5​
Antec P101 Silent
6​
Raidmax NV-R120B 120mm RGB Case Fan
7​
GIGABYTE 128GB M.2 PCIe NVMe SSD
8​
Kingston SSD 120GB
9​
WD Red HDD 10TB x 4


I am planning to install Proxmox and then rum my existing freeNAS as a VM on Proxmox. for Data I want to passthrough LSI card via PCIe slots.

My motherboard available following expansion slots
AMD B550 Chipset
1 x PCIe 3.0 x16 (x4 mode) *
3 x PCIe 3.0 x1
1 x PCIe 4.0 x16 (x16 mode)

is this a suitable LSI for my motherboard?
1. LSI 9240-8i = (9211-8I) 6Gbps SAS HBA FW:p20 9211-8I IT Mode ZFS FreeNAS unRAID
 

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!