Start LXC container (or VM) after an NFS share is available

Angelone

Member
Jan 6, 2022
8
0
6
38
Hi all,

I've spinned a VM to run TrueNas on proxmox 7.4-16 and it expose an NFS share that has been mounted in the Proxmox host:

/etc/pve/storage.cfg

Code:
nfs: nfsdata
        export /mnt/hddstorage/nfsdata
        path /mnt/pve/nfsdata
        server <TrueNAS_VM_IP>
        content images
        prune-backups keep-all=1

I've also an LXC container that uses the share and naturally it will fail to boot if the NFS share is not available. Is there a way to boot the LXC container only when the NFS has been fully mounted on the host?
I know that I can add a boot delay of "random" time but I'm looking for a more reliable solution.

Many thanks
 
Currently, I'm having the same issue. I mounted via /etc/fstab, but that should not make a difference. Did you find a solution?
 
I now have this setup in testing and am looking into options...did you find a solution? I'm assuming the lxc needs to not start automatically and a script needs to run on boot up to check for nfs share connectivity before starting the lxc through the cli? I will be trying to get something together on this over the next couple of days but if there's a solution out there already???
 

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!