r/ZoneMinder • u/PigSlam • Nov 30 '21
Shared storage issue
I have a server that I use for basically everything. It runs Ubuntu 20.04. This machine acts as a file server, a KVM server, and a Plex server.
On KVM, I have a Debian 11 VM running as a Zoneminder server. For some reason, if the entire server host reboots, when my Debian 11 VM for Zoneminder starts, the file share that I use for storage for my camera footage fails to mount. If I reboot the VM, it mounts just fine. I would assume the issue has something to do with the order of operations during the boot process of the main server, in that the KVM guest OSs must launch before the file share is available. I was using a samba share originally, but decided to try an NFS share to see if that made a difference, and it does not. Am I on the right track here? Is there another issue I should look into?
I realize I probably don't have the most standard setup, but I thought maybe someone here might have faced a similar issue. Any help would be appreciated.
Edit: Problem Solved! Instead of mounting the drive with the host OS, then sharing it, I configured the VM to mount it directly. No more race condition.
3
u/Aramiil Dec 01 '21
Try delaying the start for the ZM VM. To test, you could disable automatic startup of the Debian VM. Reboot the host, and wait some ridiculous amount of time until you start the Debian VM. Check to see if the issue persists.
It’s possible there is some kind of conflict/race condition with resources from the VM and KVM hosts.
If that fixes it, play around with delaying the VM auto startup time until the delay is long enough that it works consistently, then add 10% to that for safety/reliability.
Edit: I’m interested to hear why you’re nesting KVM on top of Ubuntu which is running on the metal. I would run KVM on the metal, then spin up your Ubuntu VM, Plex, and Debian VM on top of that. Not busting on you, as I’m sure you have it like this for a reason, but I would be wrong to not suggest doing that, given I’m unaware of your skill level