Bug 1392947 - RFE: Region size changes needed for RAID logical volumes
Summary: RFE: Region size changes needed for RAID logical volumes
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2
Version: 7.2
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Heinz Mauelshagen
QA Contact: cluster-qe@redhat.com
Steven J. Levine
Depends On:
Blocks: 1385242 1394039 1448529
TreeView+ depends on / blocked
Reported: 2016-11-08 14:09 UTC by Jonathan Earl Brassow
Modified: 2021-09-03 12:38 UTC (History)
11 users (show)

Fixed In Version: lvm2-2.02.169-1.el7
Doc Type: Enhancement
Doc Text:
Support for changing region size of RAID logical volume You can now change the region size of a RAID logical volume using the "-R/--regionsize" option of the "lvconvert" command. You must also change the old default value set by the `activation.raid_region_size = N` parameter in the existing `lvm.conf` file or the old value will still will be applied when you create new logical volumes.
Clone Of:
: 1448529 (view as bug list)
Last Closed: 2017-08-01 21:49:49 UTC
Target Upstream Version:
heinzm: needinfo-

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2222 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2017-08-01 18:42:41 UTC

Description Jonathan Earl Brassow 2016-11-08 14:09:09 UTC
Two changes:
1) Update regionsize default to larger size
2) Allow users to change regionsize via lvconvert or lvchange

bug 1392927
bug 1392936

Comment 1 Heinz Mauelshagen 2016-11-16 17:11:51 UTC
Prepared for review/integration as lvconvert functionality on lvm2 upstream
branch dev-lvmguy-raid-takeover-reshape-resize_work

Comment 3 Heinz Mauelshagen 2017-02-28 17:23:57 UTC
Upstream commit cfb6ef654d3d

Comment 6 Jonathan Earl Brassow 2017-04-13 13:30:05 UTC
Roman, we also will need the default region_size changed to completely fix this bug.


Comment 7 Heinz Mauelshagen 2017-04-13 14:17:40 UTC
Upstream commit 5ae7a016b8e5796d36cf491345b1cf8e43ec9ea5
raises the default regionsize from 512KiB to 2MiB.

Existing activation.raid_region_size in lvm.conf has to be adjusted
or the old default will still be applied.

Comment 10 Zdenek Kabelac 2017-04-19 08:16:22 UTC
The regionsize change may require  diskspace allocation for its metadata.
Thus it's not classic  'lvchange'  example.

lvconvert allows to pass 'PV' list for extent allocation.

lvchange does not let you specify this.

So while future version may eventually let you change regionsize via lvchange,  current code path is routed via lvconvert.

Comment 11 Corey Marthaler 2017-04-19 15:23:17 UTC
Additional region size question: bug 1443636

Comment 12 Roman Bednář 2017-05-05 15:39:49 UTC
Marking verified with latest rpms. lvconvert -R option now allows users to change region size. Also the default region size changed from 512K to 2048K. Package update does not change the default value.


# grep region_size /etc/lvm/lvm.conf
	# Configuration option activation/raid_region_size.
	raid_region_size = 512

# lvcreate -n raid1 --type raid1 -L1G vg

# lvconvert -R256K vg/raid1
  WARNING: Failed to connect to lvmetad. Falling back to device scanning.
  Conversion operation not yet supported.


# grep region_size /etc/lvm/lvm.conf
	# Configuration option activation/raid_region_size.
	raid_region_size = 2048

# lvcreate -n raid1 --type raid1 -L1G vg

# lvconvert -R256K vg/raid1
Do you really want to change the region_size 512.00 KiB of LV vg/raid1 to 256.00 KiB? [y/n]: y
  Changed region size on RAID LV vg/raid1 to 256.00 KiB.

# lvs -a -o lv_name,region_size
  LV               Region 
  raid1            256.00k

Also tested with raid4, raid5, raid6, raid10.


lvm2-2.02.171-1.el7    BUILT: Wed May  3 14:05:13 CEST 2017
lvm2-libs-2.02.171-1.el7    BUILT: Wed May  3 14:05:13 CEST 2017
lvm2-cluster-2.02.171-1.el7    BUILT: Wed May  3 14:05:13 CEST 2017
device-mapper-1.02.140-1.el7    BUILT: Wed May  3 14:05:13 CEST 2017
device-mapper-libs-1.02.140-1.el7    BUILT: Wed May  3 14:05:13 CEST 2017
device-mapper-event-1.02.140-1.el7    BUILT: Wed May  3 14:05:13 CEST 2017
device-mapper-event-libs-1.02.140-1.el7    BUILT: Wed May  3 14:05:13 CEST 2017
device-mapper-persistent-data-0.7.0-0.1.rc6.el7    BUILT: Mon Mar 27 17:15:46 CEST 2017
cmirror-2.02.171-1.el7    BUILT: Wed May  3 14:05:13 CEST 2017

Raid volume has to be synced in order to change the region size. Attempting the change on non-synced volume will result in error:

# lvconvert -R256K vg/raid1
  WARNING: Sync status for vg/raid1 is inconsistent.
  Unable to change region size on raid1 LV vg/raid1 while it is not in-sync.


1) Create raid LV using default region size:
# lvcreate -n raidlv --type raid1 -L1G vg

2) Create raid LV overriding default region size at cli:
# lvcreate -n another_raidlv -R512K --type raid1 -L1G vg

3) List the LVs and verify region size:
# lvs -a -o lv_name,region_size -S lv_name=~"raidlv"
  LV                Region
  raidlv             2.00m
  [raidlv_rimage_0]     0 
  [raidlv_rimage_1]     0 
  [raidlv_rmeta_0]      0 
  [raidlv_rmeta_1]      0 

4) Change the region size of existing raid (raid has to be synced)
# lvconvert --yes -R 1024K vg/raidlv
  Changed region size on RAID LV vg/raidlv to 1.00 MiB.

5) Check the result:
# lvs -a -o lv_name,region_size -S lv_name="raidlv"
  LV     Region
  raidlv  1.00m

6) Change default region size in lvm.conf from 2048 to 512
# sed -i -- 's/raid_region_size = 2048/raid_region_size = 512/g' /etc/lvm/lvm.conf

7) Create another raid LV
# lvcreate -n default_raidlv --type raid1 -L1G vg

8) Check that new value from lvm.conf applied correctly:
# lvs -a -o lv_name,region_size -S lv_name="default_raidlv"
  LV             Region 
  default_raidlv 512.00k

Comment 13 Steven J. Levine 2017-05-15 16:29:17 UTC
Editing the doc text for the release note description.  Please let me know if there is any problem or confusion with the edited text.

Comment 14 errata-xmlrpc 2017-08-01 21:49:49 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.


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