Nir Soffer has posted comments on this change.
Change subject: fcp: Deactivate vdsm logical volumes ......................................................................
Patch Set 17:
(2 comments)
.................................................... File lib/vdsm/tool/lvm_deactivate_lvs.py Line 32: @expose(_NAME) Line 33: def lvm_deactivate_lvs(*args, **kwargs): Line 34: """ Line 35: Deactivates unused vdsm lvs. Line 36: """ Add comment:
Deactivating can be very slow if a vg has many lvs. So don't want to do this on each start of the service, even if it may fix accidental activation of some lvs. We need another solution for this case. Line 37: if _was_run(): Line 38: _log("already run") Line 39: return 0 Line 40: _set_was_run()
Line 58: Line 59: Line 60: def _iter_vdsm_vgs(): Line 61: rc, out, err = _run_lvm(["vgs", "--noheading", "--separator", Line 62: _SEPARATOR, "-o", "name,tags"]) We should use here filter as used in lvm module. Otherwise it may be much slower, or we may fail accessing unrelated storage. We have this code in vdsm.storage.lvm.
Maybe move this to lvm.bootstrap()? Line 63: if rc != 0: Line 64: raise RuntimeError("Error finding vgs: %s" % err) Line 65: for line in out.splitlines(): Line 66: line = line.strip()