RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 475425 - [NetApp 6.0 feat] A library interface to LVM2 tools
Summary: [NetApp 6.0 feat] A library interface to LVM2 tools
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: 6.0
Assignee: Dave Wysochanski
QA Contact: Cluster QE
URL:
Whiteboard:
: 185525 (view as bug list)
Depends On:
Blocks: 217209 554559
TreeView+ depends on / blocked
 
Reported: 2008-12-09 05:47 UTC by Anand Venkatanarayanan
Modified: 2010-11-15 14:30 UTC (History)
12 users (show)

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.
Clone Of:
Environment:
Last Closed: 2010-11-15 14:30:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Anand Venkatanarayanan 2008-12-09 05:47:47 UTC
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 11:07:19 UTC
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 14:13:05 UTC
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 14:28:38 UTC
*** Bug 185525 has been marked as a duplicate of this bug. ***

Comment 5 Tom Coughlan 2009-10-01 12:43:30 UTC
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 21:27:20 UTC
This library is part of lvm2-devel and lvm2-libs packages, and is entitled "lvm2app".

Comment 8 Dave Wysochanski 2010-06-23 17:41:36 UTC
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 18:45:05 UTC
*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 23:32:37 UTC
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 07:06:49 UTC
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 14:30:45 UTC
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.