Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] In some case, we might want to keep some lvm active #420

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/vdsm/common/config.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
6 changes: 6 additions & 0 deletions lib/vdsm/storage/lvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)

Expand Down
Loading