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 986687 - Make options in "report" lvm.conf section as well as "global/{units|si_unit_consistency|suffix|lvdisplay_shows_full_device_path}" settings profilable
Summary: Make options in "report" lvm.conf section as well as "global/{units|si_unit_c...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.6
Hardware: All
OS: All
low
low
Target Milestone: rc
: ---
Assignee: Peter Rajnoha
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks: 1093059
TreeView+ depends on / blocked
 
Reported: 2013-07-21 15:49 UTC by Christoph Anton Mitterer
Modified: 2014-10-14 08:24 UTC (History)
11 users (show)

Fixed In Version: lvm2-2.02.107-1.el6
Doc Type: Enhancement
Doc Text:
Feature: Make global/{units|si_unit_consistency|suffix|lvdisplay_shows_full_device_path} and the whole report section configurable in a user-customisable profile. Reason: All the configuration options mentioned above change the way the output from LVM reporting commands are formatted and they also set which fields are displayed by default for certain LVM commands. There may be several uses of these reporting commands and each use case may require different fields to be displayed or different report formatting used. To make it easier for users to define LVM report formatting and settings for each use case needed, LVM now makes these settings profilable. Result: Users are now able to create LVM configuration profiles that contain settings related to LVM reporting and thus they can apply these settings per each LVM command simply by using <lvm command> --commandprofile <profile name>.
Clone Of:
: 1093059 (view as bug list)
Environment:
Last Closed: 2014-10-14 08:24:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1387 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2014-10-14 01:39:47 UTC

Description Christoph Anton Mitterer 2013-07-21 15:49:14 UTC
Hi.

Especially for tools like vgs/lvs/pvs, where one has no way to set the default value for --options in a config file (AFAIK) it's handy to define shell aliases for these, also defining a default --unit that is shown.

Right now one cannot "redefine" these on the alias, e.g. when having:
alias lvs="lvs --units S -o +lv_all"

lvs --units H would lead to:
  Option --units may not be repeated.
  Error during parsing of command line.

The same for --options.

It would be nice, if in the case of --units, simply the last one takes precedence, and the same for --options, just for an additional +/- merging.

Cheers,
Chris.

Comment 2 Peter Rajnoha 2013-07-22 13:20:34 UTC
(In reply to Christoph Anton Mitterer from comment #0)
> Especially for tools like vgs/lvs/pvs, where one has no way to set the
> default value for --options in a config file (AFAIK) it's handy to define

...there is actually a way to redefine the default "options" set, though it's not documented much, I have to admit (the "lvm dumpconfig --type" that helps here to show all supported config is new in lvm2 v2.02.99):

[0] raw/~ # lvm dumpconfig --type default report
report {
	aligned=1
	buffered=1
	headings=1
	separator=" "
	prefixes=0
	quoted=1
	colums_as_rows=0
	lvs_sort="vg_name,lv_name"
	lvs_cols="lv_name,vg_name,lv_attr,lv_size,pool_lv,origin,data_percent,move_pv,mirror_log,copy_percent,convert_lv"
	lvs_cols_verbose="lv_name,vg_name,seg_count,lv_attr,lv_size,lv_major,lv_minor,lv_kernel_major,lv_kernel_minor,pool_lv,origin,data_percent,metadata_percent,move_pv,copy_percent,mirror_log,convert_lv,lv_uuid,lv_profile"
	vgs_sort="vg_name"
	vgs_cols="vg_name,pv_count,lv_count,snap_count,vg_attr,vg_size,vg_free"
	vgs_cols_verbose="vg_name,vg_attr,vg_extent_size,pv_count,lv_count,snap_count,vg_size,vg_free,vg_uuid,vg_profile"
	pvs_sort="pv_name"
	pvs_cols="pv_name,vg_name,pv_fmt,pv_attr,pv_size,pv_free"
	pvs_cols_verbose="pv_name,vg_name,pv_fmt,pv_attr,pv_size,pv_free,dev_size,pv_uuid"
	segs_sort="vg_name,lv_name,seg_start"
	segs_cols="lv_name,vg_name,lv_attr,stripes,segtype,seg_size"
	segs_cols_verbose="lv_name,vg_name,lv_attr,seg_start,seg_size,stripes,segtype,stripesize,chunksize"
	pvsegs_sort="pv_name,pvseg_start"
	pvsegs_cols="pv_name,vg_name,pv_fmt,pv_attr,pv_size,pv_free,pvseg_start,pvseg_size"
	pvsegs_cols_verbose="pv_name,vg_name,pv_fmt,pv_attr,pv_size,pv_free,pvseg_start,pvseg_size,lv_name,seg_start_pe,segtype,seg_pe_ranges"
}

> shell aliases for these, also defining a default --unit that is shown.
> 
> Right now one cannot "redefine" these on the alias, e.g. when having:
> alias lvs="lvs --units S -o +lv_all"
> 
> lvs --units H would lead to:
>   Option --units may not be repeated.
>   Error during parsing of command line.
> 
> The same for --options.
> 
> It would be nice, if in the case of --units, simply the last one takes
> precedence, and the same for --options, just for an additional +/- merging.

With recent changes in lvm2 v2.02.99 this could probably be done via profiles as well (and it would probably the more correct way to redefine it as profiles are designed for redefinition, see also https://git.fedorahosted.org/cgit/lvm2.git/tree/man/lvm.conf.5.in).

So then you could define an alias as:

  alias lvs="lvs --profile <some_profile_that_redefines_units_config>"

And then you could call lvs on cmd line with different unit type. What would happen here is that the lvm.conf value would be redefined by the profile (in the alias) and then redefined on the cmd line if needed.

However, we haven't selected the "global/units" config to be used for profiles yet, but I guess we could probably do that...

Comment 3 Alasdair Kergon 2013-08-02 19:28:42 UTC
Yes, profiles should pick up the whole 'report' section as well as units.

Not sure why this section never made it into example.conf!

Comment 4 Peter Rajnoha 2013-10-08 08:43:38 UTC
It's late for 6.5, moving to 6.6 for consideration.

Comment 6 Peter Rajnoha 2014-03-17 15:12:24 UTC
The global/units, global/si_unit_consistency as well as all the report section from lvm.conf is now profilable:

https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=f9070c196beb32560a4f966c607b08bb6020b1ab
https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=455f23586f0125fb2763c0f2f48e79bc08d9e2c0
https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=c1ce2cc86cb1a9bba16b62119829e1e1ddc0ff87

(I've also added the whole report section to lvm.conf which was missing.)

An example:

[0] raw/~ # lvs
  LV    VG     Attr       LSize   Pool Origin Data%  Move Log Cpy%Sync Convert
  root  fedora -wi-ao----   9.00g                                             
  swap  fedora -wi-ao---- 512.00m                                             
  lvol0 vg     -wi-a-----   4.00m                                             
[0] raw/~ # cat /etc/lvm/profile/out.profile 
global {
	units="K"
}

report {
	headings=0
	lvs_cols="lv_name,vg_name,lv_attr,lv_size"
}
[0] raw/~ # lvs --profile out
  root  fedora -wi-ao---- 9659482.11K
  swap  fedora -wi-ao----  536870.91K
  lvol0 vg     -wi-a-----    4194.30K

Comment 7 Peter Rajnoha 2014-03-17 15:14:21 UTC
(...if there's any other config option related to reporting, I'll probably add that too, I just need to skim through all the settings available.)

Comment 8 Peter Rajnoha 2014-03-18 08:51:56 UTC
(In reply to Peter Rajnoha from comment #7)
> (...if there's any other config option related to reporting, I'll probably
> add that too, I just need to skim through all the settings available.)

Two more:
  global/suffix (this was not mentioned in lvm.conf either!)
  global/lvdisplay_shows_full_device_path


https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=927784cd063ebd4aa3a82ad815db9e1811a900c4
https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=3a6bc7fc65ea57e84fb8705cb24f024b2d8302ed
https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=21b3c983fddac7e1365b4929dc02ddf04cf817bc

Comment 9 Peter Rajnoha 2014-03-31 12:23:46 UTC
To QA: to test this, just create a new profile in /etc/lvm/profile, e.g. "myprofile.profile" and add some of the settings mentioned here - the settings from report section or global/units, global/si_unit_consistency, global/suffix or global/lvdisplay_shows_full_device_path and change them in a way that they differ from defaults. Then issue a command that's affected by those settings - in all these cases mentioned, this is about lvm command reporting - so the affected commands are lvs, vgs, pvs, lvdisplay... See the comments directly in lvm.conf for more information about these settings and what they're changing exactly...

Comment 10 Peter Rajnoha 2014-03-31 12:24:32 UTC
(In reply to Peter Rajnoha from comment #9)
> To QA: to test this, just create a new profile in /etc/lvm/profile, e.g.
> "myprofile.profile"

(to apply the profile, you need to use the LVM command with the "--profile myprofile" option)

Comment 15 Nenad Peric 2014-07-18 11:43:10 UTC
Usage on --profile on the display commands (pvs, lvs, vgs..) is NOT documented or even mentioned as an option for a command line in the man pages. 
This should be added since otherwise the only source of information (which is clear enough to read) are comments in this bug. 

Should I open a separate BZ for this?

Comment 16 Alasdair Kergon 2014-07-18 11:48:43 UTC
Common options in lvm.8.

Only the long form (--comandprofile) is mentioned in the synopsis.

Comment 18 Nenad Peric 2014-07-18 12:20:22 UTC
Since this is not (unfortunately) a man page bug, I will proceed and mark the profiling behaviour of LVM for display commands as verified belos.

Other than that the profiling is working as suggested.

These are some examples which deviate from the default settings by honouring the changes requested by the profile file. 

[root@virt-065 profile]# lvs -a
  LV      VG         Attr       LSize Data%  Meta%  Move Log Cpy%Sync Convert
  lv_root vg_virt065 -wi-ao---- 6.71g                                        
  lv_swap vg_virt065 -wi-ao---- 816.00m                                        
  linear  cluster    -wi-a----- 100.00m                                        
  mirror  cluster    mwi-a-m--- 500.00m                    mirror_mlog 100.00          
  lv1     cluster    mwi---m---   1.00g                    lv1_mlog                    
  [mirror_mimage_0] cluster    iwi-aom--- 500.00m                                                
  [mirror_mimage_1] cluster    iwi-aom--- 500.00m                                                
  [mirror_mimage_2] cluster    iwi-aom--- 500.00m                                                
  [mirror_mimage_3] cluster    iwi-aom--- 500.00m                                                
  [mirror_mlog]     cluster    lwi-aom---   4.00m                                                
  [lv1_mlog]        cluster    lwi---m---   4.00m                                                
  [lv1_mimage_0]    cluster    Iwi---m---   1.00g                                                
  [lv1_mimage_1]    cluster    Iwi---m---   1.00g        


[root@virt-065 profile]# lvs -a --profile mylvs
  LV      VG         Attr       LSize    Log Cpy%Sync Convert Devices     
  lv_root vg_virt065 -wi-ao---- 6872.00m                      /dev/vda2(0)
  lv_swap vg_virt065 -wi-ao----  816.00m                      /dev/vda2(1718)
  linear  cluster    -wi-a-----  100.00m                      /dev/sda(0)    
  mirror  cluster    mwi-a-m---  500.00m mirror_mlog 100.00           mirror_mimage_0(0),mirror_mimage_1(0),mirror_mimage_2(0),mirror_mimage_3(0)
  lv1     cluster    mwi---m--- 1024.00m lv1_mlog                     lv1_mimage_0(0),lv1_mimage_1(0)                                            
  [mirror_mimage_0] cluster    iwi-aom---  500.00m                              /dev/sda(25)                                                               
  [mirror_mimage_1] cluster    iwi-aom---  500.00m                              /dev/sde(0)                                                                
  [mirror_mimage_2] cluster    iwi-aom---  500.00m                              /dev/sdi(0)                                                                
  [mirror_mimage_3] cluster    iwi-aom---  500.00m                              /dev/sdf(0)                                                                
  [mirror_mlog]     cluster    lwi-aom---    4.00m                              /dev/sdf(125)                                                              
  [lv1_mlog]        cluster    lwi---m---    4.00m                              /dev/sdf(126)                                                              
  [lv1_mimage_0]    cluster    Iwi---m--- 1024.00m                              /dev/sda(150)                                                              
  [lv1_mimage_1]    cluster    Iwi---m--- 1024.00m                              /dev/sde(125)           


[root@virt-065 profile]# pvs
  PV         VG         Fmt  Attr PSize PFree
  /dev/vda2  vg_virt065 lvm2 a--  7.51g    0 
  /dev/sda   cluster    lvm2 a--  15.00g 13.41g
  /dev/sde   cluster    lvm2 a--  15.00g 13.51g
  /dev/sdi   cluster    lvm2 a--  15.00g 14.51g
  /dev/sdh   cluster    lvm2 a--  15.00g 15.00g
  /dev/sdf   cluster    lvm2 a--  15.00g 14.50g
[root@virt-065 profile]# pvs --profile mylvs
  PV         VG         PV UUID                               
  /dev/vda2  vg_virt065 26SrEW-Y05Y-UerM-DQ0q-XIhF-fydQ-7YAMrN
  /dev/sda   cluster    px19Jt-MREY-MeSs-pWDz-bROa-dVY7-5YvEQn
  /dev/sde   cluster    BsVbmB-KXWV-KOkU-OmlY-G5XC-Y8My-D4slxV
  /dev/sdi   cluster    bxCCSB-Rifh-hAPZ-mdDV-3sJW-jf44-cEeS9h
  /dev/sdh   cluster    0e4DFx-NLYC-fabI-Z00a-IdYp-Yehc-760vB3
  /dev/sdf   cluster    Lg3YB1-icTt-6xmd-IgM4-2qWz-vxIC-k5JL2S

root@virt-065 profile]# vgs
  VG         #PV #LV #SN Attr   VSize VFree
  vg_virt065   1   2   0 wz--n- 7.51g    0 
  cluster      5   3   0 wz--nc 74.98g 70.92g

[root@virt-065 profile]# vgs --profile mylvs
  VG         #PV #LV VSize    VFree #Ext Free
  vg_virt065   1   2 7688.00m    0m 1922    0
  cluster      5   3 76780.00m 72624.00m 19195 18156


[root@virt-065 profile]# lvm dumpconfig --profile mylvs report
report {
	buffered=0
	lvs_sort="vg_name,lv_name"
	lvs_cols="lv_name,vg_name,lv_attr,lv_size,mirror_log,copy_percent,convert_lv,devices"
	vgs_cols="vg_name,pv_count,lv_count,vg_size,vg_free,vg_extent_count,vg_free_count"
	pvs_cols="pv_name,vg_name,pv_uuid"
}


Marking VERIFIED with:

lvm2-2.02.107-2.el6    BUILT: Fri Jul 11 15:47:33 CEST 2014
lvm2-libs-2.02.107-2.el6    BUILT: Fri Jul 11 15:47:33 CEST 2014
lvm2-cluster-2.02.107-2.el6    BUILT: Fri Jul 11 15:47:33 CEST 2014
udev-147-2.56.el6    BUILT: Fri Jul 11 16:53:07 CEST 2014
device-mapper-1.02.86-2.el6    BUILT: Fri Jul 11 15:47:33 CEST 2014
device-mapper-libs-1.02.86-2.el6    BUILT: Fri Jul 11 15:47:33 CEST 2014
device-mapper-event-1.02.86-2.el6    BUILT: Fri Jul 11 15:47:33 CEST 2014
device-mapper-event-libs-1.02.86-2.el6    BUILT: Fri Jul 11 15:47:33 CEST 2014
device-mapper-persistent-data-0.3.2-1.el6    BUILT: Fri Apr  4 15:43:06 CEST 2014
cmirror-2.02.107-2.el6    BUILT: Fri Jul 11 15:47:33 CEST 2014

Comment 20 errata-xmlrpc 2014-10-14 08:24:29 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.

http://rhn.redhat.com/errata/RHBA-2014-1387.html


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