]> git.proxmox.com Git - pve-storage.git/commit
Fix #1012: dir storage: add is_mountpoint option
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 31 Aug 2016 08:29:09 +0000 (10:29 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 27 Sep 2016 07:56:55 +0000 (09:56 +0200)
commitd547f26c7d81d0080700aa8b2c85aa2ac18d2217
tree1a1ad1a0cd7b6284d06dc589c0aa83131185345a
parentc7616abcb278e2b888febc082b557f60676fc376
Fix #1012: dir storage: add is_mountpoint option

While the mkdir option deals with the case where we don't
want to clobber a mount point with directories (like ZFS,
gluster or NFS), putting a directory storage directly onto a
mount point is still risky:
If the path exists - which it usually does even if not
mounted - the storage will be considered successfully
activated, but empty (or with unexpected content). Some
operations will then lead to unexpected problems: the
free_disk operation for instance only warns if the disk does
not exist, but does not throw an error. In this case the
configuration might be updated without the real disk being
deleted. Once it's mounted back in, later operations which
check existing disks which are not part of the current VM
configuration (like migration) might error unexpectedly.

This adds an 'is_mountpoint' option to directory storages
which assumes the directory is an externally managed mount
point (eg. fstab or zfs) and changes activate_storage() to
throw an error if the path is not mounted.
PVE/Storage/DirPlugin.pm