]> git.proxmox.com Git - pve-storage.git/commit
lvm thin: don't assume that a thin pool and its volumes are active
authorFabian Ebner <f.ebner@proxmox.com>
Fri, 5 Nov 2021 10:29:45 +0000 (11:29 +0100)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 10 Nov 2021 13:23:54 +0000 (14:23 +0100)
commit6fbffac0a395dd0d4c6da1890eab52a02232f6c1
treedc6753ff00540cf3265c9ff2eb0bbe59e6f5dd35
parent2668a867197a8e9885f8a4af855edb362c1a05c4
lvm thin: don't assume that a thin pool and its volumes are active

There are cases where autoactivation can fail, as reported in the
community forum [0]. And it could also be that a volume was
deactivated by something outside of our control.

It doesn't seem strictly necessary to activate the thin pool itself
(creating/removing/activating LVs within the pool still works if it's
not active), but it does not report usage information as long as
neither the pool nor any of its LVs are active. Activate the pool for
that, for being able to use the flag in status(), and it should also
serve as a good indicator that there's a problem with the pool if it
can't be activated.

Before activating, check the (cached) lv_state from lvm_list_volumes.
It's necessary to update the cache in activate_storage, because the
flag is re-used in status(). Also update it for other (de)activations
to be more future-proof.

[0]: https://forum.proxmox.com/threads/local-lvm-not-available-after-kernel-update-on-pve-7.97406

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/Storage/LVMPlugin.pm
PVE/Storage/LvmThinPlugin.pm