diff --git a/lib/vdsm/common/config.py.in b/lib/vdsm/common/config.py.in index 5b6ac7e055..7f77a3533f 100644 --- a/lib/vdsm/common/config.py.in +++ b/lib/vdsm/common/config.py.in @@ -481,6 +481,10 @@ parameters = [ 'are either "filter" or "devices". Filter method will use LVM ' 'filter, while device will use LVM devices file. The default ' 'value is "devices".'), + + ('keep_active', '', + 'Comma-separated list of LVM paths that will never be deactivated.' + 'For instance: "/dev/vg1/lv1,/dev/vg1/lv2,..."'), ]), # Section: [sanlock] diff --git a/lib/vdsm/storage/lvm.py b/lib/vdsm/storage/lvm.py index 53e1000222..e595e56fc3 100644 --- a/lib/vdsm/storage/lvm.py +++ b/lib/vdsm/storage/lvm.py @@ -240,6 +240,9 @@ def __getattr__(self, attrName): USE_DEVICES = config.get("lvm", "config_method").lower() == "devices" +KEEPACTIVE = [lvm for lvm in config.get("lvm", "keep_active").split(",") + if lvm is not None] + def _get_lvm_version(): packages = osinfo.package_versions() @@ -1174,6 +1177,9 @@ def deactivateUnusedLVs(vgname, skiplvs=()): elif lv.opened: log.debug("Skipping open lv: vg=%s lv=%s", vgname, lv.name) + elif lvPath(vgname, lv.name) in KEEPACTIVE: + log.debug("Skipping KEEPACTIVE lv: vg=%s lv=%s", vgname, + lv.name) else: deactivate.append(lv.name)