Correct way to implement NFS share in VM

alve89

New Member
Apr 9, 2024
9
0
1
Hi guys,

I am new to Proxmox an I just successfully achieved:

  1. Created a VM with TrueNAS
  2. Created a ZFS dataset as NFS share in TrueNAS
  3. Added the NFS to Proxmox (see screenshot)

Bildschirmfoto 2024-04-23 um 16.11.07.png

After adding the NFS in PVE some directories are created by Proxmox (screenshot from within TrueNAS-Shell):
Bildschirmfoto 2024-04-23 um 16.14.02.png


I also added the storage to my VM.
Bildschirmfoto 2024-04-23 um 16.12.32.png

From here I'm confused and struggling: Since the disk is only listed as
Bash:
lsblk:

sda      8:0    0   32G  0 disk
sdb      8:16   0 1000G  0 disk

and therefore without any filesystem and not mounted yet, I think I need to partition and mount it. But my expectations were I would see the equal content of the NFS as I see it in the NAS...?

It seems that I miss something probably obvious but I have no idea what I am doing wrong. How can I achieve to have a NFS share to share data over all VMs?

Thanks in advance and best regards!
 
and therefore without any filesystem and not mounted yet, I think I need to partition and mount it. But my expectations were I would see the equal content of the NFS as I see it in the NAS...?

It seems that I miss something probably obvious but I have no idea what I am doing wrong. How can I achieve to have a NFS share to share data over all VMs?
Think of NFS as a large pool of space. This pool is shared across all the VMs you have, however, each VM has its lane in the pool - Disk (image in PVE speak). This disk must have a certain format to be suitable for VM use. In most cases, this format will be QCOW. The QCOW is a file on your NFS storage. It emulates a real disk, so VM is "fooled" into thinking it has a real disk.

As the disk is "real" from VM perspective, you have to treat it as a real disk. Partition and Format it with a filesystem. This disk is dedicated to the VM, other VMs will not see the disk or the disk's context. This is what allows the VM to place OS on the disk and boot.

Once you have an OS inside your VM, you can now do more interesting things. For example, you can create a new NFS share on your NAS and then mount it directly in the VM. NFS will allow you to share the same data across multiple VMs, or physical computers.

Hope this makes sense.

Good luck


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Think of NFS as a large pool of space. This pool is shared across all the VMs you have, however, each VM has its lane in the pool - Disk (image in PVE speak). This disk must have a certain format to be suitable for VM use. In most cases, this format will be QCOW. The QCOW is a file on your NFS storage. It emulates a real disk, so VM is "fooled" into thinking it has a real disk.

As the disk is "real" from VM perspective, you have to treat it as a real disk. Partition and Format it with a filesystem. This disk is dedicated to the VM, other VMs will not see the disk or the disk's context. This is what allows the VM to place OS on the disk and boot.

Once you have an OS inside your VM, you can now do more interesting things. For example, you can create a new NFS share on your NAS and then mount it directly in the VM. NFS will allow you to share the same data across multiple VMs, or physical computers.

Hope this makes sense.

Good luck


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
Thank you very much, I understand this now.

What I need to share the data on the NFS across multiple VMs is to mount this NFS directly into each VM, not through PVE.
So following this guide would solve my issue. I'd still have my VM OS on a virtual SCSI disk and all data (e. g. for backups) directly on the NFS share. Therefore I don't need to add the NFS to my PVE at all.

Is this correct?
 
What I need to share the data on the NFS across multiple VMs is to mount this NFS directly into each VM, not through PVE.
correct
'd still have my VM OS on a virtual SCSI disk and all data (e. g. for backups) directly on the NFS share.
no, for this you need to use PVE NFS storage pool
Therefore I don't need to add the NFS to my PVE at all.
You should have it in PVE for storing VM images/disks, snippets, backups, etc.
You should create another NFS export dedicated to in-VM sharing.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
  • Like
Reactions: alve89
correct

no, for this you need to use PVE NFS storage pool

You should have it in PVE for storing VM images/disks, snippets, backups, etc.
You should create another NFS export dedicated to in-VM sharing.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
Understood - to also ensure that PVE backups are also on the NFS share. Thank you! :)
 

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!