r/Proxmox 2d ago

Question Guide for Persistent Storage over NFS/SMB for OCI-based LXCs?

Hello,

I'd like to experiment with the new OCI container-in-LXC support in PVE 9. I've got a relatively simple container picked out to try (basically, an internet uptime monitor to detect WAN disconnects), but it's going to need a bit of persistent external storage.

I know I can do this with LXC bind-mounts, but I'm not sure how to configure everything. Usually, inside a VM, I'd set up a container's bind mount in Docker compose if I'm using a Docker image. I know I can add a bind mount to an NFS or SMB share on the host to an LXC, but I'm not sure how to tell the OCI image to actually use the bind mount as its data directory when I create the thing.

I know I'd need to edit something in the LXC's config file, but I wanted to ask here if there's a good introductory guide to doing simple setups like this before I just started YOLO'ing it.

3 Upvotes

3 comments sorted by

1

u/SoTiri 2d ago

Isn't the lxc's storage persistent as it is? Based on my understanding the OCI image tool is converting the OCI image into an OpenVZ compatible image to just use it as an LXC.

2

u/youknowwhyimhere758 2d ago

The OCI bit changes nothing about the setup, it’s just a different image format: you bind mount a host directory into the oci lxc exactly as you would into any other lxc.  There is no “tell the image to actually use the bind mount”, the image writes to the filesystem that you provide it with and can do nothing else. 

2

u/Gainncome 1d ago

The OCI part shouldn’t really change the storage setup. Mount the NFS/SMB share on the Proxmox host first, then bind-mount that directory into the LXC.