Delay Startup of Storage Pool

Nick Coons

Member
Oct 13, 2018
6
1
8
45
I'm new to Proxmox (have been using vanilla KVM for years). I'm running 5.2-9 on Debian 9.5, and am using a directory storage pool.

The directory is a LizardFS-mounted file system (same setup as I'm using currently in another cluster with KVM). I noticed that when the storage pool starts, if it sees that the directory is empty, it creates a directory structure. This directory structure creation gets in the way of me mounting my LizardFS at the designated mount point. What I'm having to do is rm -rf (mountpoint)/*, and then very quickly (in less than about two seconds) mount my LizardFS file system. If I don't do this quickly, Proxmox recreates the structure that I just deleted.

I'm hoping for assistance with one of the following solutions:

  • Is it possible to make Proxmox look for a condition (like the presence of something at the directory location) before starting the storage pool? I could put an empty dot file (like ".ready") on the filesystem, which would then only be present when it's mounted, and Proxmox would require that file to be present before starting the storage pool.
  • Is it possible to change the order in which this startup happens? This way, I can make sure my LizardFS is mounted first, then have the storage pool start. I'm not familiar with which service this is, though I'm sure there's something that can be done in systemd to accomplish this.
  • Or, is there something stupid simple that I'm missing as a Proxmox noob?
 
you can add 'is_mountpoint 1' to the storage in /etc/pve/storage.cfg
this tells pve that it is a mountpoint and does not try to create a directory if it is not mounted
 
you can add 'is_mountpoint 1' to the storage in /etc/pve/storage.cfg
this tells pve that it is a mountpoint and does not try to create a directory if it is not mounted

Thanks! That looks a good place to start. I didn't see that as an option in the wiki when creating my storage pool. But I google'd for it and found this:

https://pve.proxmox.com/pve-docs/pvesm.1.html

And the explanation here is slightly different than what you mentioned:

"Assume the given path is an externally managed mountpoint and consider the storage offline if it is not mounted. Using a boolean (yes/no) value serves as a shortcut to using the target path in this field."

It sounds like it will do what you said in that it won't create the directory structure, but that it also considers it offline. That's fine, but how would I go about making it online once it's mounted? Is there a way in the GUI to enable it? Or does is the storage monitored so that it goes online as soon as it's mounted?
 
It looks like the "mkdir" option might be a way to go as well. It starts the storage, but doesn't create the directory structure, leaving the rest of my startup processes free to mount LizardFS for me.
 
It sounds like it will do what you said in that it won't create the directory structure, but that it also considers it offline. That's fine, but how would I go about making it online once it's mounted? Is there a way in the GUI to enable it? Or does is the storage monitored so that it goes online as soon as it's mounted?
in that scenario, if any operation tries to access the storage after it is mounted, will activate it

the reason i suggested the 'is_mountpoint' instead of 'mkdir' option is that the mkdir option does not check if there is a mountpoint and would allow pve to write there, even if the storage
is not mounted, so you could write to the 'wrong' storage

leaving the rest of my startup processes free to mount LizardFS for me.
if you order your startup sequences right, this should not be a problem
 

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!