Local Directory across VMs

robertsw

New Member
Mar 7, 2021
8
1
3
41
Hello All,

I am fairly new to ProxMox and I am still learning the ropes, but I am having fun along the way. I am trying to have my VMs gain access to a local directory in ProxMox and would like to know the best way to accomplish this. I am coming from a single-OS setup where I ran multiple services and pod containers to fulfill my needs, but I have now broken them down into 5 separate VMs. Before I had my primary OS installed on an NVME drive and all of my stuff was stored on a 5-drive RAID6 mounted on /srv.

As stated, I have 5 VMs that compartmentalize all of my needs, but I would like all of them to have access to the RAID. In ProxMox, I have already mounted the RAID at its familiar location (/srv). I have a web server in one VM. The http folder is on the RAID mounted at /srv/http (on ProxMox). Instead of transferring the files into the VM, I'd rather have the VM host the files from the RAID. My theory is that I can centralize all of the data in one location and conduct backup/restore of the images without jeopardizing data loss from within a VM. Additionally, some of the data is fairly large; this would make the backup process of VMs a nightmare!

Here is my setup:

ProxMox DataCenter:
Banshee (Node) <--- /srv/[media,http,games,backups]
- WebServer (VM) <----- Needs to access banshee:/srv/http
- MediaServer (VM) <----- Needs to access banshee:/srv/media
- SteamOS (VM) <----- Needs to access banshee:/srv/games
- SQLServer (VM) --- Doesn't require access to banshee:/srv

Ideally, I'd like each respective VM to mount their needed folder at their own internal /srv location. (for example: WebServer VM would have a mount point of /srv/http that would be mapped to banshee:/srv/http but would NOT have any of the other folders mounted).

I know that this can be accomplished manually amongst /etc/fstab edits, but is there a way to accomplish this through the Datacenter / storage options?

Thanks for any help or suggestions to get me in moving in the right direction.
 
Last edited:
Yes, I currently have all VMs. Would CTs be a better solution? That should be easy enough to rebuild as I am still in the "building" phase of this process and all of my data is currently backed up on an external drive.
 
As mentioned you can pass directories of the host to a CT. With VMs you have to use NFS, CIFS or iSCSI.
 
ph0x and avw, thanks for the help. I am going to create a CT right now and see if that will work for my needs. If so, then I might use CTs in lieu of some of the VMs. I am not opposed to using NFS or CIFS either; both can be easily configured for my needs.
 
I would keep the VMs and use NFS for the shared folders. They are not that efficient but more secure and I think that is more important if you are running webservers or other services accessible from the internet. You could create a LXC as a NFS server and bind-mount your mountpoint from the host to the LXC. Your VMs then can access the files using NFS.
 
Last edited:
  • Like
Reactions: leesteken

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!