Delay Startup of Storage Pool

Discussion in 'Proxmox VE: Installation and configuration' started by Nick Coons, Oct 13, 2018.

  1. Nick Coons

    Nick Coons New Member

    Joined:
    Oct 13, 2018
    Messages:
    3
    Likes Received:
    0
    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?
     
  2. dcsapak

    dcsapak Proxmox Staff Member
    Staff Member

    Joined:
    Feb 1, 2016
    Messages:
    2,613
    Likes Received:
    239
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Nick Coons

    Nick Coons New Member

    Joined:
    Oct 13, 2018
    Messages:
    3
    Likes Received:
    0
    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?
     
  4. Nick Coons

    Nick Coons New Member

    Joined:
    Oct 13, 2018
    Messages:
    3
    Likes Received:
    0
    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.
     
  5. dcsapak

    dcsapak Proxmox Staff Member
    Staff Member

    Joined:
    Feb 1, 2016
    Messages:
    2,613
    Likes Received:
    239
    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

    if you order your startup sequences right, this should not be a problem
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice