How do I "unify" the boot order of VMs and LXCs?

astarte

New Member
Mar 19, 2021
7
0
1
30
Preamble:

I have 10 containers and 1 VM. The VM is OpenMediaVault containing a mergerfs mount which is shared via cifs to my Windows 10 PC and pve host node. The share is mounted to every LXC via this line in /etc/fstab: //<ip-of-omv-vm>/data/ /mnt/data/ cifs _netdev,x-systemd.automount,credentials=/etc/omv-credentials 0 0. Follow up with mount -a. Everything mounts perfectly. The trouble starts when I restart the server. The share did not automount on any LXC. Which is why I added _netdev,x-systemd.automount. That did not work. Next I created an /fstab file in /etc/network/if-up.d and in that file I entered mount -a. This did not work either. What I believe worked is doing crontab -e and putting @reboot mount -a in the file. To be clear I did not undo any of the 3 solutions, so it could be any combination of the 3 that worked.

Problem:

The current issue is that all but one of my containers are not starting on boot, getting an error (see below). I believe this is because it cannot detect the mounted share from my OMV VM. The only container that does not start up is the last container in the boot order (#10). I checked this container and it seems that the share is auto-mounting correctly (checked with df -h). I believe what is happening is that my containers are booting up before my OMV VM has finished initialising its network stack + starting up samba and whatever else it does. I tried to fix this by putting a startup delay (60s) on the OMV VM but I realised after rebooting to check to see if it worked that proxmox acually boots VMs and LXCs separately. The first container in my boot order was booted up 4 seconds after my OMV VM according to the logs.

What can I do about this?

Versions:

Proxmox version: 6.3-6
LXC templates: Ubuntu 20.04
OMV Version: 5.6.3-1 (Usul)

Current VM Boot Order:
  1. VMID110: openmediavault
Current LXC Boot Order:
  1. CTID102: samba
  2. CTID101: organizr
  3. CTID100: plex
  4. CTID104: tautulli
  5. CTID105: jackett
  6. CTID103: qbittorrent
  7. CTID107: radarr
  8. CTID111: sonarr-tv (this is the last LXC in the boot order and the only container that boots up properly and has the share auto-mounted)
  9. CTID106: sonarr-anime (currently set to not boot at startup)
  10. CTID108: lidarr (currently set to not boot at startup)
  11. CTID109: readarr (currently set to not boot at startup)


Error when LXC tries to auto-start after server boots.
 
Last edited:
Okay so the problem is absolutely because my VM with my cifs share that I've mounted to all my LXCs is not fully initialised. I put a 120 second startup delay on the first LXC in the boot order which is more than enough time for my VM to initialise and that fixed the problem for every LXC except for the first one in the boot order. The question is now how do I fix the start at boot for the LXC that's first in the boot order? Is there a way to delay startup for all LXCs at server boot?
 
Last edited:

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!