[SOLVED] Directory Storage Type issues

DerDanilo

Renowned Member
Jan 21, 2017
477
135
83
@wolfgang @Stoiko Ivanov

There seem to be some small issues with the "Directory Storage Type".

- The directory storage type generally allows to use local storage or mounted storage.
- It creates the PVE folder structure when created.
- It works just fine, could be used e.g. for CIFS mounts before PVE supported CIFS directly.

But here are some issues:

- When the mount is unavaible for any reason PVE decides to recreate the folderstructure and hence writes on local disk
- When a mount tries to remount itself or by service it fails, since the folderstructure changed
- This includes when the host boots up, usually any mount is available after the network is up and PVE is usually faster then the network. Hence it writes to local storage again, blocking the remount of the network storage.

A simple fix for this could be an option for the Directory Storage Type:

- A manual switch in the storage.cfg (or a checkbox in the GUI) that blocks recreation of the folder structure and just waits for the folder structure to come available instead of writing a new folder structure.
Until the mounted storage is available again this PVE storage could just be unavailable and booting tasks ,for VMs that have images on this storage, could just wait until the storage comes available.

Possible Options:

For PVE to wait for the storage:
Code:
`isnetworkmount 1` or `waitforstorage 1`

and for PVE to not recreate the folder structure:
Code:
`createfoldersceleton 0`

---

This would solve general issues with the Directory Storage Type. This also happens sometimes when there is local storage mounted via fstab and for some reason PVE was faster and the directoy Storage messed up.

I think that both options are quiet simple to implement after looking at the directory storage type code. But since I am no developer it would take ages for me to implement those. An experienced dev can do wonders in a few. ;-)

Thanks guys!
 
both things already exists
see 'man pvesm'

--is_mountpoint <string> (default = no)
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.

--mkdir <boolean> (default = yes)
Create the directory if it doesn’t exist.
 
  • Like
Reactions: DerDanilo
both things already exists
see 'man pvesm'

--is_mountpoint <string> (default = no)
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.

--mkdir <boolean> (default = yes)
Create the directory if it doesn’t exist.

I read the manual, twice regarding this. Why didn't I see it? o_O
Please add this also to the manual if it should not be in it.

How can one configure these options in the storage.cfg? Can you please give a short example?

Thanks for letting me know!! :cool:
 
here is an example:

Code:
dir: nvme                                                                       
         path /mnt/nvme                                                     
         content rootdir,backup,images,iso,vztmpl                               
         is_mountpoint 1
         mkdir 0
 

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!