Bug 729712

Summary: RFE: LVM RAID support
Product: Red Hat Enterprise Linux 6 Reporter: Jonathan Earl Brassow <jbrassow>
Component: lvm2Assignee: Jonathan Earl Brassow <jbrassow>
Status: CLOSED ERRATA QA Contact: Corey Marthaler <cmarthal>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2CC: agk, coughlan, dwysocha, heinzm, jbrassow, mbroz, prajnoha, prockai, thornber, zkabelac
Target Milestone: rcKeywords: FutureFeature, TechPreview
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.02.87-1.el6 Doc Type: Technology Preview
Doc Text:
Support for MD's RAID personalities has been added to LVM. Currently, on the most basic features are available. It is possible to create, display, rename, use, and remove RAID logical volumes. Automated fault tolerance is not yet available. It is possible to create RAID logical volumes by specifying the '--type <segtype>' argument. Here are a few examples: # Create a RAID1 array (this is a different implementation of RAID1 than LVM's "mirror" segment type) ~> lvcreate --type raid1 -m 1 -L 1G -n my_lv my_vg # Create a RAID5 array (3 stripes + 1 implicit parity) ~> lvcreate --type raid5 -i 3 -L 1G -n my_lv my_vg # Create a RAID6 array (3 stripes + 2 implicit parity) ~> lvcreate --type raid6 -i 3 -L 1G -n my_lv my_vg
Story Points: ---
Clone Of:
: 729715 (view as bug list) Environment:
Last Closed: 2011-12-06 16:59:38 UTC Type: ---
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: 729715, 743047    
Attachments:
Description Flags
My basic LVM RAID testing script
none
Patch to add "Tech Preview" warning when creating RAID logical volumes none

Description Jonathan Earl Brassow 2011-08-10 15:29:15 UTC
Support MD RAID personalities (RAID 1/4/5/6) in LVM.

This bug functions as the user-space side of bug 723010.

Comment 1 Jonathan Earl Brassow 2011-08-10 15:30:26 UTC
Tech Preview for RHEL6.2.

Comment 2 Jonathan Earl Brassow 2011-08-10 16:13:38 UTC
For tech preview in RHEL6.2, the following basic support should be tested:
1) Create
The new RAID types do not have a short-hand switch (e.g. '-m' for mirroring, '-s' for snapshot, etc).  You must specify the segment type you want explicitly using the '--type' argument.  Here are some examples:

Create a 2-way RAID1 array:
  #> lvcreate --type raid1 -m 1 -L 100M -n lv vg
The '-m' argument works exactly like it would for the 'mirror' segment type - it specifies the number of additional copies to the original.  If you change lvm.conf:activation/mirror_segtype_default to "raid1", then the '-m' argument will default to "raid1" type instead of "mirror" type.  This would allow the user to create a 2-way RAID1 array as follows:
  #> lvcreate -m 1 -L 100M -n lv vg

Create a 3-way stripe + 1 parity RAID4 array:
  # lvcreate --type raid4 -i 3 -L 100M -n lv vg
Note that you specify the number of stripes similar to how RAID0 (striping) works already - the correct number of parity drives are added automatically.

Create a 3-way stripe + 1 parity RAID5 array:
  # lvcreate --type raid5 -i 3 -L 100M -n lv vg

Create a 3-way stripe + 2 parity RAID6 array:
  # lvcreate --type raid6 -i 3 -L 100M -n lv vg

You should be able to create RAID1 arrays with different numbers of copies (i.e. adjust the '-m' argument).

You should be able to adjust the number of stripes ('-i' argument) for RAID 4/5/6 as well as the stripe_size ('-I' argument).

There will be a metadata device that is one extent in size for every data or parity device in the array.  Creating a 2-way RAID1 array should result in two metadata devices (lv_rmeta_[01]) and two data devices (lv_rimage_[01]).  Similarly, creating a 3-way stripe (plus 1 implicit parity dev) RAID4 should result in 4 metadata devices (lv_rmeta_[0123]) and 4 data devices (lv_rimage_[0123]).

2) [de]activate
Can you [lv|vg]change -an/-ay the volumes?

3) Remove
The arrays must remove cleanly with no residual LVM devices and no residual DM devices.

4) Display
'lvs' and other display commands should correctly report the name, size, and attributes of the LV and the sub-LVs.  RAID1 arrays should also show the %'age in-sync, similar to current mirrors.

5) Usage
Ensure the devices are usable.  Can you put a file system on it?  Is there any data corruption?  Can you deactivate and reactivate an LV and have the contents be preserved.

Comment 3 Jonathan Earl Brassow 2011-08-10 16:30:22 UTC
Created attachment 517654 [details]
My basic LVM RAID testing script

Be careful - hardcoded values exist in this script.

Comment 4 Jonathan Earl Brassow 2011-08-10 16:35:10 UTC
Output from my unit testing:
[root@bp-01 ~]# ./raid_test_lvm.sh 
Do basic tests? (y/n) y
Performing basic tests
        lvcreate --type raid1 -m 3  -L 100M -n lv vg
        lvcreate --type raid4  -i 4 -L 100M -n lv vg
        lvcreate --type raid5  -i 4 -L 100M -n lv vg
        lvcreate --type raid5_ls  -i 4 -L 100M -n lv vg
        lvcreate --type raid5_la  -i 4 -L 100M -n lv vg
        lvcreate --type raid5_rs  -i 4 -L 100M -n lv vg
        lvcreate --type raid5_ra  -i 4 -L 100M -n lv vg
        lvcreate --type raid6  -i 4 -L 100M -n lv vg
        lvcreate --type raid6_zr  -i 4 -L 100M -n lv vg
        lvcreate --type raid6_nr  -i 4 -L 100M -n lv vg
        lvcreate --type raid6_nc  -i 4 -L 100M -n lv vg
Attempting to create devices with protected names
###  You don't need to test beyond this point at this stage...

Comment 5 Corey Marthaler 2011-08-10 16:42:01 UTC
Adding QA ack for 6.2 Tech Preview testing.

Comment 6 Jonathan Earl Brassow 2011-08-11 03:31:30 UTC
Might want to also test renaming RAID LVs - just fixed a bug there as well.

Comment 7 Siddharth Nagar 2011-08-11 18:13:59 UTC
Jonathan, can you please provide a short summary of this new functionality for including in our technical notes?

Comment 9 Jonathan Earl Brassow 2011-08-11 20:04:04 UTC
Created attachment 517886 [details]
Patch to add "Tech Preview" warning when creating RAID logical volumes

Comment 11 Jonathan Earl Brassow 2011-08-11 20:22:52 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:
Support for MD's RAID personalities has been added to LVM.  Currently, on the most basic features are available.  It is possible to create, display, rename, use, and remove RAID logical volumes.  Automated fault tolerance is not yet available.

It is possible to create RAID logical volumes by specifying the '--type <segtype>' argument.  Here are a few examples:

# Create a RAID1 array (this is a different implementation of RAID1 than LVM's "mirror" segment type)
~> lvcreate --type raid1 -m 1 -L 1G -n my_lv my_vg

# Create a RAID5 array (3 stripes + 1 implicit parity)
~> lvcreate --type raid5 -i 3 -L 1G -n my_lv my_vg

# Create a RAID6 array (3 stripes + 2 implicit parity)
~> lvcreate --type raid6 -i 3 -L 1G -n my_lv my_vg

Comment 13 Corey Marthaler 2011-08-18 15:23:42 UTC
Just a note that testing is currently blocked until the dm_raid target shows up in an official kernel build.

[root@taft-01 ~]#  lvcreate --type raid5 -i 3 -L 100M -n lv taft
FATAL: Module dm_raid not found.
  /sbin/modprobe failed: 1
  raid5: Required device-mapper target(s) not detected in your kernel
  Run `lvcreate --help' for more information.



2.6.32-188.el6.x86_64

lvm2-2.02.87-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011
lvm2-libs-2.02.87-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011
lvm2-cluster-2.02.87-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011
udev-147-2.37.el6    BUILT: Wed Aug 10 07:48:15 CDT 2011
device-mapper-1.02.66-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011
device-mapper-libs-1.02.66-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011
device-mapper-event-1.02.66-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011
device-mapper-event-libs-1.02.66-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011
cmirror-2.02.87-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011

Comment 14 Corey Marthaler 2011-09-01 15:05:10 UTC
This feature appears to be in the latest kernel, however, attempting the first case listed in comment #4 caused major issues (bug 735124).

Comment 15 Corey Marthaler 2011-09-01 16:10:25 UTC
It appears to be just the raid1 create attempt that causes problems. The other cases in comment #4 appear to work.

Comment 16 Corey Marthaler 2011-09-01 21:40:19 UTC
No change in bahavior with the scratch kernel (2.6.32-193.el6.bz735124.x86_64), this bug still exists.

Comment 18 Corey Marthaler 2011-09-15 16:44:51 UTC
The bug associated with the first test case in comment #4 (bug 735124) stills exists in the latest kernel/scratch rpms.


2.6.32-195.el6.x86_64

lvm2-2.02.87-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
lvm2-libs-2.02.87-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
lvm2-cluster-2.02.87-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
udev-147-2.38.el6    BUILT: Fri Sep  9 16:25:50 CDT 2011
device-mapper-1.02.66-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
device-mapper-libs-1.02.66-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
device-mapper-event-1.02.66-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
device-mapper-event-libs-1.02.66-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
cmirror-2.02.87-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011

Comment 19 Corey Marthaler 2011-09-16 20:49:15 UTC
All the test cases in comment #4 now pass with the latest kernel and scratch built rpms.

2.6.32-198.el6.x86_64

lvm2-2.02.87-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
lvm2-libs-2.02.87-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
lvm2-cluster-2.02.87-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
udev-147-2.38.el6    BUILT: Fri Sep  9 16:25:50 CDT 2011
device-mapper-1.02.66-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
device-mapper-libs-1.02.66-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
device-mapper-event-1.02.66-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
device-mapper-event-libs-1.02.66-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
cmirror-2.02.87-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011



[root@taft-01 ~]# lvcreate --type raid1 -m 3  -L 100M -n lv vg
  WARNING:  RAID segment types are considered Tech Preview
  For more information on Tech Preview features, visit:
  https://access.redhat.com/support/offerings/techpreview/
  Logical volume "lv" created
[root@taft-01 ~]# lvremove -f vg
  Logical volume "lv" successfully removed

[root@taft-01 ~]# lvcreate --type raid4  -i 4 -L 100M -n lv vg
  Using default stripesize 64.00 KiB
  WARNING:  RAID segment types are considered Tech Preview
  For more information on Tech Preview features, visit:
  https://access.redhat.com/support/offerings/techpreview/
  Rounding size (25 extents) up to stripe boundary size (28 extents)
  Logical volume "lv" created
[root@taft-01 ~]# lvremove -f vg
  Logical volume "lv" successfully removed

[root@taft-01 ~]# lvcreate --type raid5  -i 4 -L 100M -n lv vg
  Using default stripesize 64.00 KiB
  WARNING:  RAID segment types are considered Tech Preview
  For more information on Tech Preview features, visit:
  https://access.redhat.com/support/offerings/techpreview/
  Rounding size (25 extents) up to stripe boundary size (28 extents)
  Logical volume "lv" created
[root@taft-01 ~]# lvremove -f vg
  Logical volume "lv" successfully removed

[root@taft-01 ~]# lvcreate --type raid5_ls  -i 4 -L 100M -n lv vg
  Using default stripesize 64.00 KiB
  WARNING:  RAID segment types are considered Tech Preview
  For more information on Tech Preview features, visit:
  https://access.redhat.com/support/offerings/techpreview/
  Rounding size (25 extents) up to stripe boundary size (28 extents)
  Logical volume "lv" created
[root@taft-01 ~]# lvremove -f vg
  Logical volume "lv" successfully removed

[root@taft-01 ~]# lvcreate --type raid5_la  -i 4 -L 100M -n lv vg
  Using default stripesize 64.00 KiB
  WARNING:  RAID segment types are considered Tech Preview
  For more information on Tech Preview features, visit:
  https://access.redhat.com/support/offerings/techpreview/
  Rounding size (25 extents) up to stripe boundary size (28 extents)
  Logical volume "lv" created
[root@taft-01 ~]# lvremove -f vg
  Logical volume "lv" successfully removed

[root@taft-01 ~]# lvcreate --type raid5_rs  -i 4 -L 100M -n lv vg
  Using default stripesize 64.00 KiB
  WARNING:  RAID segment types are considered Tech Preview
  For more information on Tech Preview features, visit:
  https://access.redhat.com/support/offerings/techpreview/
  Rounding size (25 extents) up to stripe boundary size (28 extents)
  Logical volume "lv" created
[root@taft-01 ~]# lvremove -f vg
  Logical volume "lv" successfully removed

[root@taft-01 ~]# lvcreate --type raid5_ra  -i 4 -L 100M -n lv vg
  Using default stripesize 64.00 KiB
  WARNING:  RAID segment types are considered Tech Preview
  For more information on Tech Preview features, visit:
  https://access.redhat.com/support/offerings/techpreview/
  Rounding size (25 extents) up to stripe boundary size (28 extents)
  Logical volume "lv" created
[root@taft-01 ~]# lvremove -f vg
  Logical volume "lv" successfully removed

[root@taft-01 ~]# lvcreate --type raid6  -i 4 -L 100M -n lv vg
  Using default stripesize 64.00 KiB
  WARNING:  RAID segment types are considered Tech Preview
  For more information on Tech Preview features, visit:
  https://access.redhat.com/support/offerings/techpreview/
  Rounding size (25 extents) up to stripe boundary size (28 extents)
  Logical volume "lv" created
[root@taft-01 ~]# lvremove -f vg
  Logical volume "lv" successfully removed

[root@taft-01 ~]# lvcreate --type raid6_zr  -i 4 -L 100M -n lv vg
  Using default stripesize 64.00 KiB
  WARNING:  RAID segment types are considered Tech Preview
  For more information on Tech Preview features, visit:
  https://access.redhat.com/support/offerings/techpreview/
  Rounding size (25 extents) up to stripe boundary size (28 extents)
  Logical volume "lv" created
[root@taft-01 ~]# lvremove -f vg
  Logical volume "lv" successfully removed

[root@taft-01 ~]# lvcreate --type raid6_nr  -i 4 -L 100M -n lv vg
  Using default stripesize 64.00 KiB
  WARNING:  RAID segment types are considered Tech Preview
  For more information on Tech Preview features, visit:
  https://access.redhat.com/support/offerings/techpreview/
  Rounding size (25 extents) up to stripe boundary size (28 extents)
  Logical volume "lv" created
[root@taft-01 ~]# lvremove -f vg
  Logical volume "lv" successfully removed

[root@taft-01 ~]# lvcreate --type raid6_nc  -i 4 -L 100M -n lv vg
  Using default stripesize 64.00 KiB
  WARNING:  RAID segment types are considered Tech Preview
  For more information on Tech Preview features, visit:
  https://access.redhat.com/support/offerings/techpreview/
  Rounding size (25 extents) up to stripe boundary size (28 extents)
  Logical volume "lv" created
[root@taft-01 ~]# lvremove -f vg
  Logical volume "lv" successfully removed

Comment 22 Corey Marthaler 2011-09-22 15:21:50 UTC
All the create test cases continue to work in the official build. Marking verified. Note: Only create cases were attempted for this feature, no conversion or failure cases were, since they are not supported.

2.6.32-198.el6.x86_64

lvm2-2.02.87-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
lvm2-libs-2.02.87-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
lvm2-cluster-2.02.87-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
udev-147-2.38.el6    BUILT: Fri Sep  9 16:25:50 CDT 2011
device-mapper-1.02.66-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
device-mapper-libs-1.02.66-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
device-mapper-event-1.02.66-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
device-mapper-event-libs-1.02.66-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
cmirror-2.02.87-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011

Comment 23 errata-xmlrpc 2011-12-06 16:59:38 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-2011-1522.html