Bug 475425 - [NetApp 6.0 feat] A library interface to LVM2 tools
[NetApp 6.0 feat] A library interface to LVM2 tools
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2 (Show other bugs)
6.0
All Linux
medium Severity medium
: rc
: 6.0
Assigned To: Dave Wysochanski
Cluster QE
: FutureFeature, OtherQA
: 185525 (view as bug list)
Depends On:
Blocks: 217209 554559
  Show dependency treegraph
 
Reported: 2008-12-09 00:47 EST by Anand Venkatanarayanan
Modified: 2010-11-15 09:30 EST (History)
12 users (show)

See Also:
Fixed In Version: lvm2-2.02.51-3.el6
Doc Type: Enhancement
Doc Text:
The LVM application library (lvm2app) may be used by anyone wanting to write a storage management application involving LVM. The contents of the library may be accessed by using the header file lvm2app.h and the library liblvm2app.so contained in the lvm2-devel and lvm2-libs packages.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-11-15 09:30:45 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Anand Venkatanarayanan 2008-12-09 00:47:47 EST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4

Currently all storage applications that interact with LVM2 do so by using the 
LVM2 user land tools and parsing the output of these tools. How ever the tool 
output changes from one release to another.

An example of such behavior would be the vgdisplay -v dg1 command. It displays all the PV device names, but those device names can be either /dev/dm-xxx or 
/dev/mpath/xxxx, /dev/mapper/xxxx across RHEL4, RHEL5. This of course creates 
problems for applications which exclusively depend on the output of these tools
for managing storage operations for Database backup/restore operations. 

So the ideal solution for the above problem would be a library interface to the
LVM2 user land tools which is consistent across multiple RHEL releases. 

Reproducible: Always

Steps to Reproduce:
Since this is a feature request, I am skipping this section.
Comment 1 Alasdair Kergon 2008-12-09 06:07:19 EST
Please use pvs, vgs or lvs for cutomisable and predictable output: see man page for all the options.

For the best error handling, only do one operation with one device at once and rely on the success/failure status code.

To control which device name is used when there is a choice, set devices/preferred_names in the config file (/etc/lvm/lvm.conf or directly with --config 'devices { preferred_names = ...'  on the command line.

Finally, consider using the library liblvm2cmd.so for some efficiency gains when performing multiple commands.


Meanwhile, work to provide a more-traditional library interface is underway.
Comment 3 Dave Wysochanski 2008-12-11 09:13:05 EST
To track more-traditional library interface, please watch http://fedoraproject.org/wiki/LVM/liblvm, upstream LVM2 git http://sourceware.org/git/?p=lvm2.git;a=summary and lvm-devel mailing list.
Comment 4 Dave Wysochanski 2008-12-11 09:28:38 EST
*** Bug 185525 has been marked as a duplicate of this bug. ***
Comment 5 Tom Coughlan 2009-10-01 08:43:30 EDT
liblvm is in Fedora 12 and is planned for RHEL 6.0. 

Please test and provide feedback. If it does not meet your needs, move this BZ back to ASSIGNED and explain the additional requirements.
Comment 7 Dave Wysochanski 2010-06-22 17:27:20 EDT
This library is part of lvm2-devel and lvm2-libs packages, and is entitled "lvm2app".
Comment 8 Dave Wysochanski 2010-06-23 13:41:36 EDT
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.

New Contents:
The LVM application library (lvm2app) may be used by anyone wanting to write a storage management application involving LVM.

The contents of the library may be accessed by using the header file lvm2app.h and the library liblvm2app.so contained in the lvm2-devel and lvm2-libs packages.
Comment 9 Andrius Benokraitis 2010-09-13 14:45:05 EDT
*IMPORTANT*

Partners - please test this bugzilla *immediately* and report back with a comment. Delays in test findings could impact future proposed inclusions due to failed partner test commitments. Your results are very important to Red Hat and its mutual customers.
Comment 10 Ronald Pacheco 2010-09-16 19:32:37 EDT
Anand,

Given the release note, is this resolved to your satisfaction?  If so, then please mark this as verified.  Thanks!
Comment 11 Anand Venkatanarayanan 2010-09-17 03:06:49 EDT
I looked at the header files, wrote a few test applications to test my use cases. The LVM library provides all the functionality that I required to use it on my storage application. Moving this to Verified state.
Comment 12 releng-rhel@redhat.com 2010-11-15 09:30:45 EST
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.

Note You need to log in before you can comment on or make changes to this bug.