Proxmox 5 and sharing VM filesystems

dafydd

Renowned Member
Apr 24, 2010
37
6
73
Cardiff, Wales
I am running Proxmox 3 for our internal development and really need to upgrade to Proxmox 5 but it looks like it's going to be problematic.

I'll describe how I run it and would like to know if this is even possible on version 5.

Each developer gets a few containers that run different development platforms (different versions/software) but all Linux. So we have about 25 containers. They are templated and set up once with specific configurations but then may be used for years until newer projects start using a newer version. The containers are all on local storage.

Anyway, these OpenVZ containers each have a filesystem mount and I run Samba on the host server, which allows each developer to access their own container files only (there is a specific virtual host location inside each one). So they can use network shares to view/edit those files directly and use IDEs and source control tools. They can also use git/svn directly through and ssh shell but they still need the network share.

With Proxmox and lxc, the filesystems are not mounted so there is no way to share the files. I think this is regardless of storage type e.g. lvm-thin or lvm.

So is there any way to have storage in the same 'old' way with filesystems that are visibly mounted on startup. I don't care about snapshots etc so a simple directory storage is fine. I realise the answer may be 'shared storage', but I don't have the resources to run a separate server just for file storage.

thanks
 
Anyway, these OpenVZ containers each have a filesystem mount and I run Samba on the host server, which allows each developer to access their own container files only (there is a specific virtual host location inside each one). So they can use network shares to view/edit those files directly and use IDEs and source control tools. They can also use git/svn directly through and ssh shell but they still need the network share.

With Proxmox and lxc, the filesystems are not mounted so there is no way to share the files. I think this is regardless of storage type e.g. lvm-thin or lvm.


mount.cifs should work in latest Proxmox VE 5.2 without any additional settings. Possibly you have to enable it in apparmor configuration.
 
Thanks. This probably isn't the solution for me.

Having searched in various places, I think there are two solutions:

1. Create containers with directory storage (effectively size=0), as mentioned here https://forum.proxmox.com/threads/unlimiting-lxc-quota-with-disk-size-0-impossible-in-4-1.26706/

This can't be done from the GUI, annoyingly, but it does mean that I end up with a filesystem present in /var/lib/vz/images/100/ and Samba on the host can access and share a directory structure within that location.

2. It would also be possible to share the files the other way round e.g. create another lvm partition on the host e.g mounted on /data with a directory for each container and then configure mountpoints from the host to each container. This makes it less self-contained if I ever need to move the container to another host, I'd have to manually copy the additional filesystem.
 
Yes, my option 2 would use mountpoints, but I would like to keep all the data for one container all together so they can be migrated easily or backed up in one file.

In the old setup I had symlinks in /home/$user which would link to /var/lib/vz/ABC/dir but I can't get Samba 4.5 to work with symlinks at all. So I'm using bind mounts to map into the container filesystem. All very non-standard but it seems to work ok.
 

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!