Bug 1209855

Summary: Move blkdeactivate script and blk-availability.service from lvm2 to device-mapper package
Product: Red Hat Enterprise Linux 7 Reporter: Peter Rajnoha <prajnoha>
Component: lvm2Assignee: Peter Rajnoha <prajnoha>
lvm2 sub component: Scripts / lvmdump / vgimportclone QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: agk, cmarthal, heinzm, jbrassow, msnitzer, nperic, prajnoha, prockai, zkabelac
Version: 7.2Keywords: Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.02.125-1.el7 Doc Type: Bug Fix
Doc Text:
The blkdeactivate script together with the blk-availability.service systemd unit has been moved from lvm2 to device-mapper package. This way, other packages which provide utilities to handle various DM device subsystems (like device-mapper-multipath) can depend on device-mapper package now, not requiring lvm2 package to be installed at the same time just to make use of the blkdeactivate script.
Story Points: ---
Clone Of:
: 1384418 (view as bug list) Environment:
Last Closed: 2015-11-19 12:46:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1201030, 1384418    

Description Peter Rajnoha 2015-04-08 10:57:40 UTC
The blkdeactivate should be moved to device-mapper package from lvm2 package as blkdeactivate handles also deactivation of other device-mapper based devices, not just LVM ones (e.g. multipath and cryptsetup).

The blkdeactivate script should be patched so that it checks in runtime for presence of tools needed to do the proper deactivation and it should handle specific device-mapper subsystem only if there's higher level subsystem tool present as well to do the action properly (for example, handle LVM devices only if "lvm" binary is present and skip them otherwise).

We need this move because other device-mapper based subsystems may require blkdeactivate to handle subsystem's devices properly. See also bug #1201030 for an example where this script would help multipath to do shutdown properly - mutlipath does not need LVM for it to work properly, but it surely requires libdevmapper and it needs blkdeactivate to shut down this subsystem's devices at least.

For now, this is just a quick workaround, until we have bug #1201737 properly resolved ("Add better separation of various blkdeactivate parts handling various device types - make it pluggable").

Comment 1 Peter Rajnoha 2015-04-14 11:44:35 UTC
I've added a runtime check for lvm binary - if it's not present, no LVM handling is done with blkdeactivate script. This removes the static dependency on lvm and so we can move it to libdevmapper/device-mapper package so other DM subsystems can still make use of the general routine to deactivate DM devices.

But as stated in comment #0 above, the aim for the future is for DM subsystems (and others maybe) to provides plugins for blkdeactivate script instead of hardcoding the functionality into blkdeactivate directly - this will remove the deps altogether and such runtime checks won't be necessary anymore...

https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=7a4e27eee51e89a550bc55f78daea6d943293202

!!!
Don't forget to move the blkdeactivate script from lvm2 to device-mapper package!!!
!!!

Comment 3 Corey Marthaler 2015-10-08 15:58:47 UTC
Verified that both blkdeactivate and blk-availability.service are now a part of the device-mapper pkg.



lvm2-2.02.124-1.el7:

[root@host-116 ~]# rpm -qf /usr/sbin/blkdeactivate
device-mapper-1.02.101-1.el7.x86_64
[root@host-116 ~]# rpm -qf /usr/lib/systemd/system/blk-availability.service
lvm2-2.02.124-1.el7.x86_64



lvm2-libs-2.02.130-2.el7.x86_64

[root@host-116 ~]# rpm -qf /usr/sbin/blkdeactivate
device-mapper-1.02.107-2.el7.x86_64
[root@host-116 ~]# rpm -qf /usr/lib/systemd/system/blk-availability.service
device-mapper-1.02.107-2.el7.x86_64

Comment 4 errata-xmlrpc 2015-11-19 12:46:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2147.html