Best approach to add local zpool as storage disk for a VM?

Jan 24, 2020
28
3
23
39
I have a virtual machine with Nextcloud installed and previously was using an NFS mount from FreeNAS as a backend. As part of my migration to proxmox, I set up a local zpool for my cloud storage (on the proxmox host) mounted at /tank/cloudstorage. What is the best way to mount that zpool inside the VM?

I was looking at adding a hard disk in the hardware section of the VM, but it seems like I must specify a disk size. Is there a way to mount the zpool in a high performance way and also just use the full zpool's capacity without setting an artificial disk size which might need to be manually expanded later?

Is NFS a valid approach to this problem? It seems like that just adds an unnecessary layer of complexity (and possibly performance issues).
 
Hi,
you cannot mount a filesystem from the host directly into a VM. You will always need a layer in between (be it network or FUSE) to achieve that. PVE allows to add virual ZFS block devices (zvols) to virtual machines, but then you cannot access it easily from the host anymore. If you really need high-performance access from host and guest, I'd suggest using a container and bind-mounts instead, see here and here.
 
Thanks Fabian, that makes total sense! I created a virtual disk and so far that is working nicely for me. It looks like it's pretty easy to expand later if I need to.
 
Glad it's working for you. Just don't forget that you need to expand the partition and file system within the VM after expanding the zvol to make use of the new space.
 
  • Like
Reactions: linucksproxmox

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!